The following commit has been merged in the master branch:
commit a8ada212bde12d7fffc5673b0c9ca397b31e1354
Author: Raphael Hertzog <[EMAIL PROTECTED]>
Date:   Tue Jun 10 17:32:29 2008 +0200

    Adjust the test suite for the modified Dpkg::BuildOptions
    
    * scripts/t/300_Dpkg_BuildOptions.t: Fix the test suite to work with
      the modified Dpkg::BuildOptions.
    * scripts/Dpkg/BuildOptions.pm: Add missing import.

diff --git a/ChangeLog b/ChangeLog
index 9d59b3c..6b5bb28 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,13 +8,15 @@
        * lib/varbuf.c (varbufprintf): Use varbufvprintf instead of
        reimplementing it.
 
-2008-06-09  Guillem Jover  <[EMAIL PROTECTED]>
+2008-06-09  Raphael Hertzog  <[EMAIL PROTECTED]>
 
        * scripts/Dpkg/BuildOptions.pm (parse, set): Use space as the
        official separator in DEB_BUILD_OPTIONS. Check for validity of
        flags and print a warning if a bad option is detected. Rewrote
        the logic of set() to avoid adding options twice in non-overwrite
        mode.
+       * scripts/t/300_Dpkg_BuildOptions.t: Adjust the test suite
+       accordingly.
 
 2008-06-09  Guillem Jover  <[EMAIL PROTECTED]>
 
diff --git a/scripts/Dpkg/BuildOptions.pm b/scripts/Dpkg/BuildOptions.pm
index cdb9c65..9d6741b 100644
--- a/scripts/Dpkg/BuildOptions.pm
+++ b/scripts/Dpkg/BuildOptions.pm
@@ -3,6 +3,9 @@ package Dpkg::BuildOptions;
 use strict;
 use warnings;
 
+use Dpkg::Gettext;
+use Dpkg::ErrorHandling qw(warning);
+
 sub parse {
     my ($env) = @_;
 
@@ -43,7 +46,7 @@ sub set {
         $new->{$k} = $v;
     }
 
-    my $env = join(" ", map { $new->{$_} ? $_ . "=" . $new->{$_} : $_ } keys 
%$new);
+    my $env = join(" ", map { $new->{$_} ? $_ . "=" . $new->{$_} : $_ } sort 
keys %$new);
 
     $ENV{DEB_BUILD_OPTIONS} = $env;
     return $env;
diff --git a/scripts/t/300_Dpkg_BuildOptions.t 
b/scripts/t/300_Dpkg_BuildOptions.t
index 7dc8394..dc43acd 100644
--- a/scripts/t/300_Dpkg_BuildOptions.t
+++ b/scripts/t/300_Dpkg_BuildOptions.t
@@ -7,7 +7,14 @@ use warnings;
 
 use_ok('Dpkg::BuildOptions');
 
-$ENV{DEB_BUILD_OPTIONS} = 'noopt,foonostripbar,parallel=3,bazNOCHECK';
+{
+    no warnings;
+    # Disable warnings related to invalid values fed during
+    # the tests
+    $Dpkg::ErrorHandling::quiet_warnings = 1;
+}
+
+$ENV{DEB_BUILD_OPTIONS} = 'noopt foonostripbar parallel=3 bazNOCHECK';
 
 my $dbo = Dpkg::BuildOptions::parse();
 
@@ -26,14 +33,14 @@ my %dbo2 = (
 
 is_deeply($dbo, \%dbo, 'parse');
 
-$dbo = Dpkg::BuildOptions::parse('no opt,no-strip,parallel = 5,nocheck');
+$dbo = Dpkg::BuildOptions::parse('no opt no-strip parallel = 5 nocheck');
 
 is_deeply($dbo, \%dbo2, 'parse (param)');
 
 $dbo->{parallel} = 5;
 $dbo->{noopt} = '';
 
-my $env = Dpkg::BuildOptions::set($dbo,1);
+my $env = Dpkg::BuildOptions::set($dbo, 1);
 
 is($ENV{DEB_BUILD_OPTIONS}, $env, 'set (return value)');
 is_deeply(Dpkg::BuildOptions::parse(), $dbo, 'set (env)');
@@ -41,4 +48,4 @@ is_deeply(Dpkg::BuildOptions::parse(), $dbo, 'set (env)');
 $ENV{DEB_BUILD_OPTIONS} = 'foobar';
 $dbo = { noopt => '' };
 $env = Dpkg::BuildOptions::set($dbo, 0);
-is($env, "foobar,noopt,", 'set (append)');
+is($env, "foobar noopt", 'set (append)');

-- 
dpkg's main repository


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

Reply via email to