summaryrefslogtreecommitdiff
path: root/Debian/Debhelper/Dh_Lib.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-05-12 14:52:09 -0400
committerJoey Hess <joey@gnu.kitenet.net>2009-05-12 14:52:09 -0400
commit6d9c1c7b7e3aa8dbc101c2592e5f7bb87abbb3a5 (patch)
tree084cd6e02213b115977d89639dd3c6aa6a0d9d28 /Debian/Debhelper/Dh_Lib.pm
parentff3cc0c92fc865297ed869b38c6cb0dd0882f77c (diff)
Support debian/foo.os files to suppliment previous debian/foo.arch file support. Closes: #494914 (Thanks, Aurelien Jarno)
Diffstat (limited to 'Debian/Debhelper/Dh_Lib.pm')
-rw-r--r--Debian/Debhelper/Dh_Lib.pm23
1 files changed, 20 insertions, 3 deletions
diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index 829eabfc..f09c8087 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -346,12 +346,15 @@ sub tmpdir {
#
# It tries several filenames:
# * debian/package.filename.buildarch
+# * debian/package.filename.buildos
# * debian/package.filename
-# * debian/file (if the package is the main package)
-# If --name was specified then tonly the first two are tried, and they must
-# have the name after the pacage name:
+# * debian/filename (if the package is the main package)
+# If --name was specified then the files
+# must have the name after the package name:
# * debian/package.name.filename.buildarch
+# * debian/package.name.filename.buildos
# * debian/package.name.filename
+# * debian/name.filename (if the package is the main package)
sub pkgfile {
my $package=shift;
my $filename=shift;
@@ -361,6 +364,7 @@ sub pkgfile {
}
my @try=("debian/$package.$filename.".buildarch(),
+ "debian/$package.$filename.".buildos(),
"debian/$package.$filename");
if ($package eq $dh{MAINPACKAGE}) {
push @try, "debian/$filename";
@@ -614,6 +618,19 @@ sub excludefile {
}
}
+# Returns the build OS. (Memoized)
+{
+ my $os;
+
+ sub buildos {
+ return $os if defined $os;
+
+ $os=`dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null` || error("dpkg-architecture failed");
+ chomp $os;
+ return $os;
+ }
+}
+
# Passed an arch and a list of arches to match against, returns true if matched
sub samearch {
my $arch=shift;