summaryrefslogtreecommitdiff
path: root/Debian/Debhelper/Dh_Lib.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-05-09 12:21:12 -0400
committerJoey Hess <joey@kitenet.net>2010-05-09 12:21:12 -0400
commitccbde27ebd7562d540cf525c877ca996acc61318 (patch)
treeaca6bba8af6c809487723e6f82403618428f1c48 /Debian/Debhelper/Dh_Lib.pm
parent5cee909d876bacad4f3d0e092d69fe0bfee6e083 (diff)
Further reduce the number of calls to dpkg-architecture to zero, in a typical package with no explicit architecture mentions in control file or debhelper config files.
Diffstat (limited to 'Debian/Debhelper/Dh_Lib.pm')
-rw-r--r--Debian/Debhelper/Dh_Lib.pm20
1 files changed, 17 insertions, 3 deletions
diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index 155184b..09ec0b1 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -364,9 +364,23 @@ sub pkgfile {
$filename="$dh{NAME}.$filename";
}
- my @try=("debian/$package.$filename.".buildarch(),
- "debian/$package.$filename.".buildos(),
- "debian/$package.$filename");
+ # First, check for files ending in buildarch and buildos.
+ my $match;
+ foreach my $file (glob("debian/$package.$filename.*")) {
+ next if ! -f $file;
+ next if $dh{IGNORE} && exists $dh{IGNORE}->{$file};
+ if ($file eq "debian/$package.$filename.".buildarch()) {
+ $match=$file;
+ # buildarch files are used in preference to buildos files.
+ last;
+ }
+ elsif ($file eq "debian/$package.$filename.".buildos()) {
+ $match=$file;
+ }
+ }
+ return $match if defined $match;
+
+ my @try=("debian/$package.$filename");
if ($package eq $dh{MAINPACKAGE}) {
push @try, "debian/$filename";
}