From 49e92cf705771c2a47fed50f95b42ab65a49e77a Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Mon, 26 Dec 2022 15:20:41 +0100 Subject: fix: Add jellyfin again --- pkgkit | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) (limited to 'pkgkit') diff --git a/pkgkit b/pkgkit index 60d1474..4afc8e9 100755 --- a/pkgkit +++ b/pkgkit @@ -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 ) -- cgit v1.2.3