~dricottone/huttese-apk

68e2b4a1d299bc5e3e788416a2ec0fe1f3e1225f — Drew DeVault 5 years ago 78b5be0
Actually fix old package removal
1 files changed, 8 insertions(+), 8 deletions(-)

M pkgkit
M pkgkit => pkgkit +8 -8
@@ 176,7 176,6 @@ mirror_ver() (
				;;
		esac
	done
	echo none
)

upload_pkg() (


@@ 184,19 183,20 @@ upload_pkg() (
	pkg="$2"
	arch="$(uname -m)"

	set -x
	path="$remote_path/$repo/$arch"
	ssh "$remote" mkdir -p "$path"

	url=$(echo "$remote" | cut -d@ -f2)
	prev_ver=$(mirror_ver "$url" "$pkg")

	set -x
	if [ "$prev_ver" != "none" ]
	then
		prev_pkgver=$(printf "%s" "$prev_ver" | cut -d'-' -f1)
		prev_pkgrel=$(printf "%s" "$prev_ver" | cut -d'-' -f2 | cut -d'r' -f2-)
		ssh "$remote" rm -f "$path/$pkg-$prev_pkgver-r$prev_pkgrel.apk"
	fi
	for ver in $prev_ver
	do
		if [ "$prev_ver" != "none" ]
		then
			ssh "$remote" rm -f "$path/$pkg-$ver.apk"
		fi
	done
	pkgver="$(get_pkgvar pkgver)"
	pkgrel="$(get_pkgvar pkgrel)"