@@ 12,14 12,19 @@ fetch_info() {
done
info=$(curl -f "https://aur.archlinux.org/rpc/?v=5&type=info$query")
}
+
resolve_timestamp() {
echo "$info" | jq -r ".results[] | select(.Name == \"$1\") | .LastModified"
}
+resolve_version() {
+ echo "$info" | jq -r ".results[] | select(.Name == \"$1\") | .Version"
+}
+
dispatch() {
yq ".sources += [\"https://aur.archlinux.org/$1.git\"] |
.environment.pkgbase = \"$1\"
- " < build.yml | ssh builds@builds.xdavidwu.link "submit -n$1\ $2 -t aurbuild -t $1"
+ " < build.yml | ssh builds@builds.xdavidwu.link "submit -n$1\ $2\ ($3) -t aurbuild -t $1"
}
fetch_info
@@ 28,10 33,11 @@ for i in *; do
[ ! -d "$i" ] && continue
echo "$i"
version=$(cat "$i/version" || true)
- new_ver=$(resolve_timestamp "$i" "$branch" "$version")
+ new_ver=$(resolve_timestamp "$i")
if [ "$version" != "$new_ver" ]; then
- echo "dispatch $i $new_ver"
- dispatch "$i" "$new_ver"
+ pkgver=$(resolve_version "$i")
+ echo "dispatch $i $new_ver $pkgver"
+ dispatch "$i" "$new_ver" "$pkgver"
echo "$new_ver" > "$i/version"
fi
done