@@ 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