+2008-01-07 Guillem Jover <guillem@debian.org>
+
+ * scripts/Dpkg/BuildOptions.pm (set): Parse all options separated
+ by spaces or comma, do not lowercase the option names, do not match
+ on name substrings, and on recognized options with invalid values
+ discard the value or the entire option.
+ * scripts/t/300_Dpkg_BuildOptions.t: Adjust test suite.
+
2008-01-06 Raphael Hertzog <hertzog@debian.org>
* scripts/Dpkg/Shlibs/Objdump.pm: Also retrieve dynamic relocation
* Add lzma to dpkg-dev Depends.
* Do not automatically enable -j if DEB_BUILD_OPTIONS contains parallel=n,
and allow overriding its value from the environment. Closes: #458589
+ * Fix Dpkg::BuildOptions to parse all options in DEB_BUILD_OPTIONS, so
+ that dpkg-buildpackage called with -j preserves unrecognized options.
[ Updated dpkg translations ]
* Norwegian Bokmål (Hans Fredrik Nordhaug). Closes: #457918, #458732
unless ($env) { return {}; }
my %opts;
- while ($env =~ s/(noopt|nostrip|nocheck),?//i) {
- $opts{lc $1} = '';
- }
- while ($env =~ s/(parallel)=(-?\d+),?//i) {
- $opts{lc $1} = $2;
+
+ foreach (split(/[\s,]+/, $env)) {
+ # FIXME: This is pending resolution of Debian bug #430649
+ /^([a-z][a-z0-9_-]*)(=(\w*))?$/;
+
+ my ($k, $v) = ($1, $3 || '');
+
+ # Sanity checks
+ if (!$k) {
+ next;
+ } elsif ($k =~ /^(noopt|nostrip|nocheck)$/ && length($v)) {
+ $v = '';
+ } elsif ($k eq 'parallel' && $v !~ /^-?\d+$/) {
+ next;
+ }
+
+ $opts{$k} = $v;
}
return \%opts;
use_ok('Dpkg::BuildOptions');
-$ENV{DEB_BUILD_OPTIONS} = 'foonostripbar,parallel=3,bazNOCHECK';
+$ENV{DEB_BUILD_OPTIONS} = 'noopt,foonostripbar,parallel=3,bazNOCHECK';
my $dbo = Dpkg::BuildOptions::parse();
my %dbo = (
- nostrip => '',
- nocheck => '',
+ noopt => '',
+ foonostripbar => '',
parallel => 3,
);
my %dbo2 = (
+ no => '',
+ opt => '',
+ 'no-strip' => '',
nocheck => '',
);