]> git.donarmstrong.com Git - debhelper.git/blobdiff - Dh_Getopt.pm
r1539: fix tag name
[debhelper.git] / Dh_Getopt.pm
index e92408930ef01bcbf1f0b7c09fa185689589a360..0c28500d6dfc069b9e40ebbc7dd949f0fd2707d2 100644 (file)
@@ -31,6 +31,10 @@ sub AddPackage { my($option,$value)=@_;
        elsif ($option eq 'p' or $option eq 'package') {
                push @{$options{DOPACKAGES}}, $value;
        }
+       elsif ($option eq 's' or $option eq 'same-arch') {
+               push @{$options{DOPACKAGES}}, GetPackages('same');
+               $options{DOSAME}=1;
+       }
        else {
                error("bad option $option - should never happen!\n");
        }
@@ -63,6 +67,9 @@ sub parseopts {
                "p=s" => \&AddPackage,
                "package=s" => \&AddPackage,
        
+               "s" => \&AddPackage,
+               "same-arch" => \&AddPackage,
+       
                "N=s" => \&ExcludePackage,
                "no-package=s" => \&ExcludePackage,
        
@@ -77,6 +84,7 @@ sub parseopts {
        
                "d" => \$options{D_FLAG},
                "remove-d" => \$options{D_FLAG},
+               "dirs-only" => \$options{D_FLAG},
        
                "r" => \$options{R_FLAG},
                "no-restart-on-upgrade" => \$options{R_FLAG},
@@ -104,6 +112,10 @@ sub parseopts {
                "no-act" => \$options{NO_ACT},
        
                "init-script=s" => \$options{INIT_SCRIPT},
+               
+               "sourcedir=s" => \$options{SOURCEDIR},
+               
+               "destdir=s" => \$options{DESTDIR},
        );
 
        if (!$ret) {
@@ -120,7 +132,7 @@ sub parseopts {
        # want us to act on them all. Note we have to do this before excluding
        # packages out, below.
        if (! defined $options{DOPACKAGES} || ! @{$options{DOPACKAGES}}) {
-               if ($options{DOINDEP} || $options{DOARCH}) {
+               if ($options{DOINDEP} || $options{DOARCH} || $options{DOSAME}) {
                                # User specified that all arch (in)dep package be
                                # built, and there are none of that type.
                                error("I have no package to build");
@@ -138,6 +150,13 @@ sub parseopts {
        }
        @{$options{DOPACKAGES}}=@package_list;
 
+       # Generate EXCLUDE_FIND.
+       $options{EXCLUDE_FIND}='';
+       foreach (@{$options{EXCLUDE}}) {
+               $options{EXCLUDE_FIND}.="-regex .*".quotemeta($_).".* -or ";
+       }
+       $options{EXCLUDE_FIND}=~s/ -or $//;
+
        # If there are no packages to act on now, it's an error.
        if (! defined $options{DOPACKAGES} || ! @{$options{DOPACKAGES}}) {
                error("I have no package to build");