X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fporterbox%2Ffiles%2Fsetup-all-dchroots;h=652d08b6538caa48c4ca3ededdace8ea3d9466f7;hb=20903357441b34d8c5d656fb1867cfb0898ebdbb;hp=e483895a913f28159be81087b09d5eae004f2cc3;hpb=4a4ca906c7883f7398282351f1c6b3d82ce5f582;p=mirror%2Fdsa-puppet.git diff --git a/modules/porterbox/files/setup-all-dchroots b/modules/porterbox/files/setup-all-dchroots index e483895a9..652d08b65 100755 --- a/modules/porterbox/files/setup-all-dchroots +++ b/modules/porterbox/files/setup-all-dchroots @@ -31,20 +31,36 @@ DPKGARCH=$(dpkg --print-architecture) UNAMEARCH=$(uname -m) +if [ "${1:-}" = "buildd" ]; then + MODE=buildd + if ! [ -d /srv/buildd/ ]; then + echo >&2 "Error: /srv/buildd does not exist or is not a directory." + exit 1 + fi +else + MODE=porterbox +fi + get_suites() { case "$1" in armhf|s390x) echo "sid jessie wheezy" ;; - s390) - echo "wheezy squeeze" + ia64|s390) + echo "wheezy" ;; sparc) - echo "sid wheezy squeeze" + echo "sid wheezy" ;; - *) + arm64|ppc64el) + echo "sid jessie" + ;; + amd64|i386) echo "sid jessie wheezy squeeze" ;; + *) + echo "sid jessie wheezy" + ;; esac } @@ -54,6 +70,9 @@ case "$DPKGARCH" in archs="$archs i386" ;; armhf) + if [ "$(uname -m)" = "aarch64" ] ; then + archs="$archs arm64" + fi archs="$archs armel" ;; armel) @@ -68,9 +87,34 @@ esac err=0 +do_one() { + local a="$1"; shift + local s="$1"; shift + + case "$MODE" in + buildd) + mkdir -p /srv/buildd/unpack + if ! chronic setup-dchroot -f -a "$a" -D -d '/srv/buildd/unpack' -K "$s" + then + return 1 + fi + ;; + porterbox) + if ! chronic setup-dchroot -f -a "$a" "$s" + then + return 1 + fi + ;; + *) + echo >&2 "Invalid mode $MODE" + exit 1 + esac + return 0 +} + for a in $archs; do for s in `get_suites "$a"`; do - if ! setup-dchroot -f -a "$a" "$s"; then + if ! do_one "$a" "$s"; then err=1 echo >&2 echo >&2 "Error: setting up $s:$a dchroot failed."