aboutsummaryrefslogtreecommitdiffstats
path: root/graphics/peps
diff options
context:
space:
mode:
authorjkoshy <jkoshy@FreeBSD.org>2003-06-17 09:31:54 +0800
committerjkoshy <jkoshy@FreeBSD.org>2003-06-17 09:31:54 +0800
commit195ae78ee19b074c559efbbf68535f4b5bf211f6 (patch)
tree2e440a5e7b42fa8da4e5f03723cd79fd51d90f85 /graphics/peps
parent7a25fecb9d92bf0c7b3f4fa543ac5e671db58e1f (diff)
downloadfreebsd-ports-graphics-195ae78ee19b074c559efbbf68535f4b5bf211f6.tar.gz
freebsd-ports-graphics-195ae78ee19b074c559efbbf68535f4b5bf211f6.tar.zst
freebsd-ports-graphics-195ae78ee19b074c559efbbf68535f4b5bf211f6.zip
Add a patch that makes PEPS check the exit status of the 'gs' pipeline
that it invokes. This allows a faulty EPS file to stop a documentation build rather than silently produce corrupted images. Bump PORTREVISION. Approved by: petef [MAINTAINER]
Diffstat (limited to 'graphics/peps')
-rw-r--r--graphics/peps/Makefile1
-rw-r--r--graphics/peps/files/patch-peps.c37
2 files changed, 38 insertions, 0 deletions
diff --git a/graphics/peps/Makefile b/graphics/peps/Makefile
index d73f4ff30ac..21b6a7d2a34 100644
--- a/graphics/peps/Makefile
+++ b/graphics/peps/Makefile
@@ -7,6 +7,7 @@
PORTNAME= peps
PORTVERSION= 1.0
+PORTREVISION= 1
CATEGORIES= graphics
MASTER_SITES= ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR= petef
diff --git a/graphics/peps/files/patch-peps.c b/graphics/peps/files/patch-peps.c
new file mode 100644
index 00000000000..93e23e2a9f5
--- /dev/null
+++ b/graphics/peps/files/patch-peps.c
@@ -0,0 +1,37 @@
+--- peps.c- Thu Jul 5 05:29:56 2001
++++ peps.c Mon Jun 16 15:13:13 2003
+@@ -62,6 +62,7 @@
+ */
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <sys/wait.h>
+
+ char gsargs[] = "gs "
+ "-q "
+@@ -181,7 +182,8 @@
+ }
+
+ int main(int argc, char *argv[]) {
+- register int i;
++ register int i;
++ int status, error;
+ register char *charptr;
+ FILE *gs, *eps;
+
+@@ -420,8 +422,14 @@
+ input, input
+ );
+
+- pclose(gs);
++ status = pclose(gs);
+
+- return 0;
++ error = !WIFEXITED(status) || WEXITSTATUS(status);
++
++ if (error && output)
++ (void) remove(output);
++
++ exit(error);
++
+ }
+