@ISA=qw(Exporter);
@EXPORT=qw(&init &doit &complex_doit &verbose_print &error &warning &tmpdir
&pkgfile &pkgext &isnative &autoscript &filearray &GetPackages
+ &xargs
%dh);
sub init {
}
}
+# 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}) {
+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.
}
if (@f) {
- doit("gzip","-9f",@f);
+ xargs(\@f,"gzip","-9f");
}
# Now change over any files we can that used to be hard links so
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