path: root/Debian/Debhelper
diff options
authorjoey <joey>2002-04-12 03:04:35 +0000
committerjoey <joey>2002-04-12 03:04:35 +0000
commit29fd2dcb7d861e78f8b5855abd06364e8d60c2ed (patch)
treeab18887fe7bba32e72f842d5b685181df239c93d /Debian/Debhelper
parentea383ca972213bdda50226c536e3224a361904b8 (diff)
r518: * dh_movefiles has long been a sore point in debhelper. Inherited
from debstd, its interface and implementation suck, and I have maintained it while never really deigning to use it. Now there is a remplacment: dh_install, which ... - copies files, doesn't move them. Closes: #75360, #82649 - doesn't have that whole annoying debian/package.files vs. debian/files mess, as it uses debian/install. - supports copying empty subdirs. Closes: #133037 - doesn't use tar, thus no error reproting problems. Closes: #112538 - files are listed relative to the pwd, debian/tmp need not be used at all, so no globbing issues. Closes: #100404 - supports -X. Closes: #116902 - the whole concept of moving files out of a directory is gone, so this bug doesn't really apply. Closes: #120026 - This is exactly what Bill Allombert asked for in #117383, even though I designed it seemingly independantly. Thank you Bill! Closes: #117383 * Made debhelper's debian/rules a lot simpler by means of the above. * Updated example rules file to use dh_install. Also some reordering and other minor changes. * dh_movefiles is lightly deprecated, and when you run into its bugs and bad design, you are incouraged to just use dh_install instead. * dh_fixperms: in v4 only, make all files in bin/ dirs +x. Closes: #119039 * dh_fixperms: in v4 only, make all files in etc/init.d executable (of course there's -X ..) * dh_link: in v4 only, finds existing, non-policy-conformant symlinks and corrects them. This has the side effect of making dh_link idempotent. * Added a -h/--help option. This seems very obvious, but it never occured to me before.. * use v4 for building debhelper itself * v4 mode is done, you may now use it without fear of it changing. (This idea of this upload is to get v4 into woody so people won't run into many issues backporting from sarge to woody later on. Packages targeted for woody should continue to use whatever compatability level they are using.)
Diffstat (limited to 'Debian/Debhelper')
2 files changed, 27 insertions, 6 deletions
diff --git a/Debian/Debhelper/ b/Debian/Debhelper/
index 191227d..81d2061 100644
--- a/Debian/Debhelper/
+++ b/Debian/Debhelper/
@@ -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/ b/Debian/Debhelper/
index 81ef6ca..0aa883b 100644
--- a/Debian/Debhelper/
+++ b/Debian/Debhelper/
@@ -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) {
- push @ret, $_;
+ push @line, $_;
else {
- push @ret, split;
+ @line = split;
+ push @ret, [@line];
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;