The following commit has been merged in the sourcev3 branch:
commit a1dedd5997162bc0ef04a57871a677e6fe627c7c
Author: Raphael Hertzog <[EMAIL PROTECTED]>
Date:   Sun Mar 16 19:03:59 2008 +0100

    Uniformize @argv parsing in source package formats
    
    * scripts/Dpkg/Source/Package/V2_0.pm: Improve error
    message when we have too many arguments.
    * scripts/Dpkg/Source/Package/V3_0/bzr.pm: Same here.
    * scripts/Dpkg/Source/Package/V3_0/git.pm: Same here.
    * scripts/Dpkg/Source/Package/V3_0/native.pm: Add check
    of number of arguments.
    * scripts/Dpkg/Source/Package/V1_0.pm: Make sure we're
    not going to fail when we delegate to do_build() of
    V3_0/native.pm.

diff --git a/scripts/Dpkg/Source/Package/V1_0.pm 
b/scripts/Dpkg/Source/Package/V1_0.pm
index 3a4706c..a3e6960 100644
--- a/scripts/Dpkg/Source/Package/V1_0.pm
+++ b/scripts/Dpkg/Source/Package/V1_0.pm
@@ -268,6 +268,7 @@ sub do_build {
     }
 
     if ($sourcestyle eq "n") {
+        $self->{'options'}{'ARGV'} = []; # ensure we have no error
         Dpkg::Source::Package::V3_0::native::do_build($self, $dir);
     } elsif ($sourcestyle =~ m/[nurUR]/) {
         if (stat($tarname)) {
diff --git a/scripts/Dpkg/Source/Package/V2_0.pm 
b/scripts/Dpkg/Source/Package/V2_0.pm
index 8a3d1e3..0d6ac11 100644
--- a/scripts/Dpkg/Source/Package/V2_0.pm
+++ b/scripts/Dpkg/Source/Package/V2_0.pm
@@ -178,7 +178,8 @@ sub do_build {
 
     my ($dirname, $updir) = fileparse($dir);
     if (scalar(@argv)) {
-        usageerr(_g("-b takes only one parameter with v2.0 source packages"));
+        usageerr(_g("-b takes only one parameter with format `%s'"),
+                 $self->{'fields'}{'Format'});
     }
     $self->prepare_build($dir);
 
diff --git a/scripts/Dpkg/Source/Package/V3_0/bzr.pm 
b/scripts/Dpkg/Source/Package/V3_0/bzr.pm
index a0e1974..3e6bf1f 100644
--- a/scripts/Dpkg/Source/Package/V3_0/bzr.pm
+++ b/scripts/Dpkg/Source/Package/V3_0/bzr.pm
@@ -92,7 +92,8 @@ sub do_build {
        my ($dirname, $updir) = fileparse($dir);
 
        if (scalar(@argv)) {
-               usageerr(_g("-b takes only one parameter with v3.0 source 
packages"));
+            usageerr(_g("-b takes only one parameter with format `%s'"),
+                     $self->{'fields'}{'Format'});
        }
 
        my $sourcepackage = $self->{'fields'}{'Source'};
diff --git a/scripts/Dpkg/Source/Package/V3_0/git.pm 
b/scripts/Dpkg/Source/Package/V3_0/git.pm
index 1b4bef8..4839dcc 100644
--- a/scripts/Dpkg/Source/Package/V3_0/git.pm
+++ b/scripts/Dpkg/Source/Package/V3_0/git.pm
@@ -120,7 +120,8 @@ sub do_build {
     my ($dirname, $updir) = fileparse($dir);
 
     if (scalar(@argv)) {
-       usageerr(_g("-b takes only one parameter with v3.0 source packages"));
+        usageerr(_g("-b takes only one parameter with format `%s'"),
+                 $self->{'fields'}{'Format'});
     }
 
     my $sourcepackage = $self->{'fields'}{'Source'};
diff --git a/scripts/Dpkg/Source/Package/V3_0/native.pm 
b/scripts/Dpkg/Source/Package/V3_0/native.pm
index bbc03ed..5efab3e 100644
--- a/scripts/Dpkg/Source/Package/V3_0/native.pm
+++ b/scripts/Dpkg/Source/Package/V3_0/native.pm
@@ -66,6 +66,12 @@ sub can_build {
 sub do_build {
     my ($self, $dir) = @_;
     my @tar_ignore = map { "--exclude=$_" } 
@{$self->{'options'}{'tar_ignore'}};
+    my @argv = $self->{'options'}{'ARGV'};
+
+    if (scalar(@argv)) {
+        usageerr(_g("-b takes only one parameter with format `%s'"),
+                 $self->{'fields'}{'Format'});
+    }
 
     my $sourcepackage = $self->{'fields'}{'Source'};
     my $basenamerev = $self->get_basename(1);

-- 
dpkg's main repository


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

Reply via email to