From 6d9c1c7b7e3aa8dbc101c2592e5f7bb87abbb3a5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 12 May 2009 14:52:09 -0400 Subject: Support debian/foo.os files to suppliment previous debian/foo.arch file support. Closes: #494914 (Thanks, Aurelien Jarno) --- Debian/Debhelper/Dh_Lib.pm | 23 ++++++++++++++++++++--- debhelper.pod | 7 ++++--- debian/changelog | 3 +++ 3 files changed, 27 insertions(+), 6 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; diff --git a/debhelper.pod b/debhelper.pod index dad286ee..37f649fd 100644 --- a/debhelper.pod +++ b/debhelper.pod @@ -62,9 +62,10 @@ debian/control, debhelper will use debian/foo if no debian/package.foo file can be found. In some rare cases, you may want to have different versions of these files -for different architectures. If files named debian/package.foo.arch -exist, where "arch" is the same as the output of -"dpkg-architecture -qDEB_HOST_ARCH", +for different architectures or OSes. If files named debian/package.foo.arch +or debian/package.foo.os exist, where "arch" and "os" are the same as the +output of "dpkg-architecture -qDEB_HOST_ARCH" / +"dpkg-architecture -qDEB_HOST_ARCH_OS", then they will be used in preference to other, more general files. In many cases, these config files are used to specify various types of diff --git a/debian/changelog b/debian/changelog index 1f5cff0b..760aaba7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,9 @@ debhelper (7.2.11) UNRELEASED; urgency=low * dh_auto_configure: Add --skipdeps when running Makefile.PL, to prevent Module::Install from trying to download dependencies. Closes: #528235 + * Support debian/foo.os files to suppliment previous debian/foo.arch + file support. Closes: #494914 + (Thanks, Aurelien Jarno) -- Joey Hess Mon, 11 May 2009 14:50:33 -0400 -- cgit v1.2.3