summaryrefslogtreecommitdiff
path: root/dh_perl
diff options
context:
space:
mode:
authorjoey <joey>1999-08-17 05:16:53 +0000
committerjoey <joey>1999-08-17 05:16:53 +0000
commitb56939b95e6f1efab433eba09ce5cb6020df1436 (patch)
treef6ea88b5196d1aa8f640a6a25ccf683bfff8881c /dh_perl
parent638b3dcc6f795a817a0fca1104af86ed8152bc38 (diff)
downloaddebhelper-b56939b95e6f1efab433eba09ce5cb6020df1436.tar.gz
r229: Initial Import
Diffstat (limited to 'dh_perl')
-rwxr-xr-xdh_perl12
1 files changed, 10 insertions, 2 deletions
diff --git a/dh_perl b/dh_perl
index d66dfce5..0614b9b8 100755
--- a/dh_perl
+++ b/dh_perl
@@ -8,6 +8,7 @@ use Dh_Lib;
init();
my $perl = $ENV{PERL} || '/usr/bin/perl';
+my $ext = '';
# Figure out the version of perl. If $ENV{PERL} is set, query the perl binary
# it points to, otherwise query perl directly.
@@ -16,6 +17,10 @@ if (defined $ENV{PERL}) {
$version=`$ENV{PERL} -e 'printf "%.3f", \$]'`;
}
+# If -d is given, then we'll try to depend on one of the perl-5.00X-base
+# package instead of perl-5.00X
+$ext='-base' if ($dh{'D_FLAG'});
+
foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
$TMP=tmpdir($PACKAGE);
$EXT=pkgext($PACKAGE);
@@ -33,7 +38,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
$v = $1;
$arch = $2;
check_module_version ($v, $version);
- $v .= '-thread' if ($arch =~ /-thread/);
+ $v .= '-thread' if ($arch =~ /-thread/);
$dep_arch = add_deps ($dep_arch, "perl-$v");
} elsif ($file =~ m<^$TMP/usr/lib/perl5/(\d.\d{3})/>) {
$v = $1;
@@ -44,7 +49,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
}
if ($found and not $dep_arch) {
- $dep = "perl5";
+ $dep = "perl5$ext";
} elsif ($dep_arch) {
$dep = $dep_arch;
}
@@ -90,6 +95,9 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
sub add_deps {
my ($dep, $new) = @_;
+ # If the $new-base package can exist then add $ext to $new
+ $new = "$new$ext" if ($new =~ m/^(?:perl5|perl-\d\.\d{3})$/);
+
# If $new = perl5 or perl5-thread check if perl-X.XXX(-thread)?
# is not already in the dependencies
if ($new eq "perl5") {