1
diff -Nur -x '*.orig' -x '*~' foomatic-filters-4.0.4//ChangeLog foomatic-filters-4.0.4.new//ChangeLog
2
--- foomatic-filters-4.0.4//ChangeLog 2010-02-15 13:57:40.000000000 +0100
3
+++ foomatic-filters-4.0.4.new//ChangeLog 2010-06-08 17:19:38.201710562 +0200
5
+2010-06-08 Till Kamppeter <till.kamppeter@gmail.com>
7
+ * USAGE: Documentation correction.
9
+2010-06-07 Till Kamppeter <till.kamppeter@gmail.com>
11
+ * USAGE: Finally completed the documentation update to reflect that
12
+ the Ghostscript library is not needed any more.
14
+ * foomaticrip.c, foomaticrip.h, pdf.c: Let foomatic-rip actually
15
+ error out if something goes wrong. It simply continued or closed
16
+ silently (exit status 0) on the following events: Failure of
17
+ print_file() function call, failure of Ghostscript to determine
18
+ the number of pages of a PDF input file (causes Ubuntu bug
19
+ #570522), failure to start Ghostscript to render a PDF file,
20
+ failure to create a temporary file for extracting selected pages
21
+ from a PDF file, failure to run Ghostscript to extract pages from
22
+ a PDF file, page count result being a negative number.
24
+ * foomaticrip.c: Use EXIT_PRINTED constant and not hard-coded "0"
25
+ as exit value when terminating successfully.
27
+ * foomaticrip.h: Correct definition of EXIT_STARVED constant.
29
+2010-03-26 Till Kamppeter <till.kamppeter@gmail.com>
31
+ * options.c, options.h: Made some strings longer, to avoid space
34
2010-02-15 Till Kamppeter <till.kamppeter@gmail.com>
36
* Tagged branch for release 4.0.4.
37
diff -Nur -x '*.orig' -x '*~' foomatic-filters-4.0.4//foomaticrip.c foomatic-filters-4.0.4.new//foomaticrip.c
38
--- foomatic-filters-4.0.4//foomaticrip.c 2010-02-15 13:57:40.000000000 +0100
39
+++ foomatic-filters-4.0.4.new//foomaticrip.c 2010-06-08 17:19:38.201710562 +0200
41
PostScript file (all before the first page begins). */
42
optionset_copy_values(optionset("userval"), optionset("header"));
44
- print_file(filename, 1);
45
+ if (!print_file(filename, 1))
46
+ rip_die(EXIT_PRNERR_NORETRY, "Could not print file %s\n", filename);
47
filename = strtok_r(NULL, " ", &p);
55
+ return EXIT_PRINTED;
58
diff -Nur -x '*.orig' -x '*~' foomatic-filters-4.0.4//foomaticrip.h foomatic-filters-4.0.4.new//foomaticrip.h
59
--- foomatic-filters-4.0.4//foomaticrip.h 2010-02-15 13:57:40.000000000 +0100
60
+++ foomatic-filters-4.0.4.new//foomaticrip.h 2010-06-08 17:19:38.201710562 +0200
62
#define EXIT_JOBERR 3 /* job is defective */
63
#define EXIT_SIGNAL 4 /* terminated after catching signal */
64
#define EXIT_ENGAGED 5 /* printer is otherwise engaged (connection refused) */
65
-#define EXIT_STARVED = 6; /* starved for system resources */
66
+#define EXIT_STARVED 6 /* starved for system resources */
67
#define EXIT_PRNERR_NORETRY_ACCESS_DENIED 7 /* bad password? bad port permissions? */
68
#define EXIT_PRNERR_NOT_RESPONDING 8 /* just doesn't answer at all (turned off?) */
69
#define EXIT_PRNERR_NORETRY_BAD_SETTINGS 9 /* interface settings are invalid */
70
diff -Nur -x '*.orig' -x '*~' foomatic-filters-4.0.4//options.c foomatic-filters-4.0.4.new//options.c
71
--- foomatic-filters-4.0.4//options.c 2010-02-15 13:57:40.000000000 +0100
72
+++ foomatic-filters-4.0.4.new//options.c 2010-06-08 17:19:38.211630380 +0200
75
/* Values from foomatic keywords in the ppd file */
76
char printer_model [256];
77
-char printer_id [128];
78
+char printer_id [256];
84
dstr_t *postpipe = NULL; /* command into which the output of this
85
filter should be piped */
86
int ps_accounting = 1;
89
choice_t *choice = option_find_choice(opt, "Custom");
90
char ** paramvalues = paramvalues_from_string(opt, values);
91
- char width[30], height[20];
92
+ char width[30], height[30];
99
if (!startswith(code, "%% FoomaticRIPOptionSetting"))
100
- unhtmlify(choice->command, 1024, code);
101
+ unhtmlify(choice->command, 65536, code);
105
@@ -1529,10 +1529,10 @@
106
unhtmlify(postpipe->data, postpipe->alloc, value->data);
108
else if (strcmp(key, "FoomaticRIPCommandLine") == 0) {
109
- unhtmlify(cmd, 1024, value->data);
110
+ unhtmlify(cmd, 4096, value->data);
112
else if (strcmp(key, "FoomaticRIPCommandLinePDF") == 0) {
113
- unhtmlify(cmd_pdf, 1024, value->data);
114
+ unhtmlify(cmd_pdf, 4096, value->data);
116
else if (strcmp(key, "FoomaticRIPNoPageAccounting") == 0) {
118
@@ -1742,7 +1742,7 @@
120
if (startswith(cmd, "gs"))
122
- strncpy(cmd_pdf, cmd, 1024);
123
+ strncpy(cmd_pdf, cmd, 4096);
127
diff -Nur -x '*.orig' -x '*~' foomatic-filters-4.0.4//options.h foomatic-filters-4.0.4.new//options.h
128
--- foomatic-filters-4.0.4//options.h 2010-02-15 13:57:40.000000000 +0100
129
+++ foomatic-filters-4.0.4.new//options.h 2010-06-08 17:19:38.211630380 +0200
131
typedef struct choice_s {
134
- char command[1024];
135
+ char command[65536];
136
struct choice_s *next;
140
extern char jclend[256];
141
extern char jclprefix[256];
143
-extern char cmd[1024];
144
-extern char cmd_pdf[1024];
145
+extern char cmd[4096];
146
+extern char cmd_pdf[4096];
148
extern int ps_accounting;
150
diff -Nur -x '*.orig' -x '*~' foomatic-filters-4.0.4//pdf.c foomatic-filters-4.0.4.new//pdf.c
151
--- foomatic-filters-4.0.4//pdf.c 2010-02-15 13:57:40.000000000 +0100
152
+++ foomatic-filters-4.0.4.new//pdf.c 2010-06-08 17:19:38.211630380 +0200
156
FILE *pd = popen(gscommand, "r");
158
- _log("Failed to execute ghostscript to determine number of input pages!\n");
162
+ rip_die(EXIT_STARVED, "Failed to execute ghostscript to determine number of input pages!\n");
164
fread(output, 1, 31, pd);
167
_log("Starting renderer with command: %s\n", cmd);
168
kid3 = start_process("kid3", exec_kid3, (void *)cmd, NULL, NULL);
171
+ rip_die(EXIT_STARVED, "Could not start renderer\n");
176
snprintf(filename, PATH_MAX, "%s/foomatic-XXXXXX", temp_dir());
180
+ rip_die(EXIT_STARVED, "Unable to create temporary file!\n");
182
snprintf(filename_arg, PATH_MAX, "-sOutputFile=%s", filename);
183
snprintf(first_arg, 50, "-dFirstPage=%d", first);
185
gspath, filename_arg, first_arg, last_arg, pdffilename);
187
FILE *pd = popen(gscommand, "r");
189
- _log("Could not run ghostscript to extract the pages!\n");
193
+ rip_die(EXIT_STARVED, "Could not run ghostscript to extract the pages!\n");
200
if (!pdf_extract_pages(tmpfile, filename, firstpage, lastpage))
202
+ rip_die(EXIT_STARVED, "Could not run ghostscript to extract the pages!\n");
203
dstrcatf(cmd, " < %s", tmpfile);
207
page_count = pdf_count_pages(filename);
211
+ rip_die(EXIT_JOBERR, "Unable to determine number of pages, page count: %d\n", page_count);
212
_log("File contains %d pages\n", page_count);
214
optionset_copy_values(optionset("header"), optionset("currentpage"));
215
diff -Nur -x '*.orig' -x '*~' foomatic-filters-4.0.4//USAGE foomatic-filters-4.0.4.new//USAGE
216
--- foomatic-filters-4.0.4//USAGE 2010-02-15 13:57:40.000000000 +0100
217
+++ foomatic-filters-4.0.4.new//USAGE 2010-06-08 17:19:38.201710562 +0200
219
Foomatic runs on all systems where one can run the Perl
220
interpreter and Ghostscript.
222
-foomatic-filters needs the Ghostscript library for foomatic-rip and
223
-the Perl interpreter for beh (Backend Error Handler) and the test
225
+foomatic-filters needs the Perl interpreter for beh (Backend Error
226
+Handler) and the test suite.
228
To build foomatic-rip you need a C compiler and its standard libraries.
233
The "configure" script will auto-detect where the programs have to be
234
-installed and where the Perl interpreter and the Ghostscript library
235
-are located. If "configure" fails because of something not being
237
+installed and where the Perl interpreter is located. If "configure"
238
+fails because of something not being installed, do
240
rm -rf config.cache autom*.cache