package pbuilder
tags 398404 patch
Package: pbuilder
Version: 0.181
Followup-For: Bug #398404

It is waist of typing to specify long --basetgz [basetgz-location] and
other options on command line or editing ${HOME}/.pbuilderrc contents.

There should be an easier way to switch configuration files.  This is
useful not only for bpo but also experimental support etc.

I propose to add "--use suffix" commadline which is placed before any
other options.  Anyway, see my patch.  This provides fix not only for
this bug 398404 but also addresses other wishlist bugs.
 373807 (one base.tzg per distribution by "--use dists")
 324000 (At least with new "I: ...", it is obvious which files are sourced)
 272354 (Something described here by Loïc Minier and normal sid build
         can be done cleanly switched with this patch.  Also original
         bug report wish may be addressed by "--use stable"
         configuration specifying OTHERDISTRIBUTION pointing to security
         archive Of course, we need to implement OTHERDISTRIBUTION which
         is not yet done in here.)

Oh, I did not include but it may be interesting to create several
prepackaged files such as /usr/share/pbuilder/pbuilderrc.bpo where
OTHERMIRROR and  OTHERDISTRIBUTION (this needs to be done) are specified
to point to security and bpo while DISTRIBUTION is etch.

Since how to cleanly implement OTHERDISTRIBUTION for each OTHERMIRROR, I
leave that as next action item and provide very basic switching
functionality now.  OTHERDISTRIBUTIO will be next step.

Osamu

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.25-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages pbuilder depends on:
ii  cdebootstrap                  0.5.2      Bootstrap a Debian system
ii  coreutils                     6.10-6     The GNU core utilities
ii  debconf [debconf-2.0]         1.5.22     Debian configuration management sy
ii  debianutils                   2.28.6     Miscellaneous utilities specific t
ii  debootstrap                   1.0.9      Bootstrap a basic Debian system
ii  gcc                           4:4.3.0-8  The GNU C compiler
ii  wget                          1.11.2-1   retrieves files from the web

Versions of packages pbuilder recommends:
ii  cowdancer                     0.47       Copy-on-write directory tree utili
ii  devscripts                    2.10.29    scripts to make the life of a Debi
ii  fakeroot                      1.9.5      Gives a fake root environment
ii  sudo                          1.6.9p15-2 Provide limited super user privile

-- debconf information excluded
diff --git a/debian/changelog b/debian/changelog
index f7aa97f..98f9fd3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+pbuilder (0.181+nmu1) UNRELEASED-unstable; urgency=low
+
+  * Non-maintainer upload.  !!! No !!! --- just for test local build.
+  [ Osamu Aoki]
+  * Swichable configuration files using "--use suffix" (closes: #398404)
+
+ -- Osamu Aoki <[EMAIL PROTECTED]>  Sat, 07 Jun 2008 10:27:21 +0900
+
 pbuilder (0.181) unstable; urgency=low
 
   [ Esko Arajärvi ]
diff --git a/pbuilder b/pbuilder
index ed35fb4..7cd5f0d 100755
--- a/pbuilder
+++ b/pbuilder
@@ -20,9 +20,15 @@
 
 set -e 
 
+if [ "$1" = "--use" ] || [ "$1" = "use" ]; then
+    PBCONFIGSUFFIX=".$2"
+    shift 2
+fi
+
 # export this so that programs know which command line
 # operation is currently done
 export PBCURRENTCOMMANDLINEOPERATION="$1"
+export PBCONFIGSUFFIX
 umask 0022
 
 case "$1" in
diff --git a/pbuilder-loadconfig b/pbuilder-loadconfig
index 8367143..f506a27 100644
--- a/pbuilder-loadconfig
+++ b/pbuilder-loadconfig
@@ -17,9 +17,10 @@
 #   along with this program; if not, write to the Free Software
 #   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
-for RCFILE in /usr/share/pbuilder/pbuilderrc /etc/pbuilderrc ${HOME}/.pbuilderrc; do
+for RCFILE in /usr/share/pbuilder/pbuilderrc${PBCONFIGSUFFIX} /etc/pbuilderrc${PBCONFIGSUFFIX} ${HOME}/.pbuilderrc${PBCONFIGSUFFIX}; do
     if [ -f "$RCFILE" ]; then 
 	. "$RCFILE"
+	echo "I: $RCFILE loaded"
     else
 	echo "W: $RCFILE does not exist" >&2
     fi
diff --git a/pbuilder-modules b/pbuilder-modules
index 26626f9..7d8c30d 100644
--- a/pbuilder-modules
+++ b/pbuilder-modules
@@ -24,7 +24,7 @@ pbuilder - a personal builder
 Copyright 2001-2007 Junichi Uekawa
 Distributed under GNU Public License version 2 or later
 
-pbuilder [operation] [pbuilder-options]
+pbuilder [--use suffix] [operation] [pbuilder-options]
 pdebuild [pdebuild-options] -- [pbuilder-options]
 
 command lines:
@@ -46,6 +46,10 @@ pbuilder --execute -- [command] [command-options]
 
 pbuilder --dumpconfig
   Dumps configuration information to stdout for debugging.
+  Configuration files are: (add suffix if specified by "--use")
+    /usr/share/pbuilder/pbuilderrc[.suffix] 
+    /etc/pbuilderrc[.suffix] 
+    ${HOME}/.pbuilderrc[.suffix]
 
 pbuilder-options:
  --basetgz [base.tgz location]
diff --git a/pbuilder.8 b/pbuilder.8
index 3a36bcf..c2c05f9 100644
--- a/pbuilder.8
+++ b/pbuilder.8
@@ -2,17 +2,17 @@
 .SH NAME
 pbuilder \- personal package builder
 .SH SYNOPSIS
-.BI "pbuilder --create [" "options" "]"
+.BI "pbuilder [--use suffix] --create [" "options" "]"
 .PP
-.BI "pbuilder --update [" "options" "]"
+.BI "pbuilder [--use suffix] --update [" "options" "]"
 .PP
-.BI "pbuilder --build [" "options" "] " ".dsc-file"
+.BI "pbuilder [--use suffix] --build [" "options" "] " ".dsc-file"
 .PP
-.BI "pbuilder --execute [" "options" "] -- " "script [" "script options" "]"
+.BI "pbuilder [--use suffix] --execute [" "options" "] -- " "script [" "script options" "]"
 .PP
-.BI "pbuilder --clean"
+.BI "pbuilder [--use suffix] --clean"
 .PP
-.BI "pbuilder --login [" "options" "]"
+.BI "pbuilder [--use suffix] --login [" "options" "]"
 .SH "DESCRIPTION"
 Front end program to the 
 .B "pbuilder"
@@ -94,6 +94,11 @@ directory.
 Same as
 .B "pdebuild --use-pdebuild-internal"
 
+.TP
+.B "--use"
+Use configuration file suffixed with 
+.I "suffix" .
+
 .SH "OPTIONS"
 
 The command is followed by options of the form
@@ -530,17 +535,17 @@ targets.
 
 .SH "FILES"
 .TP
-.I "/etc/pbuilderrc"
+.I "/etc/pbuilderrc[.suffix]"
 The system-wide configuration file for pbuilder.
 
 .TP
-.I "/usr/share/pbuilder/pbuilderrc"
+.I "/usr/share/pbuilder/pbuilderrc[.suffix]"
 The default settings for pbuilder, used as fallback for all 
 values that is not specified in
-.B "/etc/pbuilderrc."
+.B "/etc/pbuilderrc[.suffix]."
 
 .TP
-.I "${HOME}/.pbuilderrc"
+.I "${HOME}/.pbuilderrc[.suffix]"
 The personal configuration file for pbuilder, which overrides
 settings set in other configuration files.
 

Reply via email to