summaryrefslogtreecommitdiff
path: root/Dh_Lib.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Dh_Lib.pm')
-rw-r--r--Dh_Lib.pm17
1 files changed, 15 insertions, 2 deletions
diff --git a/Dh_Lib.pm b/Dh_Lib.pm
index 25174312..b7f281ba 100644
--- a/Dh_Lib.pm
+++ b/Dh_Lib.pm
@@ -187,14 +187,27 @@ sub dirname { my $fn=shift;
return $fn;
}
+# Pass in a number, will return true iff the current compatability level
+# is equal to that number.
+sub compat {
+ my $num=shift;
+
+ my $c=1;
+ if (defined $ENV{DH_COMPAT}) {
+ $c=$ENV{DH_COMPAT};
+ }
+
+ return ($c == $num);
+}
+
# Pass it a name of a binary package, it returns the name of the tmp dir to
# use, for that package.
-# This is for back-compatability with the debian/tmp tradition.
sub tmpdir { my $package=shift;
if ($dh{TMPDIR}) {
return $dh{TMPDIR};
}
- elsif ($package eq $dh{MAINPACKAGE}) {
+ elsif (compat(1) && $package eq $dh{MAINPACKAGE}) {
+ # This is for back-compatability with the debian/tmp tradition.
return "debian/tmp";
}
else {