From 55bdfab05e0e51f084f59a6c77ed1833741fefe5 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Mon, 1 Aug 2011 15:13:52 +0100 Subject: [PATCH] Fixed error reporting in the gstoraster filter. --- ghostscript-gstoraster-errors.patch | 107 ++++++++++++++++++++++++++++ ghostscript.spec | 9 ++- 2 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 ghostscript-gstoraster-errors.patch diff --git a/ghostscript-gstoraster-errors.patch b/ghostscript-gstoraster-errors.patch new file mode 100644 index 0000000..10e6685 --- /dev/null +++ b/ghostscript-gstoraster-errors.patch @@ -0,0 +1,107 @@ +diff -up ghostscript-9.04rc1/cups/gdevcups.c.gstoraster-errors ghostscript-9.04rc1/cups/gdevcups.c +diff -up ghostscript-9.04rc1/cups/gstoraster.c.gstoraster-errors ghostscript-9.04rc1/cups/gstoraster.c +--- ghostscript-9.04rc1/cups/gstoraster.c.gstoraster-errors 2011-08-01 15:10:36.850534567 +0100 ++++ ghostscript-9.04rc1/cups/gstoraster.c 2011-08-01 15:11:21.215732758 +0100 +@@ -381,7 +381,7 @@ gs_spawn (const char *filename, + { + fds[0] = -1; + fds[1] = -1; +- fprintf(stderr, "ERROR: Unable to establish pipe for Ghostscript call"); ++ fprintf(stderr, "ERROR: Unable to establish pipe for Ghostscript call\n"); + goto out; + } + +@@ -392,14 +392,14 @@ gs_spawn (const char *filename, + close(fds[1]); + fds[0] = -1; + fds[1] = -1; +- fprintf(stderr, "ERROR: Unable to set \"close on exec\" flag on read end of the pipe for Ghostscript call"); ++ fprintf(stderr, "ERROR: Unable to set \"close on exec\" flag on read end of the pipe for Ghostscript call\n"); + goto out; + } + if (fcntl(fds[1], F_SETFD, fcntl(fds[1], F_GETFD) | FD_CLOEXEC)) + { + close(fds[0]); + close(fds[1]); +- fprintf(stderr, "ERROR: Unable to set \"close on exec\" flag on write end of the pipe for Ghostscript call"); ++ fprintf(stderr, "ERROR: Unable to set \"close on exec\" flag on write end of the pipe for Ghostscript call\n"); + goto out; + } + +@@ -411,7 +411,7 @@ gs_spawn (const char *filename, + if (fds[0] > 0) + dup(fds[0]); + else { +- fprintf(stderr, "ERROR: Unable to couple pipe with STDIN of Ghostscript process"); ++ fprintf(stderr, "ERROR: Unable to couple pipe with STDIN of Ghostscript process\n"); + goto out; + } + } +@@ -425,7 +425,7 @@ gs_spawn (const char *filename, + /* Feed job data into Ghostscript */ + while ((n = fread(buf, 1, BUFSIZ, fp)) > 0) { + if (write(fds[1], buf, n) != n) { +- fprintf(stderr, "ERROR: Can't feed job data into Ghostscript"); ++ fprintf(stderr, "ERROR: Can't feed job data into Ghostscript\n"); + goto out; + } + } +@@ -542,7 +542,7 @@ main (int argc, char **argv, char *envp[ + + t = getenv("PPD"); + if ((ppd = ppdOpenFile(t)) == NULL) { +- fprintf(stderr, "ERROR: Failed to open PPD: %s", t); ++ fprintf(stderr, "ERROR: Failed to open PPD: %s\n", t); + goto out; + } + +@@ -554,7 +554,7 @@ main (int argc, char **argv, char *envp[ + + fd = cupsTempFd(buf,BUFSIZ); + if (fd < 0) { +- fprintf(stderr, "ERROR: Can't create temporary file"); ++ fprintf(stderr, "ERROR: Can't create temporary file\n"); + goto out; + } + /* remove name */ +@@ -563,19 +563,19 @@ main (int argc, char **argv, char *envp[ + /* copy stdin to the tmp file */ + while ((n = read(0,buf,BUFSIZ)) > 0) { + if (write(fd,buf,n) != n) { +- fprintf(stderr, "ERROR: Can't copy stdin to temporary file"); ++ fprintf(stderr, "ERROR: Can't copy stdin to temporary file\n"); + close(fd); + goto out; + } + } + if (lseek(fd,0,SEEK_SET) < 0) { +- fprintf(stderr, "ERROR: Can't rewind temporary file"); ++ fprintf(stderr, "ERROR: Can't rewind temporary file\n"); + close(fd); + goto out; + } + + if ((fp = fdopen(fd,"rb")) == 0) { +- fprintf(stderr, "ERROR: Can't fdopen temporary file"); ++ fprintf(stderr, "ERROR: Can't fdopen temporary file\n"); + close(fd); + goto out; + } +@@ -583,7 +583,7 @@ main (int argc, char **argv, char *envp[ + /* argc == 7 filename is specified */ + + if ((fp = fopen(argv[6],"rb")) == 0) { +- fprintf(stderr, "ERROR: Can't open input file %s",argv[6]); ++ fprintf(stderr, "ERROR: Can't open input file %s\n",argv[6]); + goto out; + } + } +@@ -591,7 +591,7 @@ main (int argc, char **argv, char *envp[ + /* find out file type */ + doc_type = parse_doc_type(fp); + if (doc_type == GS_DOC_TYPE_UNKNOWN) { +- fprintf(stderr, "ERROR: Can't detect file type"); ++ fprintf(stderr, "ERROR: Can't detect file type\n"); + goto out; + } + diff --git a/ghostscript.spec b/ghostscript.spec index 841bb49..63df18e 100644 --- a/ghostscript.spec +++ b/ghostscript.spec @@ -5,7 +5,7 @@ Summary: A PostScript interpreter and renderer Name: ghostscript Version: %{gs_ver} -Release: 4%{?dist} +Release: 5%{?dist} # Included CMap data is Redistributable, no modification permitted, # see http://bugzilla.redhat.com/487510 @@ -31,6 +31,7 @@ Patch27: ghostscript-Fontmap.local.patch Patch28: ghostscript-iccprofiles-initdir.patch Patch29: ghostscript-gdevcups-debug-uninit.patch Patch30: ghostscript-pxl-landscape.patch +Patch31: ghostscript-gstoraster-errors.patch Requires: urw-fonts >= 1.1, ghostscript-fonts Requires: poppler-data @@ -157,6 +158,9 @@ rm -rf libpng zlib jpeg jasper expat # pxl: match landscape page sizes (bug #692165). %patch30 -p1 -b .pxl-landscape +# Fixed error reporting in the gstoraster filter. +%patch31 -p1 -b .gstoraster-errors + # Convert manual pages to UTF-8 from8859_1() { iconv -f iso-8859-1 -t utf-8 < "$1" > "${1}_" @@ -349,6 +353,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/libgs.so %changelog +* Mon Aug 1 2011 Tim Waugh 9.02-5 +- Fixed error reporting in the gstoraster filter. + * Wed May 25 2011 Tim Waugh 9.02-4 - colord is optional (bug #706619).