diff options
Diffstat (limited to 'pkgkit')
-rwxr-xr-x | pkgkit | 36 |
1 files changed, 17 insertions, 19 deletions
@@ -17,7 +17,7 @@ usage() { get_pkgvar() ( var="$1" -set +u + set +u . APKBUILD eval 'printf "%s\n" "$'"$var"'"' ) @@ -93,8 +93,10 @@ add_repo() { openssl genrsa -out "$key" 2048 ) fi + pkey="$(basename "$key").pub" sudo openssl rsa -in $key -pubout \ - -out /etc/apk/keys/$(basename "$key").pub + -out /etc/apk/keys/"$pkey" + cp /etc/apk/keys/"$pkey" ~/.abuild/"$pkey" if [ $set_default -eq 1 ] then echo "PACKAGER_PRIVKEY="'"'$key'"' >> \ @@ -225,7 +227,7 @@ upload_pkg() ( aver="$(get_aver)" set -x - path="$remote_path/$aver/$arch" + path="$remote_path/$aver/$repo/$arch" ssh "$remote" mkdir -p "$path" url=$(echo "$remote" | cut -d@ -f2) @@ -253,24 +255,20 @@ update_index() ( . /etc/os-release aver="$(get_aver)" - tmp_repo="/tmp/$aver/" - path="$remote_path/$aver/$arch" - - # since my remote server is not alpine I have to download the repo localy - rsync --blocking-io -rP \ - "$remote:$path/" \ - "$tmp_repo" + path="$remote_path/$aver/$repo/$arch" set -x - find "$tmp_repo" -type f -name '*.apk' -print0 | - xargs -0 apk index \ - --rewrite-arch "$(uname -m)" \ - -x "$tmp_repo"/APKINDEX.tar.gz \ - -o "$tmp_repo"/APKINDEX.unsigned.tar.gz - - abuild-sign "$tmp_repo/APKINDEX.unsigned.tar.gz" - rsync --blocking-io -rP "$tmp_repo/APKINDEX.unsigned.tar.gz" \ - "$remote:$path/APKINDEX.tar.gz" + ssh "$remote" \ + find "$path" -type f -name '*.apk' -print0 | + ssh "$remote" xargs -0 apk index \ + --rewrite-arch "$(uname -m)" \ + -x "$path"/APKINDEX.tar.gz \ + -o "$path"/APKINDEX.unsigned.tar.gz + rsync --blocking-io -rP \ + "$remote:$path/APKINDEX.unsigned.tar.gz" \ + /tmp/APKINDEX.tar.gz + abuild-sign /tmp/APKINDEX.tar.gz + rsync --blocking-io -rP /tmp/APKINDEX.tar.gz "$remote:$path/" set +x ) |