On Wed, Aug 20, 2008 at 12:58:46AM +0200, Cyril Brulebois wrote: > tag 458975 patch > thanks > > On Fri, Jan 04, 2008 at 12:48:12AM +0100, Michael Banck wrote: > > Having an option which basically shadows dpkg-buildpackage's -v option > > (unfortunately, that one is already taken by sbuild for verbose > > output) would be nice. > > That's why I went for a --debbuildopts (mimicking pbuilder's), so that > one can pass additional options to dpkg-buildpackage. As briefly > discussed on IRC, it might be worth sorting out which additional > dpkg-buildpackage option we want to make available through sbuild, and > implement only those, instead of providing with this option to proxy > other options to dpkg-buildpackage. But that's not my call.
Following some discussion on IRC yesterday, this is an updated version of the patch which works with current sbuild git. It provides both --debbuildopts (for space-separated options and pbuilder compatibility) and --debbuildopt for single options (which can contain spaces), which I added because I hate having a feature constrained by shell quoting issues. Martin, if you'd like to test this and let me know if it does what you want, that would be great. If you'd like to do any further work on it, that would be super. It currently doesn't attempt to sanisite the input for e.g. options set by sbuild itself, which would be nice, but not essential. Regards, Roger -- .''`. Roger Leigh : :' : Debian GNU/Linux http://people.debian.org/~rleigh/ `. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/ `- GPG Public Key: 0x25BFB848 Please GPG sign your mail.
diff --git a/lib/Sbuild/Build.pm b/lib/Sbuild/Build.pm
index cb95c63..e823c96 100644
--- a/lib/Sbuild/Build.pm
+++ b/lib/Sbuild/Build.pm
@@ -790,6 +790,11 @@ sub build {
push (@{$buildcmd}, $binopt) if $binopt;
push (@{$buildcmd}, "-r" . $self->get_conf('FAKEROOT'));
+ if (defined($self->get_conf('DPKG_BUILDPACKAGE_USER_OPTIONS')) &&
+ $self->get_conf('DPKG_BUILDPACKAGE_USER_OPTIONS')) {
+ push (@{$buildcmd}, @{$self->get_conf('DPKG_BUILDPACKAGE_USER_OPTIONS')});
+ }
+
my $buildenv = {};
$buildenv->{'PATH'} = $self->get_conf('PATH');
$buildenv->{'LD_LIBRARY_PATH'} = $self->get_conf('LD_LIBRARY_PATH')
diff --git a/lib/Sbuild/Conf.pm b/lib/Sbuild/Conf.pm
index ee1d5e7..67ef384 100644
--- a/lib/Sbuild/Conf.pm
+++ b/lib/Sbuild/Conf.pm
@@ -160,6 +160,9 @@ sub init_allowed_keys {
CHECK => $validate_program,
DEFAULT => $Sbuild::Sysconfig::programs{'APT_CACHE'}
},
+ 'DPKG_BUILDPACKAGE_USER_OPTIONS' => {
+ DEFAULT => []
+ },
'DPKG_SOURCE' => {
CHECK => $validate_program,
DEFAULT => $Sbuild::Sysconfig::programs{'DPKG_SOURCE'}
diff --git a/lib/Sbuild/Options.pm b/lib/Sbuild/Options.pm
index bd83874..31a98c5 100644
--- a/lib/Sbuild/Options.pm
+++ b/lib/Sbuild/Options.pm
@@ -127,6 +127,14 @@ sub set_options {
"e|uploader=s" => sub {
$self->set_conf('UPLOADER_NAME', $_[1]);
},
+ "debbuildopts=s" => sub {
+ push(@{$self->get_conf('DPKG_BUILDPACKAGE_USER_OPTIONS')},
+ split(/\s+/, $_[1]));
+ },
+ "debbuildopt=s" => sub {
+ push(@{$self->get_conf('DPKG_BUILDPACKAGE_USER_OPTIONS')},
+ $_[1]);
+ },
"n|nolog" => sub {
$self->set_conf('NOLOG', 1);
},
diff --git a/man/sbuild.1.in b/man/sbuild.1.in
index 1a9515c..c299b67 100644
--- a/man/sbuild.1.in
+++ b/man/sbuild.1.in
@@ -39,6 +39,8 @@ sbuild \- build debian packages from source
.RB [ \-m \[or] \-\-maintainer=\fImaintainer\fP ]
.RB [ \-e \[or] \-\-uploader=\fIuploader\fP ]
.RB [ \-k \[or] \-\-keyid=\fIkey-id\fP ]
+.RB [ \-\-debbuildopt=\fIoption\fP ]
+.RB [ \-\-debbuildopts=\fIoptions\fP ]
.RB [ \-\-purge=\fPpurge-mode\fP ]
.RB [ \-\-purge\-deps=\fPpurge-mode\fP ]
.RB [ \-b \[or] \-\-batch]
@@ -163,6 +165,14 @@ the .changes file(s).
Passed to dpkg\-genchanges and is used to set the key to sign the .changes
file(s). Default is not using any key.
.TP
+.BR \-\-debbuildopt=\fIoption\fP
+Pass the specified option directly to dpkg\-buildpackage.
+.TP
+.BR \-\-debbuildopts=\fIoptions\fP
+Pass the specified options directly to dpkg\-buildpackage. The options should
+be separated by spaces. If any options contain spaces, use \-\-debbuildopt
+instead.
+.TP
.BR \-n ", " "\-\-nolog"
Do not create a package log file in the $log_dir directory and no
build log file, but print everything to stdout. Also do not send any
signature.asc
Description: Digital signature

