]> git.donarmstrong.com Git - debhelper.git/commitdiff
r2033: * Add --ignore option. This is intended to ease dealing with upstream
authorjoeyh <joeyh>
Sun, 30 Sep 2007 17:42:06 +0000 (17:42 +0000)
committerjoeyh <joeyh>
Sun, 30 Sep 2007 17:42:06 +0000 (17:42 +0000)
  tarballs that contain debian directories, by allowing debhelper config
  files in those directories to be ignored, since there's generally no
  good way to delete them out of the upstream tarball, and they can easily
  get in the way if upstream is using debian/ differently than the Debian
  maintainer.

Debian/Debhelper/Dh_Getopt.pm
Debian/Debhelper/Dh_Lib.pm
debhelper.pod
debian/changelog

index b2b9224e345cf44b30babe64448c7b78b1463cc4..d1e052affba85501c5ca5fc72189f76f432c05b4 100644 (file)
@@ -63,6 +63,11 @@ sub AddExclude { my($option,$value)=@_;
        push @{$options{EXCLUDE}},$value;
 }
 
+# Add a file to the ignore list.
+sub AddIgnore { my($option,$file)=@_;
+       $options{IGNORE}->{$file}=1;
+}
+
 # This collects non-options values.
 sub NonOption {
        push @{$options{ARGV}}, @_;
@@ -103,6 +108,8 @@ sub parseopts {
        
                "X=s" => \&AddExclude,
                "exclude=s" => \&AddExclude,
+               
+               "ignore=s" => \&AddIgnore,
        
                "d" => \$options{D_FLAG},
                "remove-d" => \$options{D_FLAG},
index 80f563870da68a57b2ef2d23477b5b4061dcb319..bd5e3ae70fa19ebda4ace8bcfc5153b542bfbe5d 100644 (file)
@@ -320,18 +320,22 @@ sub pkgfile {
                $filename="$dh{NAME}.$filename";
        }
        
-       if (-f "debian/$package.$filename.".buildarch()) {
-               return "debian/$package.$filename.".buildarch();
+       my @try=("debian/$package.$filename.".buildarch(),
+                "debian/$package.$filename");
+       if ($package eq $dh{MAINPACKAGE}) {
+               push @try, "debian/$filename";
        }
-       elsif (-f "debian/$package.$filename") {
-               return "debian/$package.$filename";
-       }
-       elsif ($package eq $dh{MAINPACKAGE} && -f "debian/$filename") {
-               return "debian/$filename";
-       }
-       else {
-               return "";
+       
+       foreach my $file (@try) {
+               if (-f $file &&
+                   (! $dh{IGNORE} || ! exists $dh{IGNORE}->{$file})) {
+                       return $file;
+               }
+
        }
+
+       return "";
+
 }
 
 # Pass it a name of a binary package, it returns the name to prefix to files
index 7f2fbad2928caa44255d9370956f19ccc3c2c785..a2c7eebabb1a5a49fb980d3ee847cd4c2752779d 100644 (file)
@@ -119,6 +119,16 @@ are not architecture independent.
 Do not act on the specified package even if an -a, -i, or -p option lists
 the package as one that should be acted on.
 
+=item B<--ignore=>I<file>
+
+Ignore the specified file. This can be used if debian/ contains a debhelper
+config file that a debhelper command should not act on. Note that
+debian/compat, debian/control, and debian/changelog can't be ignored, but
+then, there should never be a reason to ignore those files.
+
+For example, if upstream ships a debian/init that you don't want
+dh_installinit to install, use --ignore=debian/init
+
 =item B<-P>I<tmpdir>, B<--tmpdir=>I<tmpdir>
 
 Use "tmpdir" for package build directory. The default is debian/<package>
index ce9724623e288f0f8bf73530d0223c2477e15dd9..e241842a81a6f3e33bc84738ad9b0eb17cb89761 100644 (file)
@@ -1,3 +1,14 @@
+debhelper (5.0.57) UNRELEASED; urgency=low
+
+  * Add --ignore option. This is intended to ease dealing with upstream
+    tarballs that contain debian directories, by allowing debhelper config
+    files in those directories to be ignored, since there's generally no
+    good way to delete them out of the upstream tarball, and they can easily
+    get in the way if upstream is using debian/ differently than the Debian
+    maintainer.
+
+ -- Joey Hess <joeyh@debian.org>  Sun, 30 Sep 2007 13:39:36 -0400
+
 debhelper (5.0.56) unstable; urgency=low
 
   * dh_installmodules: Since modutils is gone, stop supporting