From c2fa61372186fbf28f20c45571101e1705741de7 Mon Sep 17 00:00:00 2001 From: Emmet Hikory Date: Tue, 9 Feb 2010 11:40:16 +0900 Subject: [PATCH] mk-sbuild: rationalise architecture variables --- debian/changelog | 3 ++- mk-sbuild | 14 ++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1f79ad6..290eb25 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ ubuntu-dev-tools (0.93) UNRELEASED; urgency=low [ Emmet Hikory ] * Support qemu-arm-static -> qemu-kvm-extras-static transition * mk-sbuild: conditionally install lvm2 only for lv-snapshot schroots + * mk-sbuild: rationalise architecture variables [ Loïc Minier ] * Demote qemu-kvm-extras-static to a Suggests since most people don't build @@ -15,7 +16,7 @@ ubuntu-dev-tools (0.93) UNRELEASED; urgency=low * requestsync: add -C to allow manually adding changelog when missing (LP: #518574). - -- Emmet Hikory Tue, 09 Feb 2010 11:32:02 +0900 + -- Emmet Hikory Tue, 09 Feb 2010 11:38:48 +0900 ubuntu-dev-tools (0.92) lucid; urgency=low diff --git a/mk-sbuild b/mk-sbuild index 2bd6b18..904a447 100755 --- a/mk-sbuild +++ b/mk-sbuild @@ -137,9 +137,6 @@ while :; do shift ;; --arch) - # By default, use the native architecture. - arch_opt="--arch=$2" - arch_suffix="-$2" CHROOT_ARCH="$2" if [ "$2" = "i386" ] || [ "$2" = "lpia" ] && [ -z "$personality" ]; then @@ -204,13 +201,14 @@ fi SRC_TYPE="union" SCHROOT_CONF_TYPE="directory" -CHROOT_NAME="${name}${arch_suffix}" - +# By default, use the native architecture. HOST_ARCH=$(dpkg --print-architecture) if [ -z "$CHROOT_ARCH" ]; then - CHROOT_ARCH=$HOST_ARCH + CHROOT_ARCH="$HOST_ARCH" fi +CHROOT_NAME="${name}-${CHROOT_ARCH}" + # Load customizations if [ -r ~/.mk-sbuild.rc ]; then . ~/.mk-sbuild.rc @@ -227,7 +225,7 @@ case "$SRC_TYPE" in fi # Set up some variables for use in the paths and names - CHROOT_LV="${name}_chroot${arch_suffix}" + CHROOT_LV="${name}_chroot-${CHROOT_ARCH}" CHROOT_PATH="/dev/$VG/$CHROOT_LV" # Does the specified VG exist? (vgdisplay doesn't set error codes...) if [ `sudo vgdisplay -c "$VG" | wc -l` -eq 0 ]; then @@ -362,7 +360,7 @@ case "$SRC_TYPE" in esac # debootstrap the chroot -sudo $DEBOOTSTRAP_COMMAND $arch_opt $variant_opt "$RELEASE" "$MNT" "${DEBOOTSTRAP_MIRROR:-http://archive.ubuntu.com/ubuntu}" +sudo "$DEBOOTSTRAP_COMMAND" --arch="$CHROOT_ARCH" $variant_opt "$RELEASE" "$MNT" "${DEBOOTSTRAP_MIRROR:-http://archive.ubuntu.com/ubuntu}" # Update the package sources TEMP_SOURCES=`mktemp -t sources-XXXXXX`