diff options
author | Andreas K. Hüttel <dilfridge@gentoo.org> | 2023-08-06 23:47:04 +0200 |
---|---|---|
committer | Andreas K. Hüttel <dilfridge@gentoo.org> | 2023-08-06 23:47:04 +0200 |
commit | 78ad69992cbfb852ea077dd2378d860189189aca (patch) | |
tree | 16fe0bb4848d103131050e8e0128c6dfff9717ce | |
parent | Merge two scripts and speed things up (diff) | |
download | mastermirror-scripts-78ad69992cbfb852ea077dd2378d860189189aca.tar.gz mastermirror-scripts-78ad69992cbfb852ea077dd2378d860189189aca.tar.bz2 mastermirror-scripts-78ad69992cbfb852ea077dd2378d860189189aca.zip |
Make verbosity possible
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
-rwxr-xr-x | sign-sync-binpackages.sh | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/sign-sync-binpackages.sh b/sign-sync-binpackages.sh index d5e1caf..ed85e11 100755 --- a/sign-sync-binpackages.sh +++ b/sign-sync-binpackages.sh @@ -16,12 +16,14 @@ _ARCHES="alpha amd64 arm64 arm hppa ia64 loong m68k mips ppc riscv s390 sh sparc #alpha amd64 arm64 arm hppa ia64 loong m68k mips ppc riscv s390 sh sparc x86 ARCHES=${ARCHES:-${_ARCHES}} +VERBOSE='1' INTREE=/release/weekly/binpackages STAGINGTREE=/release/binpackages-staging OUTTREE=/var/tmp/gmirror-releases/releases IN_RSYNC_OPTS=( + --no-motd --archive --delete --delete-after @@ -53,13 +55,17 @@ touch ${STAGINGTREE}/.running || exit 110 # make sure we have an updated gpg-agent gpgconf --kill all +# prepare some handy variables +_verbose_v='' +[[ ${VERBOSE} == '1' ]] && _verbose_v='-v' + # 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 "${IN_RSYNC_OPTS[@]}" ${INTREE}/${a}/* ${STAGINGTREE}/${a}/ + rsync ${_verbose_v} "${IN_RSYNC_OPTS[@]}" ${INTREE}/${a}/* ${STAGINGTREE}/${a}/ done # now the set of files is frozen in the staging dir, and we dont care @@ -79,11 +85,19 @@ for t in ${STAGINGTREE}/*/*/* ; do find "${t}" -name '*.gpkg.tar' -print0 | \ parallel -0 -n1 -- "tar tf {} |grep -E -e '/metadata\.tar\..*\.sig$' -L --label={}" > ${STAGINGTREE}/.unsigned + if [[ ${VERBOSE} == '1' ]] ; then + echo "List of unsigned pacakges:" + cat ${STAGINGTREE}/.unsigned + echo ; echo + fi + # sign the packages - xargs -n1 -- gpkg-sign "{}" < ${STAGINGTREE}/.unsigned > /dev/null || exit 113 + [[ ${VERBOSE} == '1' ]] && xargs -n1 -- gpkg-sign "{}" < ${STAGINGTREE}/.unsigned || exit 113 + [[ ${VERBOSE} == '1' ]] || xargs -n1 -- gpkg-sign "{}" < ${STAGINGTREE}/.unsigned > /dev/null || exit 113 # regenerate the indices - PKGDIR=${t} emaint -f binhost > /dev/null || exit 114 + [[ ${VERBOSE} == '1' ]] && PKGDIR=${t} emaint -f binhost || exit 114 + [[ ${VERBOSE} == '1' ]] || PKGDIR=${t} emaint -f binhost > /dev/null || exit 114 done # unfortunately these commands make much noise... let's hope we notice errors @@ -92,8 +106,8 @@ done # the files are distributed for a in ${ARCHES}; do - [[ -d ${OUTTREE}/${a}/binpackages ]] || mkdir -p ${OUTTREE}/${a}/binpackages - rsync "${OUT_RSYNC_OPTS[@]}" ${STAGINGTREE}/${a}/* ${OUTTREE}/${a}/binpackages/ + [[ -d ${OUTTREE}/${a}/binpackages ]] || mkdir -p ${_verbose_v} ${OUTTREE}/${a}/binpackages + rsync ${_verbose_v} "${OUT_RSYNC_OPTS[@]}" ${STAGINGTREE}/${a}/* ${OUTTREE}/${a}/binpackages/ date -u > ${OUTTREE}/${a}/binpackages/.timestamp done |