summaryrefslogtreecommitdiff
path: root/Debian
diff options
context:
space:
mode:
authorjoey <joey>2000-08-21 02:04:06 +0000
committerjoey <joey>2000-08-21 02:04:06 +0000
commite3534180b30e6f5e546078105bedfd5341664118 (patch)
tree60a635600b9df4b5854e3745f0d3e73c9fb98f51 /Debian
parenta4664178e1e455907c0ae2c9caf089ee6b8d0cc2 (diff)
r367: * debian/package.filename.arch is now checked for first, before
debian/package.filename. Closes: #69453 * Added a section to debhelper(1) about files in debian/ used by debhelper, which documents this. Removed scattered references to debian/filename from all over the man pages.
Diffstat (limited to 'Debian')
-rw-r--r--Debian/Debhelper/Dh_Lib.pm43
1 files changed, 32 insertions, 11 deletions
diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index 92059da..053dacd 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -222,19 +222,28 @@ sub tmpdir { my $package=shift;
}
# Pass this the name of a binary package, and the name of the file wanted
-# for the package, and it will return the actual filename to use. For
-# example if the package is foo, and the file is somefile, it will look for
-# debian/somefile, and if found return that, otherwise, if the package is
-# the main package, it will look for debian/foo, and if found, return that.
-# Failing that, it will return nothing.
-sub pkgfile { my $package=shift; my $filename=shift;
- if (-f "debian/$package.$filename") {
+# for the package, and it will return the actual existing filename to use.
+#
+# It tries several filenames:
+# * debian/package.filename.buildarch
+# * debian/package.filename
+# * debian/file (if the package is the main package)
+sub pkgfile {
+ my $package=shift;
+ my $filename=shift;
+
+ if (-f "debian/$package.$filename.".buildarch()) {
+ return "debian/$package.$filename".buildarch();
+ }
+ elsif (-f "debian/$package.$filename") {
return "debian/$package.$filename";
}
elsif ($package eq $dh{MAINPACKAGE} && -f "debian/$filename") {
return "debian/$filename";
}
- return "";
+ else {
+ return "";
+ }
}
# Pass it a name of a binary package, it returns the name to prefix to files
@@ -328,6 +337,19 @@ sub filearray { my $file=shift;
return @ret;
}
+# Returns the build architecture. (Memoized)
+{
+ my $arch;
+
+ sub buildarch {
+ return $arch if defined $arch;
+
+ $arch=`dpkg --print-architecture` || error($!);
+ chomp $arch;
+ return $arch;
+ }
+}
+
# Returns a list of packages in the control file.
# Must pass "arch" or "indep" or "same" to specify arch-dependant or
# -independant or same arch packages. If nothing is specified, returns all
@@ -336,10 +358,9 @@ sub GetPackages { my $type=shift;
$type="" if ! defined $type;
# Look up the build arch if we need to.
- my$buildarch='';
+ my $buildarch='';
if ($type eq 'same') {
- $buildarch=`dpkg --print-architecture` || error($!);
- chomp $buildarch;
+ $buildarch=buildarch();
}
my $package="";