rpms/cups/devel cups-pstops.patch,1.1,1.2 cups.spec,1.157,1.158

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Fri Apr 7 15:34:56 UTC 2006


Author: twaugh

Update of /cvs/dist/rpms/cups/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv19056

Modified Files:
	cups-pstops.patch cups.spec 
Log Message:
- Sync pstops.c with svn 5382.

cups-pstops.patch:
 pstops.c |  202 +++++++++++++++++++++++++++++++++++++--------------------------
 1 files changed, 121 insertions(+), 81 deletions(-)

Index: cups-pstops.patch
===================================================================
RCS file: /cvs/dist/rpms/cups/devel/cups-pstops.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- cups-pstops.patch	6 Apr 2006 14:14:33 -0000	1.1
+++ cups-pstops.patch	7 Apr 2006 15:34:42 -0000	1.2
@@ -1,5 +1,5 @@
---- cups-1.2rc1/filter/pstops.c.pstops	2006-03-23 19:33:35.000000000 +0000
-+++ cups-1.2rc1/filter/pstops.c	2006-04-06 15:11:02.000000000 +0100
+--- cups-1.2rc1//home/tim/devel/pkgs/cups/devel/cups-1.2rc1/filter/pstops.c	2006-03-23 19:33:35.000000000 +0000
++++ cups-1.2rc1/filter/pstops.c	2006-04-07 16:05:46.000000000 +0100
 @@ -1,5 +1,5 @@
  /*
 - * "$Id$"
@@ -7,7 +7,15 @@
   *
   *   PostScript filter for the Common UNIX Printing System (CUPS).
   *
-@@ -307,10 +307,13 @@
+@@ -56,6 +56,7 @@
+  */
+ 
+ #include "common.h"
++#include <limits.h>
+ #include <math.h>
+ #include <cups/file.h>
+ #include <cups/array.h>
+@@ -307,10 +308,13 @@
  
      fputs("DEBUG: Skipping PJL header...\n", stderr);
  
@@ -22,7 +30,22 @@
      if ((len = cupsFileGetLine(fp, line, sizeof(line))) == 0)
        break;
    }
-@@ -590,6 +593,12 @@
+@@ -434,12 +438,10 @@
+     * See if we only print even or odd pages...
+     */
+ 
+-    if (!strcasecmp(doc->page_set, "even") &&
+-        ((page - 1) % (doc->number_up << 1)) < doc->number_up)
++    if (!strcasecmp(doc->page_set, "even") && (page & 1))
+       return (0);
+ 
+-    if (!strcasecmp(doc->page_set, "odd") &&
+-        ((page - 1) % (doc->number_up << 1)) >= doc->number_up)
++    if (!strcasecmp(doc->page_set, "odd") && !(page & 1))
+       return (0);
+   }
+ 
+@@ -590,6 +592,12 @@
      {
        if (saw_bounding_box)
          fputs("ERROR: Duplicate %%BoundingBox: comment seen!\n", stderr);
@@ -35,7 +58,7 @@
        else if (sscanf(line + 14, "%d%d%d%d", doc->bounding_box + 0,
  	              doc->bounding_box + 1, doc->bounding_box + 2,
  		      doc->bounding_box + 3) != 4)
-@@ -738,14 +747,26 @@
+@@ -738,14 +746,26 @@
    */
  
    fprintf(stderr, "DEBUG: Before copy_prolog - %s", line);
@@ -64,7 +87,12 @@
  
   /*
    * Then process pages until we have no more...
-@@ -778,9 +799,9 @@
+@@ -774,13 +794,13 @@
+   * Finish up the last page(s)...
+   */
+ 
+-  if (number && is_not_last_page(number))
++  if (number && is_not_last_page(number) && cupsArrayLast(doc->pages))
    {
      pageinfo = (pstops_page_t *)cupsArrayLast(doc->pages);
  
@@ -76,7 +104,7 @@
  
      pageinfo->length = cupsFileTell(doc->temp) - pageinfo->offset;
    }
-@@ -802,9 +823,9 @@
+@@ -802,9 +822,9 @@
        printf("%%%%Page: (filler) %d\n", doc->page);
      }
  
@@ -88,7 +116,191 @@
  
      pageinfo->length = cupsFileTell(doc->temp) - pageinfo->offset;
    }
-@@ -1368,7 +1389,7 @@
+@@ -1265,98 +1285,118 @@
+   * Copy any page setup commands...
+   */
+ 
+-  if (!strncmp(line, "%%BeginPageSetup", 16))
++  if (first_page)
+   {
+-   /*
+-    * Copy page setup commands...
+-    */
+-
+-    doc_write(doc, line, linelen);
++    doc_puts(doc, "%%BeginPageSetup\n");
+ 
+-    while ((linelen = cupsFileGetLine(fp, line, linesize)) > 0)
++    if (pageinfo->num_options > 0)
+     {
+-      if (!strncmp(line, "%%EndPageSetup", 14))
+-        break;
+-      else if (!strncmp(line, "%%Include", 9))
+-        continue;
++      int		i;		/* Looping var */
++      ppd_option_t	*option;	/* PPD option */
++      int		min_order;	/* Minimum OrderDependency value */
++      char		*doc_setup,	/* DocumentSetup commands to send */
++			*any_setup;	/* AnySetup commands to send */
+ 
+-      if (doc->number_up == 1 && !doc->fitplot)
+-	doc_write(doc, line, linelen);
+-    }
+ 
+-   /*
+-    * Skip %%EndPageSetup...
+-    */
++     /*
++      * Yes, figure out the minimum OrderDependency value...
++      */
+ 
+-    if (linelen > 0)
+-      linelen = cupsFileGetLine(fp, line, linesize);
++      if ((option = ppdFindOption(ppd, "PageRegion")) != NULL)
++	min_order = option->order;
++      else
++	min_order = 999.0f;
+ 
+-    if (pageinfo->num_options == 0)
+-      doc_puts(doc, "%%EndPageSetup\n");
+-  }
+-  else if (first_page && pageinfo->num_options > 0)
+-    doc_puts(doc, "%%BeginPageSetup\n");
++      for (i = 0; i < pageinfo->num_options; i ++)
++	if ((option = ppdFindOption(ppd, pageinfo->options[i].name)) != NULL &&
++            option->order < min_order)
++          min_order = option->order;
+ 
+-  if (first_page && pageinfo->num_options > 0)
+-  {
+-    int		i;			/* Looping var */
+-    ppd_option_t *option;		/* PPD option */
+-    int		min_order;		/* Minimum OrderDependency value */
+-    char	*doc_setup,		/* DocumentSetup commands to send */
+-		*any_setup;		/* AnySetup commands to send */
++     /*
++      * Mark and extract them...
++      */
+ 
++      cupsMarkOptions(ppd, pageinfo->num_options, pageinfo->options);
+ 
+-   /*
+-    * Yes, figure out the minimum OrderDependency value...
+-    */
++      doc_setup = ppdEmitString(ppd, PPD_ORDER_DOCUMENT, min_order);
++      any_setup = ppdEmitString(ppd, PPD_ORDER_ANY, min_order);
+ 
+-    if ((option = ppdFindOption(ppd, "PageRegion")) != NULL)
+-      min_order = option->order;
+-    else
+-      min_order = 999.0f;
++     /*
++      * Then send them out...
++      */
+ 
+-    for (i = 0; i < pageinfo->num_options; i ++)
+-      if ((option = ppdFindOption(ppd, pageinfo->options[i].name)) != NULL &&
+-          option->order < min_order)
+-        min_order = option->order;
++      if (doc_setup)
++	doc_puts(doc, doc_setup);
+ 
+-   /*
+-    * Mark and extract them...
+-    */
++      if (any_setup)
++	doc_puts(doc, any_setup);
+ 
+-    cupsMarkOptions(ppd, pageinfo->num_options, pageinfo->options);
++     /*
++      * Free the command strings...
++      */
+ 
+-    doc_setup = ppdEmitString(ppd, PPD_ORDER_DOCUMENT, min_order);
+-    any_setup = ppdEmitString(ppd, PPD_ORDER_ANY, min_order);
++      if (doc_setup)
++	free(doc_setup);
+ 
+-   /*
+-    * Then send them out...
+-    */
++      if (any_setup)
++	free(any_setup);
++    }
++  }
+ 
+-    if (doc_setup)
+-      doc_puts(doc, doc_setup);
++ /*
++  * Prep for the start of the page description...
++  */
+ 
+-    if (any_setup)
+-      doc_puts(doc, any_setup);
++  start_nup(doc, number, 1, bounding_box);
+ 
+-   /*
+-    * Free the command strings...
+-    */
++ /*
++  * Copy page setup commands as needed...
++  */
+ 
+-    if (doc_setup)
+-      free(doc_setup);
++  if (!strncmp(line, "%%BeginPageSetup", 16))
++  {
++    int	feature = 0;			/* In a Begin/EndFeature block? */
+ 
+-    if (any_setup)
+-      free(any_setup);
+ 
+-    doc_puts(doc, "%%EndPageSetup\n");
++    while ((linelen = cupsFileGetLine(fp, line, linesize)) > 0)
++    {
++      if (!strncmp(line, "%%EndPageSetup", 14))
++        break;
++      else if (!strncmp(line, "%%BeginFeature:", 15))
++      {
++        feature = 1;
++
++	if (doc->number_up > 1 || doc->fitplot)
++	  continue;
++      }
++      else if (!strncmp(line, "%%EndFeature:", 13))
++      {
++        feature = 0;
++
++	if (doc->number_up > 1 || doc->fitplot)
++	  continue;
++      }
++      else if (!strncmp(line, "%%Include", 9))
++        continue;
++
++      if (!feature || (doc->number_up == 1 && !doc->fitplot))
++	doc_write(doc, line, linelen);
++    }
++
++   /*
++    * Skip %%EndPageSetup...
++    */
++
++    if (linelen > 0)
++      linelen = cupsFileGetLine(fp, line, linesize);
+   }
+ 
+  /*
+-  * Prep for the start of the page description...
++  * Finish the PageSetup section as needed...
+   */
+ 
+-  start_nup(doc, number, 1, bounding_box);
++  if (first_page)
++    doc_puts(doc, "%%EndPageSetup\n");
+ 
+  /*
+   * Read the rest of the page description...
+@@ -1368,7 +1408,7 @@
    {
      if (level == 0 &&
          (!strncmp(line, "%%Page:", 7) ||
@@ -97,7 +309,7 @@
  	 !strncmp(line, "%%EOF", 5)))
        break;
      else if (!strncmp(line, "%%BeginDocument", 15) ||
-@@ -2400,7 +2421,7 @@
+@@ -2400,7 +2440,7 @@
    while ((linelen = cupsFileGetLine(fp, line, linesize)) > 0)
    {
      if (level == 0 &&
@@ -106,7 +318,7 @@
        break;
      else if (!strncmp(line, "%%BeginDocument", 15) ||
  	     !strncmp(line, "%ADO_BeginApplication", 21))
-@@ -2870,5 +2891,5 @@
+@@ -2870,5 +2910,5 @@
  
  
  /*


Index: cups.spec
===================================================================
RCS file: /cvs/dist/rpms/cups/devel/cups.spec,v
retrieving revision 1.157
retrieving revision 1.158
diff -u -r1.157 -r1.158
--- cups.spec	7 Apr 2006 15:21:02 -0000	1.157
+++ cups.spec	7 Apr 2006 15:34:43 -0000	1.158
@@ -392,6 +392,7 @@
 - Build with LDAP_DEPRECATED=1, to pick up declarations of ldap_init() etc.
 - Only warn about ACLs once (STR #1532).
 - Fix imagetops filter (STR #1533).
+- Sync pstops.c with svn 5382.
 
 * Thu Apr  6 2006 Tim Waugh <twaugh at redhat.com> 1:1.2-0.2.rc1.7
 - Build requires openldap-devel.




More information about the fedora-cvs-commits mailing list