Apply patch 393791-sliceprint from Debian.
authorTim Retout <diocles@gnu.org>
Sat, 9 Jul 2011 22:43:21 +0000 (23:43 +0100)
committerTim Retout <diocles@gnu.org>
Sat, 9 Jul 2011 22:43:21 +0000 (23:43 +0100)
Signed-off-by: Tim Retout <diocles@gnu.org>
ChangeLog
scripts/sliceprint.1
scripts/sliceprint.in

index bf59ffc9786923f018785efef3c468181055006c..09655d187e8911bf849965d1ea5ef82a536086dd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2011-07-09  Tim Retout  <diocles@gnu.org>
 
+       Apply patch 393791-sliceprint from Debian:
+       * scripts/sliceprint.1: Complete documentation.
+       * scripts/sliceprint.in: Force C locale.
+       Use more liberal regexp when parsing wrapped lines message.
+       Add missing space from before args. Savannah bug #31259.
+
        * Makefile.am (SUBDIRS): Move intl to be built before compat.
 
        * states/Makefile.am: Use $(datadir) instead of $(prefix)/share.
index 144331b9db427e6e4e5a3cd142208ff7ebb3330e..abd45a1f96b73df7977f2fe05bfb3a0d7a2384fc 100644 (file)
 sliceprint \- slice documents with long lines.
 
 .SH SYNOPSIS
-.B sliceprint \f1[\f2enscript_options\f1]\f3 \f1[\f2files\f1]\f3
+.B sliceprint \f1[\-o\f2file\f1]\f3 \f1[\f2enscript_options\f1]\f3 \f1[\f2files\f1]\f3
 
 .SH DESCRIPTION
 
-XXX
-
+\f3Sliceprint\f1 is a wrapper around the \f3enscript(1)\f1\ \-\-slice option.
+Output slices are written to \f2file\f1.1, \f2file\f1.2 and so on.
 
 .SH SEE ALSO
 enscript(1)
index b56b8ddebb719ca955085d96a03897525347e600..c542a93dd5a4c45e0bb5b6a62212662b3e647be1 100644 (file)
 #
 
 $enscript = "enscript";
+$ENV{LC_ALL} = "C"; # we parse enscript's output
 
 $program = $0;
 $program =~ s/.*\///g;
 
 sub usage {
-    warn "Usage: $program [ENSCRIPT_OPTION]... [FILE]...\n";
+    warn "Usage: $program [-oFILE] [ENSCRIPT_OPTION]... [FILE]...\n";
 }
 
 # Handle arguments.
@@ -65,14 +66,15 @@ $slice = 0;
 while (1) {
     $slice++;
     if (defined($output_file)) {
-       $cmd = "$enscript" . $args . " --slice=$slice -p"
+       $cmd = "$enscript " . $args . " --slice=$slice -p"
            . $output_file . "." . $slice . " " . $files;
     } else {
-       $cmd = "$enscript" . $args . " --slice=$slice" . $files;
+       $cmd = "$enscript " . $args . " --slice=$slice" . $files;
     }
     print "printing slice $slice...\n";
     $result = `$cmd 2>&1`;
-    if ($result !~ ".*lines were.*") {
+    print $result;
+    if ($result !~ ".*line.* were wrapped.*") {
        last;
     }
 }