[buildd-tools-devel] Bug#826957: sbuild: should allow SUITE-VARIANT for "SUITE named SUITE-backports" chroot

Luca Capello luca.capello at infomaniak.com
Fri Jun 10 14:54:58 UTC 2016


retitle 826957 sbuild: should allow SUITE-VARIANT for "SUITE named SUITE-VARIANT" chroot
tags 826957 + patch
thanks

On Fri, 10 Jun 2016 16:40:55 +0200, Luca Capello wrote:
> Tested patch as soon as this bug get a number :-)

Here we are:

--8<---------------cut here---------------start------------->8---
From 64f6338bb906134951d9b84d8f5370399a6b6767 Mon Sep 17 00:00:00 2001
From: Luca Capello <luca.capello at infomaniak.com>
Date: Fri, 10 Jun 2016 16:52:21 +0200
Subject: [PATCH] bin/sbuild-createchroot: (#826957) add support for
 SUITE-VARIANT

---
 bin/sbuild-createchroot      | 12 +++++++-----
 man/sbuild-createchroot.8.in |  2 ++
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/bin/sbuild-createchroot b/bin/sbuild-createchroot
index efcfe04..68244ad 100755
--- a/bin/sbuild-createchroot
+++ b/bin/sbuild-createchroot
@@ -173,11 +173,13 @@ $conf->set('INCLUDE', add_items($conf->get('INCLUDE'),
 				"build-essential",
 				"debfoster"));
 
-my $suite = $ARGV[0];
+# Deal with SUITE-VARIANT
+my $suitevariant = $ARGV[0];
+(my $suite = $suitevariant) =~ s/-.*//;
 
 # check if schroot name is already in use
 
-my $chrootname = "${suite}-" . $conf->get('BUILD_ARCH') . $conf->get('CHROOT_SUFFIX');
+my $chrootname = "${suitevariant}-" . $conf->get('BUILD_ARCH') . $conf->get('CHROOT_SUFFIX');
 
 open my $pipe, 'schroot -l --all-source-chroots |';
 while (my $line = <$pipe>) {
@@ -301,7 +303,7 @@ if ($conf->get('MAKE_SBUILD_TARBALL')) {
     $config_entry = <<"EOF";
 [$chrootname]
 type=file
-description=Debian $suite/$arch autobuilder
+description=Debian $suitevariant/$arch autobuilder
 file=$tarball
 groups=root,sbuild
 root-groups=root,sbuild
@@ -324,7 +326,7 @@ EOF
 [$chrootname]
 type=directory
 $uniontype
-description=Debian $suite/$arch autobuilder
+description=Debian $suitevariant/$arch autobuilder
 directory=$target
 groups=root,sbuild
 root-groups=root,sbuild
@@ -467,7 +469,7 @@ if ($conf->get('MAKE_SBUILD_TARBALL')) {
     }
 }
 
-print "I: Successfully set up $suite chroot.\n";
+print "I: Successfully set up $suitevariant chroot.\n";
 print "I: Run \"sbuild-adduser\" to add new sbuild users.\n";
 
 exit 0;
diff --git a/man/sbuild-createchroot.8.in b/man/sbuild-createchroot.8.in
index 25e4996..75a1783 100644
--- a/man/sbuild-createchroot.8.in
+++ b/man/sbuild-createchroot.8.in
@@ -135,6 +135,8 @@ empty string to disable signature checking.
 The distribution to bootstrap (e.g. \[oq]sarge\[cq], \[oq]etch\[cq],
 \[oq]lenny\[cq], \[oq]sid\[cq]).  A complete list may be found in
 \fI/usr/share/debootstrap/scripts\fP.
+The special syntax \fISUITE-VARIANT\fP is also supported, which will creates a
+chroot for \fISUITE\fP, but named \fISUITE-VARIANT\fP.
 .TP
 .B TARGET-DIRECTORY
 The directory to create the chroot in.  The directory will be created if it
-- 
2.1.4

--8<---------------cut here---------------end--------------->8---

Thx, bye,
Gismo / Luca

-- 
Luca Capello
Administrateur GNU/Linux

Infomaniak Network SA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20160610/fa059065/attachment.sig>


More information about the Buildd-tools-devel mailing list