summaryrefslogtreecommitdiff
path: root/Debian/Debhelper/Dh_Lib.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Debian/Debhelper/Dh_Lib.pm')
-rw-r--r--Debian/Debhelper/Dh_Lib.pm24
1 files changed, 14 insertions, 10 deletions
diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index 80f5638..bd5e3ae 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