diff options
author | Holger Levsen <holger@layer-acht.org> | 2015-12-11 14:43:53 +0100 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-12-11 14:43:53 +0100 |
commit | caf339a8a53f630bd90f51ca734eaab0e19586ea (patch) | |
tree | fe65b6f09d7bc37521045611d6e6f3df9bfe2716 /bin | |
parent | f1eb745cc2ea25833ebb8c069d97c429922c4337 (diff) | |
download | jenkins.debian.net-caf339a8a53f630bd90f51ca734eaab0e19586ea.tar.xz |
reproducible archlinux: refactor, only start schroot session if repositories need to be updated
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/reproducible_build_archlinux_pkg.sh | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/bin/reproducible_build_archlinux_pkg.sh b/bin/reproducible_build_archlinux_pkg.sh index 64b5c3ee..5bc20871 100755 --- a/bin/reproducible_build_archlinux_pkg.sh +++ b/bin/reproducible_build_archlinux_pkg.sh @@ -42,19 +42,29 @@ handle_remote_error() { update_archlinux_repositories() { # every 2 days we check for new archlinux packages in all tested repositories touch -d "$(date -d '2 days ago' '+%Y-%m-%d') 00:00 UTC" $DUMMY - local SESSION="archlinux-scheduler-$RANDOM" - schroot --begin-session --session-name=$SESSION -c jenkins-reproducible-archlinux + local NEED_UPDATE=false local REPO for REPO in $ARCHLINUX_REPOS ; do if [ ! -f ${ARCHLINUX_PKGS}_$REPO ] || [ $DUMMY -nt ${ARCHLINUX_PKGS}_$REPO ] ; then - echo "$(date -u ) - updating list of available packages in repository '$REPO'." - schroot --run-session -c $SESSION --directory /var/abs/$REPO -- ls -1|sort -R|xargs echo > ${ARCHLINUX_PKGS}_$REPO - echo "$(date -u ) - these packages in repository '$REPO' are known to us:" - cat ${ARCHLINUX_PKGS}_$REPO + NEED_UPDATE=true fi done - schroot --end-session -c $SESSION rm $DUMMY > /dev/null + if $NEED_UPDATE ; then + local SESSION="archlinux-scheduler-$RANDOM" + schroot --begin-session --session-name=$SESSION -c jenkins-reproducible-archlinux + for REPO in $ARCHLINUX_REPOS ; do + if [ ! -f ${ARCHLINUX_PKGS}_$REPO ] || [ $DUMMY -nt ${ARCHLINUX_PKGS}_$REPO ] ; then + echo "$(date -u ) - updating list of available packages in repository '$REPO'." + schroot --run-session -c $SESSION --directory /var/abs/$REPO -- ls -1|sort -R|xargs echo > ${ARCHLINUX_PKGS}_$REPO + echo "$(date -u ) - these packages in repository '$REPO' are known to us:" + cat ${ARCHLINUX_PKGS}_$REPO + fi + done + schroot --end-session -c $SESSION + else + echo "$(date -u ) - repositories recent enough, no update needed." + fi } choose_package() { |