severity 422371 wishlist
tags 422371 patch
thanks

Hi,
Here is a patch against latest git revision which adds the ability to specify
the components either via $COMPONENTS in pbuilderrc or via the command line with
--components.
It is based on some of the Ubuntu changes [1].

[1] http://patches.ubuntu.com/p/pbuilder/pbuilder_0.170ubuntu1.patch

-- 
Adrien Cunin aka Adri2000
diff --git a/debian/changelog b/debian/changelog
index 891e7d2..4cdc5c3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,15 @@
 pbuilder (0.174) UNRELEASED; urgency=low
 
+  [ Junichi Uekawa ]
   * add bash_completion.
   * Bug fix: "pbuilder: incoherence man page with --help", thanks to David
     Vernazobres (Closes: #446479).
 
+  [ Adrien Cunin ]
+  * Added the ability to specify the distribution components via $COMPONENTS in
+    pbuilderrc or via pbuilder --components. Part of the patch taken from
+    Ubuntu. (Closes: #422371)
+
  -- Junichi Uekawa <[EMAIL PROTECTED]>  Mon, 15 Oct 2007 08:44:20 +0900
 
 pbuilder (0.173) unstable; urgency=low
diff --git a/pbuilder-checkparams b/pbuilder-checkparams
index 89cda72..34b4a42 100755
--- a/pbuilder-checkparams
+++ b/pbuilder-checkparams
@@ -75,6 +75,10 @@ while [ -n "$1" ]; do
 	    DISTRIBUTION="$2";
 	    shift; shift;
 	    ;;
+	--components)
+	    COMPONENTS="$2";
+	    shift; shift;
+	    ;;
 	--buildresult)
 	    if [ -n "$2" ]; then
 		if [ -d "$2" ]; then
diff --git a/pbuilder-modules b/pbuilder-modules
index d62e2f4..1669038 100644
--- a/pbuilder-modules
+++ b/pbuilder-modules
@@ -54,6 +54,7 @@ pbuilder-options:
  --othermirror [other mirror location in apt deb-line format, delimited with | signs]
  --http-proxy [proxy]
  --distribution [distribution(sid|etch|lenny|experimental)]
+ --components [components]
  --buildresult [location-to-copy-build-result]
  --aptcache [location of retrieved package files]
  --removepackages [packages-to-remove on pbuilder create]
@@ -299,13 +300,16 @@ function installaptlines (){
 	echo "Distribution not specified, please specify" >&2
 	exit 1
     fi
+    if [ -z "$COMPONENTS" ] ; then
+	COMPONENTS="main"
+    fi
     if [ -n "$OTHERMIRROR" ]; then 
 	echo "$OTHERMIRROR" | tr "|" "\n" >> "$BUILDPLACE"/etc/apt/sources.list 
     fi
     if [ -n "$MIRRORSITE" ] ; then
 	cat >> "$BUILDPLACE"/etc/apt/sources.list << EOF
-deb $MIRRORSITE $DISTRIBUTION main 
-#deb-src $MIRRORSITE $DISTRIBUTION main
+deb $MIRRORSITE $DISTRIBUTION $COMPONENTS
+#deb-src $MIRRORSITE $DISTRIBUTION $COMPONENTS
 EOF
     fi
     if [ -n "$APTCONFDIR" ]; then
diff --git a/pbuilder.8 b/pbuilder.8
index 2f83f0a..3a36bcf 100644
--- a/pbuilder.8
+++ b/pbuilder.8
@@ -189,18 +189,21 @@ and
 .B "experimental".
 
 .TP
-.BI "\-\-override\-config"
+.BI "\-\-components [" "components" "]"
+Specifies the default distribution components to use. eg. "main contrib non-free".
+Default is "main".
 
-Specify to use different apt set up inside the chroot than it was used for creating the 
-base.tgz.
-Specify this when you want to do 
+.TP
+.BI "\-\-override\-config"
+Specify to use different apt set up inside the chroot than it was used for creating the base.tgz.
+Specify this when you want to do
 .B "pbuilder --update"
- with a different distribution target set up.
+with a different distribution target set up.
 
-.B "--distribution, " "--mirror, " "--othermirror"
- options are only valid when
+.B "--distribution", "--components", "--mirror", "--othermirror"
+options are only valid when
 .B "\-\-override\-config"
-option is specified in 
+option is specified in
 .B "--update"
 target, or when
 .B "pbuilder --create"
diff --git a/pbuilderrc b/pbuilderrc
index 4cf3612..f24838b 100755
--- a/pbuilderrc
+++ b/pbuilderrc
@@ -18,6 +18,8 @@ BUILDRESULT=/var/cache/pbuilder/result/
 
 # specifying the distribution forces the distribution on "pbuilder update"
 #DISTRIBUTION=lenny
+# specifying the components of the distribution (default is "main")
+#COMPONENTS="main contrib non-free"
 #specify the cache for APT 
 APTCACHE="/var/cache/pbuilder/aptcache/"
 APTCACHEHARDLINK="yes"
diff --git a/pbuilderrc.5 b/pbuilderrc.5
index 9972f64..3fb925a 100644
--- a/pbuilderrc.5
+++ b/pbuilderrc.5
@@ -95,6 +95,17 @@ is specified for
 option.
 
 .TP
+.BI "COMPONENTS=" "main"
+Specify the default distribution components to use.
+This option only affects when doing
+.B "pbuilder create"
+or when
+.B "--override-config"
+is specified for
+.B "pbuilder update"
+option.
+
+.TP
 .BI "export http_proxy=" "http://your-proxy:8080/";
 Defines the proxy for http connection.
 

Attachment: signature.asc
Description: Digital signature

Reply via email to