~xdavidwu/aurbuild

12de36b795cb6b215588856180b26d62349e8c88 — xdavidwu 2 years ago e97ec12
update: also print pkgver in build description
1 files changed, 10 insertions(+), 4 deletions(-)

M update
M update => update +10 -4
@@ 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