]> git.donarmstrong.com Git - debhelper.git/commitdiff
r398: * If DH_COMPAT=3 is set, the following happens:
authorjoey <joey>
Tue, 28 Nov 2000 05:12:23 +0000 (05:12 +0000)
committerjoey <joey>
Tue, 28 Nov 2000 05:12:23 +0000 (05:12 +0000)
     - 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

Debian/Debhelper/Dh_Lib.pm
debhelper.1
debian/changelog
dh_installwm
dh_movefiles
dh_movefiles.1
doc/v3

index 22e9c3885620b14bda8beac88447ddfa93ca0611..52adf66a07202dc497f6186b5011b329f0c8eade 100644 (file)
@@ -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;
index c8cd186cb208f15138d226b3228ff1b08f2cde53..4badca8e8b5900f231efd4d480ae537820832c55 100644 (file)
@@ -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
index 54c6a391fe546884f6e5173f08379465e8fc3754..fcfd72b2e6afb76856d0c8888d0108a2d140cf3e 100644 (file)
@@ -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
index 7bc98aaed585bed829e3509e8e46a946ce431aec..c510e9f0c1e92e4bef1bfbaa2780b536cf3a1297 100755 (executable)
@@ -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) {
index 1ee71e76738cd5872d2ad78e41986d1efa76246d..6e3a8688195e146dd9842b39fda60c98126a0129 100755 (executable)
@@ -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=$_;
index a96086d0cd732bca2210023ea09947f906d3c6d7..72c6f2540f44ad0655aa3ced73bddbd7940906d7 100644 (file)
@@ -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 0dc179449a1bc15e1613cab69616293540988cf9..c1833dca07b21ebbf7a18112a75398bd02e51afe 100644 (file)
--- 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.)