summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas K. Hüttel <dilfridge@gentoo.org>2023-08-06 01:15:08 +0200
committerAndreas K. Hüttel <dilfridge@gentoo.org>2023-08-06 01:15:08 +0200
commitf1ac8778e45caa7c397f4c8a8976eccb94a07c0e (patch)
tree02260256d6bb3bb1a8dc80f43576ad8176d93b7f
parentfixes (diff)
downloadmastermirror-scripts-f1ac8778e45caa7c397f4c8a8976eccb94a07c0e.tar.gz
mastermirror-scripts-f1ac8778e45caa7c397f4c8a8976eccb94a07c0e.tar.bz2
mastermirror-scripts-f1ac8778e45caa7c397f4c8a8976eccb94a07c0e.zip
first complete version
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
-rwxr-xr-xsign-binpackages.sh28
-rwxr-xr-xsync-binpackages.sh40
2 files changed, 35 insertions, 33 deletions
diff --git a/sign-binpackages.sh b/sign-binpackages.sh
index 8fa8475..e11ba71 100755
--- a/sign-binpackages.sh
+++ b/sign-binpackages.sh
@@ -14,7 +14,6 @@ ARCHES=${ARCHES:-${_ARCHES}}
INTREE=/release/weekly/binpackages
SIGTREE=/release/binpackages
-DEBUG=''
VERBOSE=''
BINPKG_GPG_SIGNING_GPG_HOME=/home/gmirror/.gnupg-releng
@@ -22,38 +21,23 @@ BINPKG_GPG_SIGNING_KEY=DCD05B71EAB94199527F44ACDB6B8C1F96D8BF6D
gpgconf --kill all
-## step 0: ensure all directories exist and have the right
-## permissions
-## we can't actually do that here since this script runs as
-## unprivileged user
-#
-#for a in $ARCHES ; do
-# if ! [[ -d ${INTREE}/${a} ]]; then
-# mkdir -p ${INTREE}/${a}
-# chown ${a}:${a} ${INTREE}/${a}
-# chmod u+rwx,o+rx ${INTREE}/${a}
-# fi
-#done
-#
-#[[ -d SIGTREE ]] || mkdir -p ${SIGTREE}
-
# step 1: rsync from the dirs where the arches copy in
# make sure to *not* overwrite existing newer files (obviously
# the signature changed them)...
for a in $ARCHES ; do
- rsync --recursive --delete --delete-after --update ${INTREE}/${a}/ ${SIGTREE}/${a}/
+ rsync ${VERBOSE} --archive --delete --delete-after --update --mkpath ${INTREE}/${a}/* ${SIGTREE}/${a}/
done
# step 2: iterate over all binary package trees, sign
# all unsigned files
# we assume the directory structure to be
-# /binpackages/amd64/17.1/x86-64
-# /binpackages/amd64/17.1/x86-64_musl
-# /binpackages/mips/17.0/mipsel3_n32
-# /binpackages/x86/17.0/x86_musl_hardened
+# .../binpackages/amd64/17.1/x86-64
+# .../binpackages/amd64/17.1/x86-64_musl
+# .../binpackages/mips/17.0/mipsel3_n32
+# .../binpackages/x86/17.0/x86_musl_hardened
for t in ${SIGTREE}/*/*/* ; do
- find ${t} -name '*.gpkg' -exec gpkg-sign --skip-signed \{\} \;
+ find "${t}" -name '*.gpkg' -exec gpkg-sign --skip-signed \{\} \;
PKGDIR=${t} emaint binhost fix
done
diff --git a/sync-binpackages.sh b/sync-binpackages.sh
index da94c33..dbee1d7 100755
--- a/sync-binpackages.sh
+++ b/sync-binpackages.sh
@@ -1,19 +1,37 @@
#!/bin/bash
# Copyright 2011-2023 Gentoo Authors; Distributed under the GPL v2
-# this is the directory where the tree is fully assembled and all packages are signed
+# for testing
+ARCHES="arm64 sparc"
+
+# Keep this variable in sync in both sign-binpackages.sh & sync-binpackages.sh
+_ARCHES="alpha amd64 arm64 arm hppa ia64 loong m68k mips ppc riscv s390 sh sparc x86"
+ #alpha amd64 arm64 arm hppa ia64 loong m68k mips ppc riscv s390 sh sparc x86
+ARCHES=${ARCHES:-${_ARCHES}}
+
+# this is the directory where all packages are signed
# we assume it's on dipper / releng-incoming, but might as well give a full rsync
# specification here
-INITIALDIR="/release/binpackages"
+SRCDIR="/release/binpackages"
+# append ${a}
-FINALDIR="/var/tmp/gmirror-releases/binpackages"
-RSYNC="/usr/bin/rsync"
-RSYNC_ARGS="--no-motd --recursive --times --links --ignore-errors --delete --delete-after --timeout=300 --exclude=timestamp*"
-RSYNC_ARGS="${RSYNC_ARGS} --quiet"
+# this is the outgoing directory
+DSTDIR="/var/tmp/gmirror-releases/releases"
+# append ${a}/binpackages
-[[ -d ${FINALDIR} ]] || mkdir ${FINALDIR}
-${RSYNC} ${RSYNC_ARGS} ${INITIALDIR}/ ${FINALDIR}/
+RSYNC="/usr/bin/rsync"
+RSYNC_OPTS=(
+ --no-motd
+ --archive
+ --ignore-errors
+ --delete
+ --delete-after
+ --timeout=300
+ --quiet
+ --mkpath
+)
-/bin/date -u '+%s %c' > ${FINALDIR}/timestamp.x
-/bin/date -R -u > ${FINALDIR}/timestamp.chk
-/bin/date -u '+%s' > ${FINALDIR}/timestamp.mirmon
+for a in ${ARCHES}; do
+ [[ -d ${DSTDIR}${a}/binpackages ]] || mkdir ${DSTDIR}/${a}/binpackages
+ ${RSYNC} ${RSYNC_ARGS} ${SRCDIR}/${a}/* ${DSTDIR}/${a}/binpackages/
+done