summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <erich.eckner.ext@bestsecret.com>2024-07-29 18:21:54 +0200
committerErich Eckner <erich.eckner.ext@bestsecret.com>2024-07-29 18:21:54 +0200
commitc7906aa4312e2a035fa2765abe305bb3297b524d (patch)
tree2247fdf5a141bb14ab825d23124bd1524dc61473
parentf8227ddef7eb3a1ba894876bdd5ddd2a10e9845f (diff)
downloadarchlinuxewe-c7906aa4312e2a035fa2765abe305bb3297b524d.tar.xz
sign-and-upload-all: probably fix it
-rwxr-xr-xsign-and-upload-all130
1 files changed, 63 insertions, 67 deletions
diff --git a/sign-and-upload-all b/sign-and-upload-all
index 843c4f5e8..305132640 100755
--- a/sign-and-upload-all
+++ b/sign-and-upload-all
@@ -11,9 +11,9 @@ fi
pkill -x keyboxd
for distro in arch artix; do
- unset archs
- declare -A archs
for arch in x86_64 i486 i686 pentium4; do
+ unset pkgs
+ declare -A pkgs
[ "${arch}" != 'x86_64' ] && [ "${distro}" != 'arch' ] && continue
upkgs=$(
ssh ${distro}linuxewe@eckner.net '
@@ -41,31 +41,65 @@ for distro in arch artix; do
[ -f "${pkg}.sig" ] \
|| gpg --detach-sign -u 5FDCA472AB93292BC678FD59255A76DB9A12601A "${pkg}" \
|| exit 1
- arch="${pkg##*-}"
- arch="${arch%%.*}"
- archs["${arch}"]="${arch}"
+ parch="${pkg##*-}"
+ parch="${parch%%.*}"
+ pkgs["${parch}"]+=" ${pkg}"
done
- done
-
- for arch in "${!archs[@]}"; do
- rsync -av --progress --ignore-existing */${distro}*-${archs["${arch}"]}/*-${arch}.pkg.tar.zst{,.sig} ${distro}linuxewe@eckner.net:os/${arch}/
- pkgs=$(
- printf '%s\n' */${distro}*-${archs["${arch}"]}/*-${arch}.pkg.tar.zst \
- | sed 's@^.*/@@' \
- | tr '\n' ' '
- )
-
- if [ "${arch}" = 'any' ]; then
- ssh ${distro}linuxewe@eckner.net '
- cd os
- for arch in */; do
- [ "${arch}" = 'any/' ] && continue
- cd ${arch}
- for pkg in '"${pkgs}"'; do
- ln -s ../any/${pkg}
- ln -s ../any/${pkg}.sig
+ for archdir in "${!pkgs[@]}"; do
+ rsync -av --progress --ignore-existing \
+ ${pkgs["${archdir}"]} \
+ $(printf '%s.sig\n' "${pkgs["${archdir}"]}") \
+ ${distro}linuxewe@eckner.net:os/${archdir}/
+ if [ "${archdir}" = 'any' ]; then
+ ssh ${distro}linuxewe@eckner.net '
+ cd os
+ for arch in */; do
+ [ "${arch}" = 'any/' ] && continue
+ cd ${arch}
+ for pkg in '"${pkgs["${archdir}"]##*/}"'; do
+ ln -s ../any/${pkg}
+ ln -s ../any/${pkg}.sig
+ done
+ repo-add -s -k 0x3CFB0AD8F60030F8 '"${distro}"'linuxewe.db.tar.gz '"${pkgs["${archdir}"]##*/}"'
+ find -maxdepth 1 -mindepth 1 -not -type d -printf '"'"'%f\n'"'"' \
+ | grep -vxFf <(
+ ls '"${distro}"'linuxewe.{db,files}*
+ bsdtar -Oxf '"${distro}"'linuxewe.db.tar.gz \
+ | sed -n '"'"'
+ /^%FILENAME%$/ {
+ N
+ s/^.*\n//
+ p
+ s/$/.sig/
+ p
+ }
+ '"'"'
+ ) \
+ | xargs -r rm -f
+ cd ..
done
- repo-add -s -k 0x3CFB0AD8F60030F8 '"${distro}"'linuxewe.db.tar.gz '"${pkgs}"'
+ cd any
+ find -maxdepth 1 -mindepth 1 -not -type d -printf '"'"'%f\n'"'"' \
+ | grep -vxFf <(
+ for db in ../*/'"${distro}"'linuxewe.db.tar.gz; do
+ bsdtar -Oxf "${db}"
+ done \
+ | sed -n '"'"'
+ /^%FILENAME%$/ {
+ N
+ s/^.*\n//
+ p
+ s/$/.sig/
+ p
+ }
+ '"'"'
+ ) \
+ | xargs -r rm -f
+ '
+ else
+ ssh ${distro}linuxewe@eckner.net '
+ cd os/'"${archdir}"'
+ repo-add -s -k 0x3CFB0AD8F60030F8 '"${distro}"'linuxewe.db.tar.gz '"${pkgs["${archdir}"]##*/}"'
find -maxdepth 1 -mindepth 1 -not -type d -printf '"'"'%f\n'"'"' \
| grep -vxFf <(
ls '"${distro}"'linuxewe.{db,files}*
@@ -80,47 +114,9 @@ for distro in arch artix; do
}
'"'"'
) \
- | xargs -r echo rm -f
- cd ..
- done
- cd any
- find -maxdepth 1 -mindepth 1 -not -type d -printf '"'"'%f\n'"'"' \
- | grep -vxFf <(
- for db in ../*/'"${distro}"'linuxewe.db.tar.gz; do
- bsdtar -Oxf "${db}"
- done \
- | sed -n '"'"'
- /^%FILENAME%$/ {
- N
- s/^.*\n//
- p
- s/$/.sig/
- p
- }
- '"'"'
- ) \
- | xargs -r echo rm -f
- '
- else
- ssh ${distro}linuxewe@eckner.net '
- cd os/'"${arch}"'
- repo-add -s -k 0x3CFB0AD8F60030F8 '"${distro}"'linuxewe.db.tar.gz '"${pkgs}"'
- find -maxdepth 1 -mindepth 1 -not -type d -printf '"'"'%f\n'"'"' \
- | grep -vxFf <(
- ls '"${distro}"'linuxewe.{db,files}*
- bsdtar -Oxf '"${distro}"'linuxewe.db.tar.gz \
- | sed -n '"'"'
- /^%FILENAME%$/ {
- N
- s/^.*\n//
- p
- s/$/.sig/
- p
- }
- '"'"'
- ) \
- | xargs -r echo rm -f
- '
- fi
+ | xargs -r rm -f
+ '
+ fi
+ done
done
done