~ubuntu-branches/ubuntu/natty/foomatic-filters/natty

« back to all changes in this revision

Viewing changes to debian/patches/10_jcl-merge-fixes.patch

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2009-08-19 20:13:17 UTC
  • mfrom: (1.1.31 upstream)
  • Revision ID: james.westby@ubuntu.com-20090819201317-vcjm7b2jburausgy
Tags: 4.0.3-0ubuntu1
* New upstream release
   - Do PDF-to-PostScript conversion with Poppler, as Ghostscript produces
     huge files (Upstream bug #365).
   - Fixed LPRng support (Upstream bug #337).
   - Do not use JCL which is preceeded to the input data by a CUPS filter, as
     this does not get merged with the driver's JCL.
   - When merging the JCL from the PPD options with the JCL of the driver,
     make sure that no "@PJL SET ..." commands gets before a "@PJL JOB ..."
     command as such commands get ignored.
* debian/patches/10_jcl-merge-fixes.patch: Removed patch with upstream fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
diff -Nur -x '*.orig' -x '*~' foomatic-filters-4.0.2/ChangeLog foomatic-filters-4.0.2.new/ChangeLog
2
 
--- foomatic-filters-4.0.2/ChangeLog    2009-06-24 13:54:33.000000000 +0200
3
 
+++ foomatic-filters-4.0.2.new/ChangeLog        2009-07-13 11:27:59.000000000 +0200
4
 
@@ -1,3 +1,15 @@
5
 
+2009-07-01  Till Kamppeter <till.kamppeter@gmail.com>
6
 
+
7
 
+       * foomaticrip.c: Do not use JCL which is preceeded to the input
8
 
+         data. We can generate it on our own and even merge it with the JCL
9
 
+         coming from the driver.
10
 
+
11
 
+       * renderer.c: Make sure that "@PJL SET ..." commands from the PPD
12
 
+         file do not get nmerged into the driver's PJL header too early,
13
 
+         expecially not before "@PJL JOB ..." lines, as then the commands
14
 
+         get ignored. This happened especially with the "InputSlot"
15
 
+         option for the "cdnj500" driver.
16
 
+
17
 
 2009-06-24  Till Kamppeter <till.kamppeter@gmail.com>
18
 
 
19
 
        * Tagged branch for release 4.0.2.
20
 
diff -Nur -x '*.orig' -x '*~' foomatic-filters-4.0.2/foomaticrip.c foomatic-filters-4.0.2.new/foomaticrip.c
21
 
--- foomatic-filters-4.0.2/foomaticrip.c        2009-06-24 13:54:33.000000000 +0200
22
 
+++ foomatic-filters-4.0.2.new/foomaticrip.c    2009-07-13 11:28:00.000000000 +0200
23
 
@@ -965,10 +965,13 @@
24
 
     n = fread(buf, 1, sizeof(buf) - 1, file);
25
 
     buf[n] = '\0';
26
 
     type = guess_file_type(buf, n, &startpos);
27
 
-    if (startpos > 0) {
28
 
+    /* We do not use any JCL preceeded to the inputr data, as it is simply
29
 
+       the PJL commands from the PPD file, and these commands we can also
30
 
+       generate, end we even merge them with PJl from the driver */
31
 
+    /*if (startpos > 0) {
32
 
         jobhasjcl = 1;
33
 
         write_output(buf, startpos);
34
 
-    }
35
 
+    }*/
36
 
     if (file != stdin)
37
 
         rewind(file);
38
 
 
39
 
diff -Nur -x '*.orig' -x '*~' foomatic-filters-4.0.2/renderer.c foomatic-filters-4.0.2.new/renderer.c
40
 
--- foomatic-filters-4.0.2/renderer.c   2009-06-24 13:54:33.000000000 +0200
41
 
+++ foomatic-filters-4.0.2.new/renderer.c       2009-07-13 11:28:00.000000000 +0200
42
 
@@ -248,7 +248,7 @@
43
 
 {
44
 
     char *p = strstr(original_opts[0], jclstr);
45
 
     char header[128];
46
 
-    char **optsp;
47
 
+    char **optsp1 = NULL, **optsp2 = NULL;
48
 
 
49
 
     /* No JCL options in original_opts, just prepend opts */
50
 
     if (argv_count(original_opts) == 1)
51
 
@@ -284,18 +284,30 @@
52
 
     header[p - original_opts[0]] = '\0';
53
 
     fprintf(stream, "%s", header);
54
 
 
55
 
-    for (optsp = opts; *optsp; optsp++)
56
 
-        if (!jcl_options_find_keyword(original_opts, *optsp, jclstr))
57
 
-           fprintf(stream, "%s\n", *optsp);
58
 
-
59
 
-    for (optsp = original_opts; *(optsp + 1); optsp++) {
60
 
-        if (optsp != original_opts) p = *optsp;
61
 
+    /* Insert the JCL commands from the PPD file right before the first
62
 
+       "@PJL SET ..." line from the, if there are no "@PJL SET ..." lines,
63
 
+       directly before "@PJL ENTER LANGUAGE ...", otherwise after the JCL
64
 
+       commands from the driver */
65
 
+    for (optsp1 = original_opts; *(optsp1 + 1); optsp1++) {
66
 
+        if (optsp2 == NULL &&
67
 
+           ((strstr(*optsp1, "ENTER LANGUAGE") != NULL) ||
68
 
+            (strncasecmp(*optsp1, "@PJL SET ", 9) == 0))) {
69
 
+           for (optsp2 = opts; *optsp2; optsp2++)
70
 
+               if (!jcl_options_find_keyword(original_opts, *optsp2, jclstr))
71
 
+                   fprintf(stream, "%s\n", *optsp2);
72
 
+       }
73
 
+        if (optsp1 != original_opts) p = *optsp1;
74
 
         if (jcl_options_find_keyword(opts, p, jclstr))
75
 
          fprintf(stream, "%s\n", jcl_options_find_keyword(opts, p, jclstr));
76
 
        else
77
 
             fprintf(stream, "%s\n", p);
78
 
     }
79
 
-    write_binary_data(stream, *optsp, readbinarybytes);
80
 
+    if (optsp2 == NULL)
81
 
+        for (optsp2 = opts; *optsp2; optsp2++)
82
 
+            if (!jcl_options_find_keyword(original_opts, *optsp2, jclstr))
83
 
+               fprintf(stream, "%s\n", *optsp2);
84
 
+
85
 
+    write_binary_data(stream, *optsp1, readbinarybytes);
86
 
 
87
 
     return 1;
88
 
 }