]> git.donarmstrong.com Git - debhelper.git/commitdiff
r179: Initial Import
authorjoey <joey>
Tue, 17 Aug 1999 05:11:15 +0000 (05:11 +0000)
committerjoey <joey>
Tue, 17 Aug 1999 05:11:15 +0000 (05:11 +0000)
Dh_Lib.pm
debian/changelog
dh_compress
dh_compress.1

index f20cd5db8d29be024edcb1241646fa9e780fd53f..2517431249a6617ea0896f066b2f0a6052842379 100644 (file)
--- a/Dh_Lib.pm
+++ b/Dh_Lib.pm
@@ -12,6 +12,7 @@ use vars qw(@ISA @EXPORT %dh);
 @ISA=qw(Exporter);
 @EXPORT=qw(&init &doit &complex_doit &verbose_print &error &warning &tmpdir
            &pkgfile &pkgext &isnative &autoscript &filearray &GetPackages
+           &xargs
            %dh);
 
 sub init {
@@ -121,6 +122,41 @@ sub complex_doit {
        }                       
 }
 
+# Run a command that may have a huge number of arguments, like xargs does.
+# Pass in a reference to an array containing the arguments, and then other
+# parameters that are the command and any parameters that should be passed to
+# it each time.
+sub xargs {
+       my $args=shift;
+
+        # The kernel can accept command lines up to 20k worth of characters.
+       my $command_max=20000;
+
+       # Figure out length of static portion of command.
+       my $static_length=0;
+       foreach (@_) {
+               $static_length+=length($_)+1;
+       }
+       
+       my @collect=();
+       my $length=$static_length;
+       foreach (@$args) {
+               if (length($_) + 1 + $static_length > $command_max) {
+                       error("This command is greater than the maximum command size allowed by the kernel, and cannot be split up further. What on earth are you doing? \"@_ $_\"");
+               }
+               $length+=length($_) + 1;
+               if ($length < $command_max) {
+                       push @collect, $_;
+               }
+               else {
+                       doit(@_,@collect) if $#collect > -1;
+                       @collect=();
+                       $length=$static_length;
+               }
+       }
+       doit(@_,@collect) if $#collect > -1;
+}
+
 # Print something if the verbose flag is on.
 sub verbose_print { my $message=shift;
        if ($dh{VERBOSE}) {
index 8fdd8d525be9df5be8d3154b503128e4af5eb045..2dc3d0121c0dfacca046d03ec3bb8f5370ce0acd 100644 (file)
@@ -1,3 +1,10 @@
+debhelper (1.2.42) unstable; urgency=low
+
+  * dh_m5sums: don't generate bogus md5sums file if the package contains no
+    files. Yes, someone found a legitimate reason to do that.
+
+ -- Joey Hess <joeyh@master.debian.org>  Thu, 25 Feb 1999 00:03:47 -0800
+
 debhelper (1.2.41) unstable; urgency=low
 
   * README: minor typo fix.
index caffc11e9f158b73f03deb2fde2a20a67c1deec9..d4ec3cfda591d660286f60f0544fad319779c188 100755 (executable)
@@ -78,7 +78,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
        }
 
        if (@f) {
-               doit("gzip","-9f",@f);
+               xargs(\@f,"gzip","-9f");
        }
        
        # Now change over any files we can that used to be hard links so
index 8fa2d80273d63cee6d90f77a0e9b7b0395e0b2cd..f66283348e5556e8aad52e5b3e0c8a5e2e978aec 100644 (file)
@@ -15,10 +15,11 @@ be compressed, namely all files in usr/info, usr/man, usr/X11R6/man, and
 all files in usr/doc that are larger than 4k in size, except
 the copyright file, .html files and .gif files, and all changelog files.
 .P
-If a debian/compress file exits, however, it will be ran as a shell script,
-and all filenames that the shell script outputs will be compressed instead
-of the default files. Note that the shell script will be run from inside the
-package build directory.
+If a debian/package.compress file exists (debian/compress may be used for the
+first binary package in debian/control), however, it will be ran as a shell
+script, and all filenames that the shell script outputs will be compressed
+instead of the default files. Note that the shell script will be run from
+inside the package build directory.
 .SH EXAMPLE
 Here is a sample debian/compress file that causes dh_compress to compress
 the same files as it would by default. This is a good starting point for