summaryrefslogtreecommitdiff
path: root/Dh_Lib.pm
diff options
context:
space:
mode:
authorjoey <joey>1999-08-17 04:58:45 +0000
committerjoey <joey>1999-08-17 04:58:45 +0000
commitec938d4da786f7fd545b2ca27ebd5ea5c8b45c84 (patch)
tree3190f8df4b0ffba69ad43a4f03bfa88aa55c6e52 /Dh_Lib.pm
parent0287a9cbf507569b92fa157fb002a4ead079bbdb (diff)
downloaddebhelper-ec938d4da786f7fd545b2ca27ebd5ea5c8b45c84.tar.gz
r117: Initial Import
Diffstat (limited to 'Dh_Lib.pm')
-rw-r--r--Dh_Lib.pm9
1 files changed, 4 insertions, 5 deletions
diff --git a/Dh_Lib.pm b/Dh_Lib.pm
index 00f28132..e7070326 100644
--- a/Dh_Lib.pm
+++ b/Dh_Lib.pm
@@ -131,12 +131,11 @@ sub error { my $message=shift;
# Output a warning.
sub warning { my $message=shift;
- print STDERR basename().": $message\n";
+ print STDERR basename($0).": $message\n";
}
-# Returns the basename of the program.
-sub basename {
- my $fn=$0;
+# Returns the basename of the argument passed to it.
+sub basename { my $fn=shift;
$fn=~s:.*/(.*?):$1:;
return $fn;
}
@@ -241,7 +240,7 @@ sub autoscript { my $package=shift; my $script=shift; my $filename=shift; my $se
}
# TODO: do this in perl, perhaps?
- complex_doit("echo \"# Automatically added by ".basename().">> $outfile");
+ complex_doit("echo \"# Automatically added by ".basename($0).">> $outfile");
complex_doit("sed \"$sed\" $infile >> $outfile");
complex_doit("echo '# End automatically added section' >> $outfile");
}