[Pbuilder-maint] Bug#425422: pbuilder: "pdebuild -- --debbuildopts -sa" ignores -sa
Sanjoy Mahajan
sanjoy at mrao.cam.ac.uk
Mon May 21 15:30:55 UTC 2007
Package: pbuilder
Version: 0.166
Severity: normal
[This system is Ubuntu feisty, which had pbuilder 0.161, but I just
installed 0.166 from Debian unstable and it has the same problem.]
Running the following in a source directory
pdebuild -- --debbuildopts -sa
runs "dpkg-genchanges -S", so dpkg-buildpackage did not get the
"--debbuildopts -sa". However, this works fine:
pdebuild --debbuildopts -sa
The problem is in these two lines from /usr/bin/pdebuild:
echo "dpkg-buildpackage -S -us -uc -r${BUILDSOURCEROOTCMD} $DEBBUILDOPTS" | perl -pe 's/(^|\s)-[bB](\s|$)/$1$2/g' | /bin/bash
${PBUILDERROOTCMD} ${PDEBUILD_PBUILDER} --build "$@" ${EXTRA_CONFIGFILE[@]/#/--configfile } --buildresult "${BUILDRESULT}" --debbuildopts "${DEBBUILDOPTS}" ../"${PKG_SOURCENAME}_${PKG_VERSION}".dsc
In the first line, the $DEBBUILDOPTS will not be set using the
pbuilder options (coming after the '--').
In the second line, the "--build $@" does contain the pbuilder option
"--debbuildopts -sa". However, the later argument '--debbuildopts
"${DEBBUILDOPTS}"' overrides it with the value of DEBBUILDOPTS from
the rc files or from the pdebuilder '--debbuildopts' option.
[By the way, what is the '--build' option to pbuilder (given by the
second line)? I guess it runs 'build' but it is not documented in the
manpage.]
The handling of --debbuildopts is not quite consistent with the
manpage for pdebuild, which says only "This option overrides pbuilder
option --debbuildopts." I interpreted that as "if I do not give a
pdebuilder --debbuildopts, then the pbuilder option (after the '--')
will have effect." Whereas the --debbuildopts option to pbuilder will
never have an effect.
I don't see an easy solution, because a solution would require parsing
the pbuilder options to see whether they contain a '--debbuildopts'
and then using it if there were no pdebuild '--debbuildopts' option.
Instead, I think the man page should be updated with this diff to say
that --debbuildopts needs to be given before the '--':
--- pdebuild.1 2007-04-15 18:42:37.000000000 -0400
+++ pdebuild.1 2007-05-21 11:17:34.279553208 -0400
@@ -76,6 +76,9 @@
Multiple options are delimited with spaces.
+Note that for pdebuild, debbuildopts needs to be specified as a pdebuild
+option in the command-line, not as a pbuilder option.
+
.TP
.BI "\-\-use\-pdebuild\-internal"
Uses a different implementation of pdebuild, which calls clean and build inside
@@ -118,9 +121,11 @@
There is an exception that
.B "\-\-buildresult"
-needs to be specified as pdebuild option before the
+and
+.B "\-\-debbuildopts"
+need to be specified as pdebuild options before the
.B "\-\-"
-to be effective.
+in order to be effective.
.SH "FILES"
.TP
While I'm looking through the manpage, here are a few stylistic
cleanups (apply on top of the previous patch):
--- pdebuild.1 2007-05-21 11:17:34.279553000 -0400
+++ pdebuild.1 2007-05-21 11:29:27.282116396 -0400
@@ -11,16 +11,16 @@
in a Debian source directory.
One must be inside the source tree containing the
.B "debian"
-directory, in order to make it work.
+directory.
.SH "PDEBUILD OPTIONS"
The first option is always the operation to be done.
It is followed by options of the form
.BI "\-\-" "option name"
-which will modify the semantics as explained below.
-They are applied from left-to-right, and when there are
-conflicting options, the rightmost options will have effect.
+which modify the semantics as explained below.
+They are applied from left to right; when
+options conflict, the rightmost options take effect.
.TP
.BI "\-\-buildsourceroot [" "fakeroot" "]"
@@ -45,18 +45,18 @@
.BI "\-\-debsign\-k [" "key\-id" "]"
Pass
.B \-k
-option to debsign to specify which key-id to sign.
+option to debsign to specify which key-id to sign with.
.TP
.BI "\-\-buildresult [" "Directory for build results" "]"
-The place which build result is stored.
+The place where the build result is stored.
-Note that for pdebuild, buildresult needs to be specified as pdebuild
-option in the command-line, not as pbuilder option.
+Note that for pdebuild, buildresult needs to be specified as a pdebuild
+option on the command-line, not as a pbuilder option.
Note that the default value for buildresult is what is defined for
-pbuilder,
+pbuilder, which is
.B "/var/cache/pbuilder/result"
and not
.B ".."
@@ -86,7 +86,7 @@
.B "pdebuild\-internal"
tries to run debian/rules clean inside the chroot.
-To achieve the goal, the working directory is passed on inside the chroot,
+To do so, the working directory is passed on inside the chroot,
in the form of bind-mounting and
.B debuild
is run.
@@ -116,7 +116,7 @@
After the
.B "\-\-"
symbol, an arbitrary number of pbuilder options can be specified.
-See pbuilder.8 for full list of options.
+See pbuilder.8 for a full list of options.
There is an exception that
@@ -138,8 +138,8 @@
.TP
.I "${HOME}/.pbuilderrc"
-Configuration file for pbuilder, used in pdebuild,
-overrides what is written in
+Configuration file for pbuilder, used in pdebuild. It
+overrides
.B /etc/pbuilderrc
@@ -183,10 +183,10 @@
it may be ignored.
.SH "AUTHOR"
-Initial coding, and main maintenance is done by
+Initial coding and main maintenance is done by
Junichi Uekawa <dancer at debian.org>.
-The homepage is available at
+The homepage is
.B "\%http://www.netfort.gr.jp/~dancer/software/pbuilder.html"
.SH "SEE ALSO"
-- System Information:
Debian Release: 4.0
APT prefers feisty-updates
APT policy: (500, 'feisty-updates'), (500, 'feisty-security'), (500, 'feisty')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/dash
Kernel: Linux 2.6.20-15-generic
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Versions of packages pbuilder depends on:
ii coreutils 5.97-5.2ubuntu3 The GNU core utilities
ii debianutils 2.17.4build1 Miscellaneous utilities specific t
ii debootstrap 0.3.3.2ubuntu3 Bootstrap a basic Debian system
ii gcc 4:4.1.2-1ubuntu1 The GNU C compiler
ii wget 1.10.2-2ubuntu2 retrieves files from the web
Versions of packages pbuilder recommends:
ii cowdancer 0.25 Copy-on-write directory tree utili
ii devscripts 2.9.27ubuntu13 Scripts to make the life of a Debi
ii fakeroot 1.5.10ubuntu2 Gives a fake root environment
ii sudo 1.6.8p12-4ubuntu5 Provide limited super user privile
-- no debconf information
More information about the Pbuilder-maint
mailing list