]> git.donarmstrong.com Git - debhelper.git/commitdiff
Support debian/foo.os files to suppliment previous debian/foo.arch file support....
authorJoey Hess <joey@gnu.kitenet.net>
Tue, 12 May 2009 18:52:09 +0000 (14:52 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Tue, 12 May 2009 18:52:09 +0000 (14:52 -0400)
Debian/Debhelper/Dh_Lib.pm
debhelper.pod
debian/changelog

index 829eabfc38f70864d4babd63246e16f933f59f29..f09c80873b24e517a62ef276c317812ebb724e58 100644 (file)
@@ -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;
index dad286ee0f5e5b5f2587696c3a5717bc9c0a6760..37f649fdc09585d2739c4172edc61f5230c7518f 100644 (file)
@@ -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
index 1f5cff0bc51dccbf666d211570affa75068f9293..760aaba7952ac78373dda77f2a7c1b36c67ce022 100644 (file)
@@ -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 <joeyh@debian.org>  Mon, 11 May 2009 14:50:33 -0400