summaryrefslogtreecommitdiff
path: root/Debian/Debhelper
diff options
context:
space:
mode:
Diffstat (limited to 'Debian/Debhelper')
-rw-r--r--Debian/Debhelper/Dh_Getopt.pm14
-rw-r--r--Debian/Debhelper/Dh_Lib.pm19
2 files changed, 27 insertions, 6 deletions
diff --git a/Debian/Debhelper/Dh_Getopt.pm b/Debian/Debhelper/Dh_Getopt.pm
index 191227da..81d20618 100644
--- a/Debian/Debhelper/Dh_Getopt.pm
+++ b/Debian/Debhelper/Dh_Getopt.pm
@@ -2,7 +2,7 @@
#
# Debhelper option processing library.
#
-# Joey Hess GPL copyright 1998.
+# Joey Hess GPL copyright 1998-2002
package Debian::Debhelper::Dh_Getopt;
use strict;
@@ -16,6 +16,14 @@ use Exporter;
my (%options, %exclude_package);
+sub showhelp {
+ my $prog=basename($0);
+ print "Usage: $prog [options]\n\n";
+ print " $prog is a part of debhelper. See debhelper(1)\n";
+ print " and $prog(1) for complete usage instructions.\n";
+ exit(1);
+}
+
# Passed an option name and an option value, adds packages to the list
# of packages. We need this so the list will be built up in the right
# order.
@@ -129,6 +137,10 @@ sub parseopts {
"priority=i" => \$options{PRIORITY},
"flavor=s" => \$options{FLAVOR},
+
+ "autodest" => \$options{AUTODEST},
+
+ "h|help" => \&showhelp,
"<>" => \&NonOption,
);
diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index 81ef6cae..0aa883b1 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -422,17 +422,19 @@ sub addsubstvar {
}
}
-# Reads in the specified file, one word at a time, and returns an array of
-# the result. If a value is passed in as the second parameter, then glob
+# Reads in the specified file, one line at a time. splits on words,
+# and returns an array of arrays of the contents.
+# If a value is passed in as the second parameter, then glob
# expansion is done in the directory specified by the parameter ("." is
# frequently a good choice).
-sub filearray {
+sub filedoublearray {
my $file=shift;
my $globdir=shift;
my @ret;
open (DH_FARRAY_IN, $file) || error("cannot read $file: $1");
while (<DH_FARRAY_IN>) {
+ my @line;
# Only do glob expansion in v3 mode.
#
# The tricky bit is that the glob expansion is done
@@ -441,18 +443,25 @@ sub filearray {
if (defined $globdir && ! compat(2)) {
for (map { glob "$globdir/$_" } split) {
s#^$globdir/##;
- push @ret, $_;
+ push @line, $_;
}
}
else {
- push @ret, split;
+ @line = split;
}
+ push @ret, [@line];
}
close DH_FARRAY_IN;
return @ret;
}
+# Reads in the specified file, one word at a time, and returns an array of
+# the result. Can do globbing as does filedoublearray.
+sub filearray {
+ return map { @$_ } filedoublearray(@_);
+}
+
# Passed a filename, returns true if -X says that file should be excluded.
sub excludefile {
my $filename = shift;