From: Peter Palfrader Date: Tue, 6 Nov 2018 08:04:53 +0000 (+0100) Subject: setup-dchroot: merge from tor (genname split into function, ubuntu updates) X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=87c04f0b5a0dd21c9428448438ff55f988d74e42;p=mirror%2Fdsa-puppet.git setup-dchroot: merge from tor (genname split into function, ubuntu updates) - split schroot base name generation into its own function - if we build an ubuntu chroot, upgrade to the latest packages available in -updates and -security of their suite, since it seems they don't ever do point releases so you end up with a 4 year old openssl in your chroot. --- diff --git a/modules/schroot/files/setup-dchroot b/modules/schroot/files/setup-dchroot index 1040212ab..c3cc504c4 100755 --- a/modules/schroot/files/setup-dchroot +++ b/modules/schroot/files/setup-dchroot @@ -72,6 +72,20 @@ do_cleanup() { done } +genname() { + local suite="$1"; shift + local arch="$1"; shift + + if [ -n "$sbuildnames" ]; then + local name="${suite}-${arch}-sbuild" + else + local name="${suite}_${arch}-dchroot" + fi + + echo "$name" +} + + genschrootconf() { local suite="$1"; shift local arch="$1"; shift @@ -83,11 +97,7 @@ genschrootconf() { local suite="${suite}-${extra}" fi - if [ -n "$sbuildnames" ]; then - local name="${suite}-${arch}-sbuild" - else - local name="${suite}_${arch}-dchroot" - fi + local name="$(genname "$suite" "$arch")" local fullname="$name" case "$arch" in @@ -393,6 +403,12 @@ if [ -n "$buildd" ] ; then ;; esac fi +if [ -n "$ubuntu" ]; then + echo "deb $mirror ${suite}-updates main" >> "$rootdir/etc/apt/sources.list" + echo "deb $mirror ${suite}-security main" >> "$rootdir/etc/apt/sources.list" + chroot "$rootdir" apt-get update + chroot "$rootdir" apt-get dist-upgrade -y +fi rm -f "$rootdir/etc/apt/sources.list" "$rootdir/etc/apt/sources.list.d/*" chroot "$rootdir" apt-get clean umount "$rootdir/dev" 2>/dev/null || true