The branch, master has been updated
       via  47cfe52122ea796356d3b3d9353c4605ae50bdf4 (commit)
      from  8dce023c264aefba0bf84a982d34401dd0e6290f (commit)


- Shortlog ------------------------------------------------------------
47cfe52 Dpkg::BuildOptions: Parse all options in DEB_BUILD_OPTIONS

Summary of changes:
 ChangeLog                         |    8 ++++++++
 debian/changelog                  |    2 ++
 scripts/Dpkg/BuildOptions.pm      |   22 +++++++++++++++++-----
 scripts/t/300_Dpkg_BuildOptions.t |    9 ++++++---
 4 files changed, 33 insertions(+), 8 deletions(-)
-----------------------------------------------------------------------
Details of changes:

commit 47cfe52122ea796356d3b3d9353c4605ae50bdf4
Author: Guillem Jover <[EMAIL PROTECTED]>
Date:   Mon Jan 7 09:20:18 2008 +0200

    Dpkg::BuildOptions: Parse all options in DEB_BUILD_OPTIONS
    
    This will preserve unrecognized options when calling dpkg-buildpackage
    with -j.

diff --git a/ChangeLog b/ChangeLog
index f17e20f..eeb174b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-01-07  Guillem Jover  <[EMAIL PROTECTED]>
+
+       * 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  <[EMAIL PROTECTED]>
 
        * scripts/Dpkg/Shlibs/Objdump.pm: Also retrieve dynamic relocation
diff --git a/debian/changelog b/debian/changelog
index ae3f8b3..0753382 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -45,6 +45,8 @@ dpkg (1.14.15) UNRELEASED; urgency=low
   * 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
diff --git a/scripts/Dpkg/BuildOptions.pm b/scripts/Dpkg/BuildOptions.pm
index 39f1099..1068248 100644
--- a/scripts/Dpkg/BuildOptions.pm
+++ b/scripts/Dpkg/BuildOptions.pm
@@ -11,11 +11,23 @@ sub parse {
     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;
diff --git a/scripts/t/300_Dpkg_BuildOptions.t 
b/scripts/t/300_Dpkg_BuildOptions.t
index 9a5baf3..7dc8394 100644
--- a/scripts/t/300_Dpkg_BuildOptions.t
+++ b/scripts/t/300_Dpkg_BuildOptions.t
@@ -7,16 +7,19 @@ use warnings;
 
 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 => '',
           );
 

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to