diff options
author | Didier Raboud <didier@raboud.com> | 2010-05-23 00:04:53 +0200 |
---|---|---|
committer | Didier Raboud <didier@raboud.com> | 2010-05-23 00:04:53 +0200 |
commit | b840192256755e34993b795d0e00f5b27f6046d1 (patch) | |
tree | d379a8ff60ff7c125492a06c6cc103c474658548 | |
parent | 5d03809f25c1dc0d1862285552b7c7a4fe59a169 (diff) | |
parent | 0743a0a49409ef8ee98d0052154f638aace291d7 (diff) |
Merge branch 'upstream'
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | foomatic-gswrapper.in | 39 | ||||
-rw-r--r-- | foomatic-rip.in | 2 |
3 files changed, 44 insertions, 12 deletions
@@ -1,3 +1,16 @@ +2006-10-03 Till Kamppeter <till.kamppeter@gmail.com> + + * foomatic-rip.in: Fixed bashism. + +2006-08-27 Till Kamppeter <till.kamppeter@gmx.net> + + * foomatic-gswrapper.in: Support for built-in redirection of + standard output of PostScript programs ("-sstdout=%stderr") in + newer GhostScript versions. More reliable then using /dev/fd/3 + (not always available difficult to check presence) or '|cat >3' + (not seekable and some GhostScript output devices require + seekability of the output file), + 2006-07-10 Norm Jacobs <Norm.Jacobs@Sun.COM> * *: Removed executable permissions from source files which are @@ -5,7 +18,7 @@ 2006-06-15 Norm Jacobs <Norm.Jacobs@Sun.COM> - * foomatid-rip.in: failing to open IPP attributes file shouldn't be + * foomatic-rip.in: failing to open IPP attributes file shouldn't be fatal 2006-06-01 Norm Jacobs <Norm.Jacobs@Sun.COM> diff --git a/foomatic-gswrapper.in b/foomatic-gswrapper.in index da0c29a..e6b1049 100644 --- a/foomatic-gswrapper.in +++ b/foomatic-gswrapper.in @@ -25,19 +25,32 @@ my $execpath = "@EXECPATH@"; $execpath = $conf{execpath} if defined(%conf) and defined $conf{execpath}; $ENV{'PATH'} = $execpath; +# Check whether we have a GhostScript version with redirection of the +# standard output of the PostScript programs via '-sstdout=%stderr' +my $gswithstdoutredirection = 0; +if (`$gspath -dQUIET -dPARANOIDSAFER -dNOPAUSE -dBATCH -dNOMEDIAATTRS -sDEVICE=pswrite -sstdout=%stderr -sOutputFile=/dev/null -c '(hello\n) print flush' 2>&1` =~ /hello/) { + $gswithstdoutredirection = 1; +} + grep (m!\-sOutputFile=\-! && do { - # Send the job to fd 3; errors will be on 2(stderr) and job - # ps program interpreter output on 1(stdout). - $_ = '-sOutputFile=/dev/fd/3'; + # If GhostScript does not support redirecting the standard output + # of the PostScript program to standard error with + # '-sstdout=%stderr', sen the job output data to fd 3; errors + # will be on 2(stderr) and job ps program interpreter output on + # 1(stdout). + $_ = ($gswithstdoutredirection ? + '-sOutputFile=%stdout' : '-sOutputFile=/dev/fd/3'); # quoted properly below... }, @ARGV); -grep (((m!^\-$!) || (m!^\-_$!)) - && do { - # Get the input from fd 0. - $_ = "/dev/fd/0"; - }, @ARGV); +if (!$gswithstdoutredirection) { + grep (((m!^\-$!) || (m!^\-_$!)) + && do { + # Get the input from fd 0. + $_ = "/dev/fd/0"; + }, @ARGV); +} # Turn *off* -q (quiet!); now that stderr is useful! :) my @myargs = grep (! m!^\-q$!, @ARGV); @@ -54,8 +67,14 @@ my $args = "'" . join("' '", @myargs) . "'"; # Execute Ghostscript, with both job and gs errors on stderr, and job # output on stdout... -print STDERR "foomatic-gswrapper: $gspath $args 3>&1 1>&2\n"; -exec "$gspath $args 3>&1 1>&2"; +if ($gswithstdoutredirection) { + $args = "'-sstdout=\%stderr' $args"; + print STDERR "foomatic-gswrapper: $gspath $args\n"; + exec "$gspath $args"; +} else { + print STDERR "foomatic-gswrapper: $gspath $args 3>&1 1>&2\n"; + exec "$gspath $args 3>&1 1>&2"; +} die "Failed to execute Ghostscript?!"; diff --git a/foomatic-rip.in b/foomatic-rip.in index 9af8c14..a681753 100644 --- a/foomatic-rip.in +++ b/foomatic-rip.in @@ -6116,7 +6116,7 @@ sub buildpdqdriver { " # Custom page size settings\n", " # We aren't really checking for " . "legal vals.\n", - " if [ \"x\${$varn}\" == 'x$val' ]; " . + " if [ \"x\${$varn}\" = 'x$val' ]; " . "then\n", " $varn=\"\${$varn}.\${PageWidth}" . "x\${PageHeight}\${PageSizeUnit}\"\n", |