summaryrefslogtreecommitdiff
path: root/dh_perl
diff options
context:
space:
mode:
authorjoey <joey>2001-02-09 01:38:37 +0000
committerjoey <joey>2001-02-09 01:38:37 +0000
commite446e8308e654785721d8036a1d53633207053f0 (patch)
treeb94df61d32eb482c3c1bc5a016d96e625e12dca6 /dh_perl
parent053f6f8b4e7431d32511aef209188a084e8c7e79 (diff)
r421: use strict
Diffstat (limited to 'dh_perl')
-rwxr-xr-xdh_perl35
1 files changed, 18 insertions, 17 deletions
diff --git a/dh_perl b/dh_perl
index eb69a75..2077497 100755
--- a/dh_perl
+++ b/dh_perl
@@ -3,10 +3,11 @@
# Find dependencies on perl stuff
# Remove .packlist files
+use strict;
use Debian::Debhelper::Dh_Lib;
init();
-my $ext = '';
+my $perlext = '';
my $lib_dir = 'usr/lib/perl5';
# Figure out the version of perl. If $ENV{PERL} is set, query the perl binary
@@ -30,11 +31,11 @@ foreach (@ARGV) {
# 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'});
+$perlext='-base' if ($dh{'D_FLAG'});
-foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
- $TMP=tmpdir($PACKAGE);
- $EXT=pkgext($PACKAGE);
+foreach my $package (@{$dh{DOPACKAGES}}) {
+ my $tmp=tmpdir($package);
+ my $ext=pkgext($package);
my ($file, $v, $arch);
my $dep_arch = '';
@@ -44,7 +45,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
# Check also for alternate locations given on the command line
my $dirs = '';
foreach ($lib_dir, @ARGV) {
- $dirs .= "$TMP/$_ " if (-d "$TMP/$_");
+ $dirs .= "$tmp/$_ " if (-d "$tmp/$_");
}
my $re = '(?:' . join('|', ($lib_dir, @ARGV)) . ')';
@@ -52,13 +53,13 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
if ($dirs) {
foreach $file (split(/\n/,`find $dirs -type f \\( -name "*.pm" -or -name "*.so" \\)`)) {
$found++;
- if ($file =~ m<^$TMP/$re/(\d\.\d+)/([^/]+)/>) {
+ if ($file =~ m<^$tmp/$re/(\d\.\d+)/([^/]+)/>) {
$v = $1;
$arch = $2;
check_module_version ($v, $version);
$v .= '-thread' if ($arch =~ /-thread/);
$dep_arch = add_deps ($dep_arch, "perl-$v");
- } elsif ($file =~ m<^$TMP/$re/(\d.\d+)/>) {
+ } elsif ($file =~ m<^$tmp/$re/(\d.\d+)/>) {
$v = $1;
check_module_version ($v, $version);
$dep_arch = add_deps ($dep_arch, "perl-$v");
@@ -67,14 +68,14 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
}
if ($found and not $dep_arch) {
- $dep = "perl5$ext";
+ $dep = "perl5$perlext";
} elsif ($dep_arch) {
$dep = $dep_arch;
}
# Look for perl scripts
my ($ff, $newdep);
- foreach $file (split(/\n/,`find $TMP -type f \\( -name "*.pl" -or -perm +111 \\)`)) {
+ foreach $file (split(/\n/,`find $tmp -type f \\( -name "*.pl" -or -perm +111 \\)`)) {
$ff=`file -b $file`;
if ($ff =~ /perl/) {
$newdep = dep_from_script ($file);
@@ -84,7 +85,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
# Remove .packlist files and eventually some empty directories
if (not $dh{'K_FLAG'}) {
- foreach $file (split(/\n/,`find $TMP -type f -name .packlist`))
+ foreach $file (split(/\n/,`find $tmp -type f -name .packlist`))
{
unlink($file);
# Get the directory name
@@ -97,14 +98,14 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
next unless $dep;
- if (-e "debian/${EXT}substvars") {
- open (IN, "<debian/${EXT}substvars");
+ if (-e "debian/${ext}substvars") {
+ open (IN, "<debian/${ext}substvars");
my @lines=grep { ! /^perl:Depends=/ } <IN>;
close IN;
- open (OUT, ">debian/${EXT}substvars");
+ open (OUT, ">debian/${ext}substvars");
print OUT @lines;
} else {
- open (OUT, ">debian/${EXT}substvars");
+ open (OUT, ">debian/${ext}substvars");
}
print OUT "perl:Depends=$dep\n";
close OUT;
@@ -113,8 +114,8 @@ 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+)$/);
+ # If the $new-base package can exist then add $perlext to $new
+ $new = "$new$perlext" if ($new =~ m/^(?:perl5|perl-\d\.\d+)$/);
# If $new = perl5 or perl5-thread check if perl-X.XXX(-thread)?
# is not already in the dependencies