From 15397137b7f8bbb9ac31383ed1ceb5972c55b569 Mon Sep 17 00:00:00 2001 From: joeyh Date: Sun, 30 Sep 2007 17:42:06 +0000 Subject: r2033: * 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. --- Debian/Debhelper/Dh_Lib.pm | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'Debian/Debhelper/Dh_Lib.pm') diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm index 80f56387..bd5e3ae7 100644 --- a/Debian/Debhelper/Dh_Lib.pm +++ b/Debian/Debhelper/Dh_Lib.pm @@ -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 -- cgit v1.2.3