From 6f26c6b58e43999e793cfaac6dca550b165e61e6 Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Sun, 24 Apr 2011 21:52:26 +0200 Subject: [PATCH] Support Debian experimental. --- debian/changelog | 1 + mk-sbuild | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/debian/changelog b/debian/changelog index c2d5ddc..82f73a5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,7 @@ ubuntu-dev-tools (0.124) UNRELEASED; urgency=low - Put schroot configuration in chroot.d/sbuild-$chroot (LP: #736808) - Understand Debian distribution synonyms, and store the chroot under the code name. + - Support Debian experimental. -- Stefano Rivera Sun, 24 Apr 2011 20:35:51 +0200 diff --git a/mk-sbuild b/mk-sbuild index 544f4a3..3f4e946 100755 --- a/mk-sbuild +++ b/mk-sbuild @@ -228,6 +228,7 @@ fi # Determine distribution and possible synonyms synonym="" +EXPERIMENTAL=0 if debian-distro-info --all | grep -Fqx "$RELEASE"; then DISTRO="${DISTRO:-debian}" if [ "$RELEASE" = $(debian-distro-info --devel) ]; then @@ -257,6 +258,11 @@ elif [ "$RELEASE" = "oldstable" ]; then DISTRO="${DISTRO:-debian}" synonym="$RELEASE" RELEASE=$(debian-distro-info --old) +elif [ "$RELEASE" = "experimental" ]; then + DISTRO="${DISTRO:-debian}" + EXPERIMENTAL=1 + name="${name:-experimental}" + RELEASE=$(debian-distro-info --devel) elif [ -z "$DISTRO" ]; then echo "Unable to determine distribution, please provide --distro" >&2 exit 1 @@ -510,6 +516,12 @@ else deb ${DEBOOTSTRAP_MIRROR} RELEASE ${COMPONENTS} deb-src ${DEBOOTSTRAP_MIRROR} RELEASE ${COMPONENTS} EOM + if [ "$EXPERIMENTAL" -eq 1 ]; then + cat >> "$TEMP_SOURCES" <> "$TEMP_SOURCES" < $MNT/etc/apt/sources.list" rm -f "$TEMP_SOURCES" + +if [ "$EXPERIMENTAL" -eq 1 ]; then + echo 'APT::Default-Release "experimental";' \ + | sudo tee "$MNT"/etc/apt/apt.conf.d/15sbuild > /dev/null +fi + # Copy the timezone (comment this out if you want to leave the chroot at UTC) sudo cp /etc/localtime /etc/timezone "$MNT"/etc/ # Create a schroot entry for this chroot