From 957a73772d91c59f243f6e757c26680a313def8b Mon Sep 17 00:00:00 2001
From: Stefano Rivera <stefanor@ubuntu.com>
Date: Sat, 12 Jan 2013 15:26:08 +0200
Subject: [PATCH] mk-sbuild: Name cross chroots after the build architecture
 and target (LP: #1087194)

---
 debian/changelog | 2 ++
 mk-sbuild        | 6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 070cb1e..fc657a3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -23,6 +23,8 @@ ubuntu-dev-tools (0.146) UNRELEASED; urgency=low
     Kitterman (LP: #1088010)
   * seeded-in-ubuntu: Clarify that "not seeded" binary packages may not exist
     (LP: #1029620)
+  * mk-sbuild: Name cross chroots after the build architecture and target
+    (LP: #1087194)
 
  -- Stefano Rivera <stefanor@ubuntu.com>  Sat, 12 Jan 2013 14:33:25 +0200
 
diff --git a/mk-sbuild b/mk-sbuild
index f4a5843..e22499c 100755
--- a/mk-sbuild
+++ b/mk-sbuild
@@ -314,7 +314,11 @@ if [ -z "$CHROOT_ARCH" ]; then
     CHROOT_ARCH="$HOST_ARCH"
 fi
 
-CHROOT_NAME="${name}-${CHROOT_ARCH}"
+if [ -z "$TARGET_ARCH" ]; then
+    CHROOT_NAME="${name}-${CHROOT_ARCH}"
+else
+    CHROOT_NAME="${name}-cross-${CHROOT_ARCH}-${TARGET_ARCH}"
+fi
 
 if [ -z "$synonym" ]; then
     CHROOT_SYNONYM=""