~dricottone/huttese-apk

204a142c5ce915558df48fbf444c00320c1f42cb — Drew DeVault 5 years ago b360456
Really fix pkgrel handling for really real
1 files changed, 10 insertions(+), 8 deletions(-)

M pkgkit
M pkgkit => pkgkit +10 -8
@@ 40,8 40,9 @@ find_pkg_repo() (
update_pkgrel() (
	pkg="$1"
	pkgver="$(get_pkgvar pkgver)"
	prev_pkgver=$(apk search -x "$pkg" | cut -c$((${#pkg}+2))-)
	prev_pkgrel=$(printf "%s" "$prev_pkgver" | cut -d'-' -f2 | cut -d'r' -f2)
	prev_ver=$(apk search -x "$pkg" | cut -c$((${#pkg}+2))-)
	prev_pkgver=$(printf "%s" "$prev_ver" | cut -d'-' -f1)
	prev_pkgrel=$(printf "%s" "$prev_ver" | cut -d'-' -f2 | cut -d'r' -f2-)
	if [ "$prev_pkgver" == "$pkgver" ]
	then
		pkgrel=$((prev_pkgrel + 1))


@@ 51,7 52,7 @@ update_pkgrel() (

update_pkgver() {
	pkgver="$1"
	prev_pkgver=$(apk search -x ${project} | cut -d '-' -f3-)
	prev_pkgver=$(apk search -x ${project} | cut -d '-' -f2)
	sed -e "s/pkgver=.*/pkgver=$pkgver/" -i APKBUILD
	if [ "$prev_pkgver" != "$pkgver" ]
	then


@@ 138,13 139,14 @@ upload_pkg() (
	path="$remote_path/$repo/$arch"
	ssh "$remote" mkdir -p "$path"

	prev_pkgver=$(apk search -x "$pkg" | cut -c$((${#pkg}+2))-)
	prev_pkgrel=$(printf "%s" "$prev_pkgver" | cut -d'-' -f2 | cut -d'r' -f2)
	set -x
	ssh "$remote" rm -f "$path/$pkg-$prev_pkgver-r$prev_pkgrel.apk"

	prev_ver=$(apk search -x "$pkg" | cut -c$((${#pkg}+2))-)
	prev_pkgver=$(printf "%s" "$prev_ver" | cut -d'-' -f1)
	prev_pkgrel=$(printf "%s" "$prev_ver" | cut -d'-' -f2 | cut -d'r' -f2-)
	pkgver="$(get_pkgvar pkgver)"
	pkgrel="$(get_pkgvar pkgrel)"

	set -x
	ssh "$remote" rm -f "$path/$pkg-$prev_pkgver-r$prev_pkgrel.apk"
	rsync --blocking-io -rsP \
		~/packages/"$repo/$arch/$pkg-$pkgver-r$pkgrel.apk" "$remote":"$path/"
	set +x