summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2023-08-07 13:36:41 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2023-08-07 13:36:41 -0700
commit2fc9f9632a1e8cfbd190a8417bf448f5992bcfa0 (patch)
tree8e3e562806563f1c64ed911b4f8c906236a57e8c
parentsign-sync-binpackages: refactor lockfile (diff)
downloadmastermirror-scripts-2fc9f9632a1e8cfbd190a8417bf448f5992bcfa0.tar.gz
mastermirror-scripts-2fc9f9632a1e8cfbd190a8417bf448f5992bcfa0.tar.bz2
mastermirror-scripts-2fc9f9632a1e8cfbd190a8417bf448f5992bcfa0.zip
sign-sync-binpackages: fix early exit on verbose
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-xsign-sync-binpackages.sh26
1 files changed, 18 insertions, 8 deletions
diff --git a/sign-sync-binpackages.sh b/sign-sync-binpackages.sh
index 4dfe034..cc1a957 100755
--- a/sign-sync-binpackages.sh
+++ b/sign-sync-binpackages.sh
@@ -86,7 +86,8 @@ done
for t in ${STAGINGTREE}/*/*/* ; do
# find all unsigned packages as fast as possible
find "${t}" -name '*.gpkg.tar' -print0 | \
- parallel -0 -n1 --will-cite -- "tar tf {} |grep -E -e '/metadata\.tar\..*\.sig$' -L --label={}" > ${STAGINGTREE}/.unsigned
+ parallel -0 -n1 --will-cite -- "tar tf {} |grep -E -e '/metadata\.tar\..*\.sig$' -L --label={}" \
+ > ${STAGINGTREE}/.unsigned
if [[ ${VERBOSE} == '1' ]] ; then
echo "List of unsigned pacakges:"
@@ -95,12 +96,18 @@ for t in ${STAGINGTREE}/*/*/* ; do
fi
# sign the packages
- [[ ${VERBOSE} == '1' ]] && xargs -n1 --no-run-if-empty -- gpkg-sign < ${STAGINGTREE}/.unsigned || exit 113
- [[ ${VERBOSE} == '1' ]] || xargs -n1 --no-run-if-empty -- gpkg-sign < ${STAGINGTREE}/.unsigned > /dev/null || exit 113
+ if [[ ${VERBOSE} == '1' ]]; then
+ xargs -n1 --no-run-if-empty -- gpkg-sign < ${STAGINGTREE}/.unsigned || exit 113
+ else
+ xargs -n1 --no-run-if-empty -- gpkg-sign < ${STAGINGTREE}/.unsigned > /dev/null || exit 113
+ fi
# regenerate the indices
- [[ ${VERBOSE} == '1' ]] && PKGDIR=${t} emaint -f binhost || exit 114
- [[ ${VERBOSE} == '1' ]] || PKGDIR=${t} emaint -f binhost > /dev/null || exit 114
+ if [[ ${VERBOSE} == '1' ]]; then
+ PKGDIR=${t} emaint -f binhost || exit 114
+ else
+ PKGDIR=${t} emaint -f binhost > /dev/null || exit 114
+ fi
done
# unfortunately these commands make much noise... let's hope we notice errors
@@ -109,11 +116,14 @@ done
# the files are distributed
for a in ${ARCHES}; do
- [[ -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
+ arch_binpackages=${OUTTREE}/${a}/binpackages
+ [[ -d ${arch_binpackages} ]] || mkdir -p ${_verbose_v} ${arch_binpackages}
+ rsync ${_verbose_v} "${OUT_RSYNC_OPTS[@]}" ${STAGINGTREE}/${a}/* ${arch_binpackages}/
+ date -u > ${arch_binpackages}/.timestamp
done
# we're done so remove the "lockfile"
rm ${LOCKFILE}
+
+# vim: et ts=2 sts=2 sw=2