summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoey <joey>2000-11-28 05:12:23 +0000
committerjoey <joey>2000-11-28 05:12:23 +0000
commit5c808f0c60445978cb180202a9f760032d24f742 (patch)
treea206c5cb4d265fa5321d84aa30dff7164f116bce
parentc577623cfbfa6aedbe12da4b96759864ae6f466d (diff)
r398: * If DH_COMPAT=3 is set, the following happens:
- Various debian/foo files like debian/docs, debian/examples, etc, begin to support filename globbing. use \* to escape the wildcards of course. I doubt this will bite anyone (Debian doesn't seem to contain files with "*" or "?" in their names..), but it is guarded by v3 just to be sure. Closes: #34120, #37694, #39846, #46249
-rw-r--r--Debian/Debhelper/Dh_Lib.pm23
-rw-r--r--debhelper.12
-rw-r--r--debian/changelog11
-rwxr-xr-xdh_installwm4
-rwxr-xr-xdh_movefiles5
-rw-r--r--dh_movefiles.17
-rw-r--r--doc/v312
7 files changed, 40 insertions, 24 deletions
diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index 22e9c38..52adf66 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -90,7 +90,7 @@ sub init {
sub escape_shell {
my $line=shift;
# This list is from _Unix in a Nutshell_. (except '#')
- $line~s/([\s!"\$()*+#;<>?@\[\]\\`|~])/\\$1/g;
+ $line=~s/([\s!"\$()*+#;<>?@\[\]\\`|~])/\\$1/g;
return $line;
}
@@ -339,18 +339,27 @@ sub autoscript {
}
# Reads in the specified file, one word at a time, and returns an array of
-# the result. Pass in a true value for the second parameter if the contents
-# of the file are filenames that can be glob expanded.
+# the result. 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 {
my $file=shift;
- my $doglob=shift || '';
+ my $globdir=shift;
my @ret;
- open (DH_FARRAY_IN,"<$file") || error("cannot read $file: $1");
+ open (DH_FARRAY_IN, $file) || error("cannot read $file: $1");
while (<DH_FARRAY_IN>) {
# Only do glob expansion in v3 mode.
- if ($doglob && compat(3)) {
- push @ret, map glob, split;
+ #
+ # The tricky bit is that the glob expansion is done
+ # as if we were in the specified directory, so the
+ # filenames that come out are relative to it.
+ if (defined $globdir && compat(3)) {
+ for (map { glob "$globdir/$_" } split) {
+ s#^$globdir/##;
+ push @ret, $_;
+ print "(--$_)\n";
+ }
}
else {
push @ret, split;
diff --git a/debhelper.1 b/debhelper.1
index c8cd186..4badca8 100644
--- a/debhelper.1
+++ b/debhelper.1
@@ -54,7 +54,7 @@ then they will be used in preference to other, more general files.
In many cases, these config files are used to specify various types of
files. Documentation or example files to install, files to move, and so on.
When appropriate, in cases like these, you can use standard shell wildcard
-characters ("?" and "*") in the files.
+characters ('?' and '*') in the files.
.SH "SHARED DEBHELPER OPTIONS"
The following command line options are supported by all debhelper programs.
.TP
diff --git a/debian/changelog b/debian/changelog
index 54c6a39..fcfd72b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+debhelper (2.2.3) unstable; urgency=low
+
+ * If DH_COMPAT=3 is set, the following happens:
+ - Various debian/foo files like debian/docs, debian/examples, etc,
+ begin to support filename globbing. use \* to escape the wildcards of
+ course. I doubt this will bite anyone (Debian doesn't seem to contain
+ files with "*" or "?" in their names..), but it is guarded by v3 just
+ to be sure. Closes: #34120, #37694, #39846, #46249
+
+ -- Joey Hess <joeyh@debian.org> Mon, 27 Nov 2000 20:43:26 -0800
+
debhelper (2.2.2) unstable; urgency=low
* dh_makeshlibs: corrected the evil db3-regex so it doesn't misfire on
diff --git a/dh_installwm b/dh_installwm
index 7bc98aa..c510e9f 100755
--- a/dh_installwm
+++ b/dh_installwm
@@ -10,7 +10,7 @@ if (! defined $dh{PRIORITY}) {
}
if (@ARGV) {
- # This is here for backwards comatability. If the filename doesn't
+ # This is here for backwards compatability. If the filename doesn't
# include a path, assume it's in /usr/X11R6/bin.
if ($ARGV[0] !~ m:/:) {
$ARGV[0]="/usr/X11R6/bin/$ARGV[0]";
@@ -22,7 +22,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
$file=pkgfile($PACKAGE,"wm");
if ($file) {
- @wm=filearray($file, $TMP);
+ @wm=filearray($file, '.');
}
if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
diff --git a/dh_movefiles b/dh_movefiles
index 1ee71e7..6e3a868 100755
--- a/dh_movefiles
+++ b/dh_movefiles
@@ -41,7 +41,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
}
# Now we need to expand wildcards in @tomove.
- # This is only necessary in pre-v3 land, as of v3, the
+ # This is only necessary in pre-v3 land -- as of v3, the
# expension is automatically done by filearray().
if (@tomove && ! Debian::Debhelper::Dh_Lib::compat(3)) {
@filelist=();
@@ -56,9 +56,6 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
doit("install","-d",$TMP);
}
- # Order the files. First all real files, then symlinks.
- # Putting symlinks last is a nice thing to do for library
- # packages and doesn't affect much of anything else.
doit("rm","-f","debian/movelist");
foreach (@tomove) {
$file=$_;
diff --git a/dh_movefiles.1 b/dh_movefiles.1
index a96086d..72c6f25 100644
--- a/dh_movefiles.1
+++ b/dh_movefiles.1
@@ -12,10 +12,9 @@ everything into debian/tmp, and you need to break that up into subpackages.
.P
Files named debian/package.files list the files to be moved, separated by
whitespace. The filenames listed should be relative to debian/tmp/. You can
-also list directory names, and the whole directory will be moved. You can
-even use wildcards if you like. If you prefer, you can list the files to
-move on the command line and this will apply to the first package
-dh_movefiles is told to act on.
+also list directory names, and the whole directory will be moved. If you
+prefer, you can list the files to move on the command line and this will
+apply to the first package dh_movefiles is told to act on.
.SH OPTIONS
.TP
.B debhelper options
diff --git a/doc/v3 b/doc/v3
index 0dc1794..c1833dc 100644
--- a/doc/v3
+++ b/doc/v3
@@ -27,10 +27,10 @@ them.
+ Every file in etc/ is automatically flagged as a conffile by dh_installdeb.
-* Debhelper config files will support globbing via * and ?, when
- appropriate. To turn this off and use those characters raw, just quote
- them.
-
-+ dh_makeshlibs will generate autoscript fragments for ldconfig. This will
- require you call it before dh_installdeb.
++ Debhelper config files support globbing via * and ?, when
+ appropriate. To turn this off and use those characters raw, just prefix
+ with a backspash.
++ dh_makeshlibs generates autoscript fragments for ldconfig. This will
+ require you call it before dh_installdeb. (Many old debian/rules scripts
+ call it after.)