]> git.donarmstrong.com Git - debhelper.git/commitdiff
Merge branch 'master' of ssh://git.debian.org/git/debhelper/debhelper
authorJoey Hess <joey@kitenet.net>
Sat, 21 Mar 2009 02:22:30 +0000 (22:22 -0400)
committerJoey Hess <joey@kitenet.net>
Sat, 21 Mar 2009 02:22:30 +0000 (22:22 -0400)
Debian/Debhelper/Dh_Getopt.pm
Debian/Debhelper/Dh_Lib.pm
debian/changelog
dh

index afad4b3c87369bf950beef439fdd17102d492bc2..ef94e9403684c31a9c45a5941f54292ac9c59a47 100644 (file)
@@ -145,10 +145,41 @@ sub getoptions {
 sub parseopts {
        my $options=shift;
        
+       my @ARGV_extra;
+
+       # DH_INTERNAL_OPTIONS is used to pass additional options from
+       # dh through an override target to a command.
+       if (defined $ENV{DH_INTERNAL_OPTIONS}) {
+               $ENV{DH_INTERNAL_OPTIONS}=~s/^\s+//;
+               $ENV{DH_INTERNAL_OPTIONS}=~s/\s+$//;
+               @ARGV_extra=split(/\s+/,$ENV{DH_INTERNAL_OPTIONS});
+               my $ret=getoptions(\@ARGV_extra, $options);
+               if (!$ret) {
+                       warning("warning: unknown options will be a fatal error in a future debhelper release");
+                       #error("unknown option; aborting");
+               }
+
+               # Avoid forcing acting on packages specified in
+               # DH_INTERNAL_OPTIONS. This way, -p can be specified
+               # at the command line to act on a specific package, and if
+               # nothing is specified, the excludes will cause the set of
+               # packages DH_INTERNAL_OPTIONS specifies to be acted on.
+               if (defined $dh{DOPACKAGES}) {
+                       foreach my $package (getpackages()) {
+                               if (! grep { $_ eq $package } @{$dh{DOPACKAGES}}) {
+                                       $exclude_package{$package}=1;
+                               }
+                       }
+               }
+               delete $dh{DOPACKAGES};
+               delete $dh{DOINDEP};
+               delete $dh{DOARCH};
+               delete $dh{DOSAME};
+       }
+       
        # DH_OPTIONS can contain additional options
        # to be parsed like @ARGV, but with unknown options
        # skipped.
-       my @ARGV_extra;
        if (defined $ENV{DH_OPTIONS}) {
                $ENV{DH_OPTIONS}=~s/^\s+//;
                $ENV{DH_OPTIONS}=~s/\s+$//;
@@ -159,14 +190,6 @@ sub parseopts {
                }
        }
 
-       # DH_INTERNAL_OPTIONS is used to pass additional options from
-       # dh through an override target to a command.
-       if (defined $ENV{DH_INTERNAL_OPTIONS}) {
-               $ENV{DH_INTERNAL_OPTIONS}=~s/^\s+//;
-               $ENV{DH_INTERNAL_OPTIONS}=~s/\s+$//;
-               unshift @ARGV, split(/\s+/,$ENV{DH_INTERNAL_OPTIONS});
-       }
-
        my $ret=getoptions(\@ARGV, $options);
        if (!$ret) {
                warning("warning: unknown options will be a fatal error in a future debhelper release");
@@ -186,7 +209,7 @@ sub parseopts {
                if ($dh{DOINDEP} || $dh{DOARCH} || $dh{DOSAME}) {
                        # User specified that all arch (in)dep package be
                        # built, and there are none of that type.
-                       warning("I have no package to build");
+                       warning("You asked that all arch in(dep) packages be built, but there are none of that type.");
                        exit(0);
                }
                push @{$dh{DOPACKAGES}},getpackages();
@@ -208,9 +231,9 @@ sub parseopts {
        }
        @{$dh{DOPACKAGES}}=@package_list;
 
-       # If there are no packages to act on now, it's an error.
        if (! defined $dh{DOPACKAGES} || ! @{$dh{DOPACKAGES}}) {
-               error("I have no package to build");
+               warning("No packages to build.");
+               exit(0);
        }
 
        if (defined $dh{U_PARAMS}) {
index 400549443494275026491a4fe8ccfc5acf07b730..d481128362708228433740ee4c314c2cb5c2c82f 100644 (file)
@@ -74,9 +74,6 @@ sub init {
        # Check if packages to build have been specified, if not, fall back to
        # the default, doing them all.
        if (! defined $dh{DOPACKAGES} || ! @{$dh{DOPACKAGES}}) {
-               if ($dh{DOINDEP} || $dh{DOARCH} || $dh{DOSAME}) {
-                       error("You asked that all arch in(dep) packages be built, but there are none of that type.");
-               }
                push @{$dh{DOPACKAGES}},@allpackages;
        }
 
index e4ac78b8a0fca5b3ef772946f8e4eb5b8368b8fc..7cfc588daafde4936611516266260715ed8a01c4 100644 (file)
@@ -1,3 +1,10 @@
+debhelper (7.2.7) UNRELEASED; urgency=low
+
+  * Fix calling the same helper for separate packages in the override of dh
+    binary-indep/binary-arch. Closes: #520567
+
+ -- Joey Hess <joeyh@debian.org>  Fri, 20 Mar 2009 21:26:03 -0400
+
 debhelper (7.2.6) unstable; urgency=low
 
   * Examples files updated to add dh_bugfiles, remove obsolete
diff --git a/dh b/dh
index 498c7cff55162b207a8fadc66c02a1b016b4112b..8639ed074311b418b2d10b1cf04835491e2042c5 100755 (executable)
--- a/dh
+++ b/dh
@@ -443,6 +443,10 @@ sub run {
        my @exclude=@{shift()};
        my @options=@_;
        
+       # If some packages are excluded, add flags
+       # to prevent them from being acted on.
+       push @options, map { "-N$_" } @exclude;
+
        # Check for override targets in debian/rules and
        # run them instead of running the command directly.
        my $override_command;
@@ -454,11 +458,6 @@ sub run {
                $command="debian/rules";
                @options="override_".$override_command;
        }
-       else {
-               # If some packages are excluded, add flags
-               # to prevent them from being acted on.
-               push @options, map { "-N$_" } @exclude;
-       }
 
        # 3 space indent lines the command being run up under the 
        # sequence name after "dh ".