On 22/05/07 at 09:53 +0200, Lucas Nussbaum wrote:
> Package: gs-common
> Version: 0.3.13
> Severity: important
>
> Hi,
>
> In version 0.3.12, you introduced a change that did this:
> diff -bur gs-common-0.3.11/scripts/pdf2ps gs-common-0.3.12/scripts/pdf2ps
> --- gs-common-0.3.11/scripts/pdf2ps 2006-10-20 21:50:35.000000000 +0200
> +++ gs-common-0.3.12/scripts/pdf2ps 2007-05-22 09:49:31.000000000 +0200
> @@ -16,18 +16,24 @@
> shift
> done
>
> -if [ $# -eq 2 ]
> +if [ -t 1 ]
> then
> + if [ $# -eq 2 ]
> + then
> outfile=$2
> -elif [ $# -eq 1 ]
> -then
> + elif [ $# -eq 1 ]
> + then
> outfile=`basename "$1" \.pdf`.ps
> -else
> + else
> echo "Usage: `basename $0` [-dASCII85EncodePages=false]
> [-dLanguageLevel=1|2|3] input.pdf [output.ps]" 1>&2
> exit 1
> + fi
> + OUTFILE="-sOutputFile=$outfile"
> +else
> +OUTFILE="-sOutputFile=%stdout%"
> fi
>
> # Doing an initial 'save' helps keep fonts from being flushed between pages.
> # We have to include the options twice because -I only takes effect if it
> # appears before other options.
> -exec $GS_EXECUTABLE $OPTIONS -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pswrite
> "-sOutputFile=$outfile" $OPTIONS -c save pop -f "$1"
> +exec $GS_EXECUTABLE $OPTIONS -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pswrite
> $OPTIONS -c save pop -f "$1"
>
> ------------------------
>
> Why are you checking if fd 1 is a tty ([ -t 1 ]) ?
>
> I don't see the point, and the consequence is that when pdf2ps is executed
> without an attached tty, the "output file" argument is ignored, and the
> postscript file is outputted to stdout.
>
> This problem causes other packages to fail to build (e.g opensp, #423818), so
> it would be great if you could fix this ASAP.
>
> Thank you,
Hi,
With no answer from you on this bug since May, I intend to NMU this
package with the attached patch, reverting the changes you made to
pdf2ps in 0.3.12 and 0.3.13.
After thinking about it, I think that the behaviour you were seeking is:
- 2 params: output to $2
- 1 param, controlling tty: output to $1.pdf
- 1 param, no controlling tty:
means that output is probably redirected to a file, so output to
stdout.
However, this seems broken. A script might rely on the old behaviour
(output to $1.pdf), so the output would be lost. I would suggest
supporting '-' as a second parameter instead.
Note that the above discuss the behaviour I think you were seeking. The
actual current behaviour is:
- tty:
- 1 param: output to $1.pdf
- 2 params: output to $2
- no tty: always output to stdout, even if 2 params given, which is
totally broken.
Also, why is this package a native package?
Thank you,
--
| Lucas Nussbaum
| [EMAIL PROTECTED] http://www.lucas-nussbaum.net/ |
| jabber: [EMAIL PROTECTED] GPG: 1024D/023B3F4F |
diff -Nru /tmp/7pKfotGS5y/gs-common-0.3.13/debian/changelog /tmp/njuh2elxWq/gs-common-0.3.13/debian/changelog
--- /tmp/7pKfotGS5y/gs-common-0.3.13/debian/changelog 2007-05-07 17:14:17.000000000 +0200
+++ /tmp/njuh2elxWq/gs-common-0.3.13/debian/changelog 2007-08-28 09:49:35.000000000 +0200
@@ -1,3 +1,11 @@
+gs-common (0.3.13-0.1) unstable; urgency=low
+
+ * Non-maintainer upload.
+ * Reverted change in 0.3.13: no longer test if stdout is a tty. This
+ change causes packages to fail to build. Closes: #425505.
+
+ -- Lucas Nussbaum <[EMAIL PROTECTED]> Tue, 28 Aug 2007 09:48:34 +0200
+
gs-common (0.3.13) unstable; urgency=low
* Forgot to give $OUTFILE to gs in pdf2ps, fixed - closes: #422622
diff -Nru /tmp/7pKfotGS5y/gs-common-0.3.13/debian/patches/01_assorted_script_fixes.dpatch /tmp/njuh2elxWq/gs-common-0.3.13/debian/patches/01_assorted_script_fixes.dpatch
--- /tmp/7pKfotGS5y/gs-common-0.3.13/debian/patches/01_assorted_script_fixes.dpatch 2007-05-07 17:12:35.000000000 +0200
+++ /tmp/njuh2elxWq/gs-common-0.3.13/debian/patches/01_assorted_script_fixes.dpatch 2007-08-28 09:56:30.000000000 +0200
@@ -23,71 +23,58 @@
exit 0
@DPATCH@
-diff -urN gs-common-0.3.13.orig/scripts/afmdiff.awk gs-common-0.3.13/scripts/afmdiff.awk
---- gs-common-0.3.13.orig/scripts/afmdiff.awk 2007-05-08 00:11:15.000000000 +0900
-+++ gs-common-0.3.13/scripts/afmdiff.awk 2007-05-08 00:11:29.000000000 +0900
+diff -urNad gs-common-0.3.13~/scripts/afmdiff.awk gs-common-0.3.13/scripts/afmdiff.awk
+--- gs-common-0.3.13~/scripts/afmdiff.awk 2007-05-07 17:11:15.000000000 +0200
++++ gs-common-0.3.13/scripts/afmdiff.awk 2007-08-28 09:55:22.000000000 +0200
@@ -1,3 +1,4 @@
+#!/usr/bin/awk -f
###=====================================================================
### Read two Adobe Font Metric files, and compute tables of the
### differences in character repertoire, declared widths (WX), and
-diff -urN gs-common-0.3.13.orig/scripts/dumphint gs-common-0.3.13/scripts/dumphint
---- gs-common-0.3.13.orig/scripts/dumphint 2007-05-08 00:11:15.000000000 +0900
-+++ gs-common-0.3.13/scripts/dumphint 2007-05-08 00:11:29.000000000 +0900
+diff -urNad gs-common-0.3.13~/scripts/dumphint gs-common-0.3.13/scripts/dumphint
+--- gs-common-0.3.13~/scripts/dumphint 2007-05-07 17:11:15.000000000 +0200
++++ gs-common-0.3.13/scripts/dumphint 2007-08-28 09:55:22.000000000 +0200
@@ -22,4 +22,4 @@
exit 1
fi
-exec $GS_EXECUTABLE -q -dNODISPLAY $OPTIONS -- dumphint.ps "$1"
+exec $GS_EXECUTABLE -q -dNODISPLAY $OPTIONS -- /usr/share/gs-esp/8.15/lib/dumphint.ps "$1"
-diff -urN gs-common-0.3.13.orig/scripts/dvipdf gs-common-0.3.13/scripts/dvipdf
---- gs-common-0.3.13.orig/scripts/dvipdf 2007-05-08 00:11:15.000000000 +0900
-+++ gs-common-0.3.13/scripts/dvipdf 2007-05-08 00:11:29.000000000 +0900
+diff -urNad gs-common-0.3.13~/scripts/dvipdf gs-common-0.3.13/scripts/dvipdf
+--- gs-common-0.3.13~/scripts/dvipdf 2007-05-07 17:11:15.000000000 +0200
++++ gs-common-0.3.13/scripts/dvipdf 2007-08-28 09:55:22.000000000 +0200
@@ -42,4 +42,4 @@
# We have to include the options twice because -I only takes effect if it
# appears before other options.
-exec dvips -q -f "$infile" | $GS_EXECUTABLE $OPTIONS -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile="$outfile" $OPTIONS -c .setpdfwrite -
+exec dvips -Ppdf -q -f "$infile" | $GS_EXECUTABLE $OPTIONS -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile="$outfile" $OPTIONS -c .setpdfwrite -
-diff -urN gs-common-0.3.13.orig/scripts/pdf2ps gs-common-0.3.13/scripts/pdf2ps
---- gs-common-0.3.13.orig/scripts/pdf2ps 2007-05-08 00:11:15.000000000 +0900
-+++ gs-common-0.3.13/scripts/pdf2ps 2007-05-08 00:12:00.000000000 +0900
-@@ -16,18 +16,24 @@
+diff -urNad gs-common-0.3.13~/scripts/pdf2ps gs-common-0.3.13/scripts/pdf2ps
+--- gs-common-0.3.13~/scripts/pdf2ps 2007-05-07 17:11:15.000000000 +0200
++++ gs-common-0.3.13/scripts/pdf2ps 2007-08-28 09:56:15.000000000 +0200
+@@ -16,7 +16,7 @@
shift
done
-if [ $# -eq 2 ]
-+if [ -t 1 ]
++if [ $# -eq 2 ]
then
-- outfile=$2
--elif [ $# -eq 1 ]
--then
-- outfile=`basename "$1" \.pdf`.ps
-+ if [ $# -eq 2 ]
-+ then
-+ outfile=$2
-+ elif [ $# -eq 1 ]
-+ then
-+ outfile=`basename "$1" \.pdf`.ps
-+ else
-+ echo "Usage: `basename $0` [-dASCII85EncodePages=false] [-dLanguageLevel=1|2|3] input.pdf [output.ps]" 1>&2
-+ exit 1
-+ fi
-+ OUTFILE="-sOutputFile=$outfile"
- else
-- echo "Usage: `basename $0` [-dASCII85EncodePages=false] [-dLanguageLevel=1|2|3] input.pdf [output.ps]" 1>&2
-- exit 1
-+OUTFILE="-sOutputFile=%stdout%"
+ outfile=$2
+ elif [ $# -eq 1 ]
+@@ -26,8 +26,9 @@
+ echo "Usage: `basename $0` [-dASCII85EncodePages=false] [-dLanguageLevel=1|2|3] input.pdf [output.ps]" 1>&2
+ exit 1
fi
++OUTFILE="-sOutputFile=$outfile"
# Doing an initial 'save' helps keep fonts from being flushed between pages.
# We have to include the options twice because -I only takes effect if it
# appears before other options.
-exec $GS_EXECUTABLE $OPTIONS -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pswrite "-sOutputFile=$outfile" $OPTIONS -c save pop -f "$1"
+exec $GS_EXECUTABLE $OPTIONS -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pswrite $OUTFILE $OPTIONS -c save pop -f "$1"
-diff -urN gs-common-0.3.13.orig/scripts/ps2epsi gs-common-0.3.13/scripts/ps2epsi
---- gs-common-0.3.13.orig/scripts/ps2epsi 2007-05-08 00:11:15.000000000 +0900
-+++ gs-common-0.3.13/scripts/ps2epsi 2007-05-08 00:11:29.000000000 +0900
+diff -urNad gs-common-0.3.13~/scripts/ps2epsi gs-common-0.3.13/scripts/ps2epsi
+--- gs-common-0.3.13~/scripts/ps2epsi 2007-05-07 17:11:15.000000000 +0200
++++ gs-common-0.3.13/scripts/ps2epsi 2007-08-28 09:55:22.000000000 +0200
@@ -62,7 +62,7 @@
}
' U="$USERNAME$LOGNAME" F=1 - F=2 "${infile}" >$tmpfile
@@ -97,9 +84,9 @@
rm -f $tmpfile
rm -rf $tmpdir
-diff -urN gs-common-0.3.13.orig/scripts/pv.sh gs-common-0.3.13/scripts/pv.sh
---- gs-common-0.3.13.orig/scripts/pv.sh 2007-05-08 00:11:15.000000000 +0900
-+++ gs-common-0.3.13/scripts/pv.sh 2007-05-08 00:11:29.000000000 +0900
+diff -urNad gs-common-0.3.13~/scripts/pv.sh gs-common-0.3.13/scripts/pv.sh
+--- gs-common-0.3.13~/scripts/pv.sh 2007-05-07 17:11:15.000000000 +0200
++++ gs-common-0.3.13/scripts/pv.sh 2007-08-28 09:55:22.000000000 +0200
@@ -30,13 +30,13 @@
# executable name set in the makefile
GS_EXECUTABLE=gs