Your message dated Sun, 08 Jun 2008 15:47:09 +0000
with message-id <[EMAIL PROTECTED]>
and subject line Bug#368331: fixed in psutils 1.17-25
has caused the Debian Bug report #368331,
regarding [PATCH] remove paper size information and BoundingBoxes in psnup and 
psresize
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [EMAIL PROTECTED]
immediately.)


-- 
368331: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=368331
Debian Bug Tracking System
Contact [EMAIL PROTECTED] with problems
--- Begin Message ---
Package: psutils
Version: 1.17-21
Severity: wishlist
Tags: patch

Please consider adding the following patch, which removes any
BoundingBox, HiResBoundingBox, DocumentPaperSizes and DocumentMedia
headers from the file generated from psresize and psnup.

As psresize and psnup change the paper size to something only by pure
coincidence being the same as before, no information about the paper
size in the generated file is much better than something false most of
the time.

(Ideally it would generate new headers and parse the old ones as default
values for -W and -H, but that would be a bit bigger patch...)

Hochachtungsvoll,
        Bernhard R. Link
Index: psutils-1.17/psutil.c
===================================================================
--- psutils-1.17.orig/psutil.c  2006-05-21 11:52:47.792709688 +0200
+++ psutils-1.17/psutil.c       2006-05-21 12:57:17.200891997 +0200
@@ -137,11 +137,28 @@
 }
 
 
-/* copy input file from current position upto new position to output file */
-static int fcopy(long upto)
+/* copy input file from current position upto new position to output file,
+ * ignoring the lines starting at something ignorelist points to */
+static int fcopy(long upto, long *ignorelist)
 {
   long here = ftell(infile);
-  long bytes_left = upto - here;
+  long bytes_left;
+
+  if (ignorelist != NULL) {
+    while (*ignorelist > 0 && *ignorelist < here)
+      ignorelist++;
+
+    while (*ignorelist > 0 && *ignorelist < upto) {
+      int r = fcopy(*ignorelist, NULL);
+      if (!r || fgets(buffer, BUFSIZ, infile) == NULL)
+       return 0;
+      ignorelist++;
+      here = ftell(infile);
+      while (*ignorelist > 0 && *ignorelist < here)
+       ignorelist++;
+    }
+  }
+  bytes_left = upto - here;
 
   while (bytes_left > 0) {
     size_t rw_result;
@@ -157,12 +174,15 @@
 }
 
 /* build array of pointers to start/end of pages */
-void scanpages(void)
+void scanpages(long *sizeheaders)
 {
    register char *comment = buffer+2;
    register int nesting = 0;
    register long int record;
 
+   if (sizeheaders)
+     *sizeheaders = 0;
+
    if ((pageptr = (long *)malloc(sizeof(long)*maxpages)) == NULL)
       message(FATAL, "out of memory\n");
    pages = 0;
@@ -178,6 +198,26 @@
                     message(FATAL, "out of memory\n");
               }
               pageptr[pages++] = record;
+           } else if (headerpos == 0 && iscomment(comment, "BoundingBox:")) {
+              if (sizeheaders) {
+                 *(sizeheaders++) = record;
+                 *sizeheaders = 0;
+              }
+           } else if (headerpos == 0 && iscomment(comment, 
"HiResBoundingBox:")) {
+              if (sizeheaders) {
+                 *(sizeheaders++) = record;
+                 *sizeheaders = 0;
+              }
+           } else if (headerpos == 0 && 
iscomment(comment,"DocumentPaperSizes:")) {
+              if (sizeheaders) {
+                 *(sizeheaders++) = record;
+                 *sizeheaders = 0;
+              }
+           } else if (headerpos == 0 && iscomment(comment,"DocumentMedia:")) {
+              if (sizeheaders) {
+                 *(sizeheaders++) = record;
+                 *sizeheaders = 0;
+              }
            } else if (headerpos == 0 && iscomment(comment, "Pages:"))
               pagescmt = record;
            else if (headerpos == 0 && iscomment(comment, "EndComments"))
@@ -281,7 +321,7 @@
 /* write the body of a page */
 void writepagebody(int p)
 {
-   if (!fcopy(pageptr[p+1]))
+   if (!fcopy(pageptr[p+1], NULL))
       message(FATAL, "I/O error writing page %d\n", outputpage);
 }
 
@@ -294,23 +334,23 @@
 }
 
 /* write from start of file to end of header comments */
-void writeheader(int p)
+void writeheader(int p, long *ignore)
 {
    fseek(infile, 0L, SEEK_SET);
    if (pagescmt) {
-      if (!fcopy(pagescmt) || fgets(buffer, BUFSIZ, infile) == NULL)
+      if (!fcopy(pagescmt, ignore) || fgets(buffer, BUFSIZ, infile) == NULL)
         message(FATAL, "I/O error in header\n");
       sprintf(buffer, "%%%%Pages: %d 0\n", p);
       writestring(buffer);
    }
-   if (!fcopy(headerpos))
+   if (!fcopy(headerpos, ignore))
       message(FATAL, "I/O error in header\n");
 }
 
 /* write prologue to end of setup section excluding PStoPS procset */
 int writepartprolog(void)
 {
-   if (beginprocset && !fcopy(beginprocset))
+   if (beginprocset && !fcopy(beginprocset, NULL))
       message(FATAL, "I/O error in prologue\n");
    if (endprocset)
       fseek(infile, endprocset, SEEK_SET);
@@ -321,14 +361,14 @@
 /* write prologue up to end of setup section */
 void writeprolog(void)
 {
-   if (!fcopy(endsetup))
+   if (!fcopy(endsetup, NULL))
       message(FATAL, "I/O error in prologue\n");
 }
 
 /* write from end of setup to start of pages */
 void writesetup(void)
 {
-   if (!fcopy(pageptr[0]))
+   if (!fcopy(pageptr[0], NULL))
       message(FATAL, "I/O error in prologue\n");
 }
 
Index: psutils-1.17/psutil.h
===================================================================
--- psutils-1.17.orig/psutil.h  2006-05-21 11:31:57.389839411 +0200
+++ psutils-1.17/psutil.h       2006-05-21 12:40:19.638574927 +0200
@@ -32,13 +32,13 @@
 extern void writepageheader(char *label, int p);
 extern void writepagesetup(void);
 extern void writepagebody(int p);
-extern void writeheader(int p);
+extern void writeheader(int p, long *ignorelist);
 extern int writepartprolog(void);
 extern void writeprolog(void);
 extern void writesetup(void);
 extern void writetrailer(void);
 extern void writeemptypage(void);
-extern void scanpages(void);
+extern void scanpages(long *sizeheaders);
 extern void writestring(char *s);
 
 /* These variables are imported from the client program (e.g. psbook, psnup,
Index: psutils-1.17/psbook.c
===================================================================
--- psutils-1.17.orig/psbook.c  2006-05-21 12:11:01.801435729 +0200
+++ psutils-1.17/psbook.c       2006-05-21 12:40:33.074175985 +0200
@@ -97,7 +97,7 @@
    if ((infile=seekable(infile))==NULL)
       message(FATAL, "can't seek input\n");
 
-   scanpages();
+   scanpages(NULL);
 
    if (!signature)
       signature = maxpage = pages+(4-pages%4)%4;
@@ -105,7 +105,7 @@
       maxpage = pages+(signature-pages%signature)%signature;
 
    /* rearrange pages */
-   writeheader(maxpage);
+   writeheader(maxpage, NULL);
    writeprolog();
    writesetup();
    for (currentpg = 0; currentpg < maxpage; currentpg++) {
Index: psutils-1.17/psselect.c
===================================================================
--- psutils-1.17.orig/psselect.c        2006-05-21 12:12:31.821368501 +0200
+++ psutils-1.17/psselect.c     2006-05-21 12:41:21.677497805 +0200
@@ -175,7 +175,7 @@
    if ((infile=seekable(infile))==NULL)
       message(FATAL, "can't seek input\n");
 
-   scanpages();
+   scanpages(NULL);
 
    /* select all pages or all in range if odd or even not set */
    all = !(odd || even);
@@ -224,7 +224,7 @@
    for (pass = 0; pass < 2; pass++) {
       PageRange *r;
       if (pass) {                           /* write header on second pass */
-        writeheader(maxpage);
+        writeheader(maxpage, NULL);
         writeprolog();
         writesetup();
       }
Index: psutils-1.17/psspec.h
===================================================================
--- psutils-1.17.orig/psspec.h  1997-03-11 23:53:04.000000000 +0100
+++ psutils-1.17/psspec.h       2006-05-21 12:15:37.002311126 +0200
@@ -28,3 +28,5 @@
                          void (*usagefn)(void));
 extern void pstops(int modulo, int pps, int nobind, PageSpec *specs,
                   double draw);
+extern void pstops_write(int modulo, int pps, int nobind, PageSpec *specs,
+                         double draw, long *ignorelist);
Index: psutils-1.17/psresize.c
===================================================================
--- psutils-1.17.orig/psresize.c        2006-05-21 11:31:57.391839055 +0200
+++ psutils-1.17/psresize.c     2006-05-21 13:01:00.413037373 +0200
@@ -61,6 +61,7 @@
    int rotate;
    double inwidth = -1;
    double inheight = -1;
+   long sizeheaders[20];                       /* headers to remove */
    Paper *paper = NULL;
    PageSpec *specs;
    int opt;
@@ -171,6 +172,8 @@
    if (width <= 0 || height <= 0)
       message(FATAL, "output page width and height must be set\n");
 
+   scanpages(sizeheaders);
+
    if (inwidth <= 0 || inheight <= 0)
       message(FATAL, "input page width and height must be set\n");
 
@@ -212,7 +215,7 @@
    specs->yoff = vshift;
    specs->flags |= OFFSET;
       
-   pstops(1, 1, 0, specs, 0.0);                /* do page rearrangement */
+   pstops_write(1, 1, 0, specs, 0.0, sizeheaders); /* do page rearrangement */
 
    exit(0);
 }
Index: psutils-1.17/psnup.c
===================================================================
--- psutils-1.17.orig/psnup.c   2006-05-21 11:31:57.392838876 +0200
+++ psutils-1.17/psnup.c        2006-05-21 12:46:25.141313930 +0200
@@ -88,6 +88,7 @@
    double iwidth, iheight ;                    /* input paper size */
    double tolerance = 100000;                  /* layout tolerance */
    Paper *paper = NULL;
+   long sizeheaders[20];                       /* headers to remove */
    int opt;
 
 #ifdef DEBIAN
@@ -261,6 +262,8 @@
    if (ppwid <= 0 || pphgt <= 0)
       message(FATAL, "paper margins are too large\n");
 
+   scanpages(sizeheaders);
+
    /* set default values of input height & width */
    if ( iwidth > 0 )
      width = iwidth ;
@@ -374,7 +377,7 @@
         }
       }
       
-      pstops(nup, 1, 0, specs, draw);          /* do page rearrangement */
+      pstops_write(nup, 1, 0, specs, draw, sizeheaders); /* do page 
rearrangement */
    }
 
    exit(0);
Index: psutils-1.17/psspec.c
===================================================================
--- psutils-1.17.orig/psspec.c  1997-03-11 23:53:04.000000000 +0100
+++ psutils-1.17/psspec.c       2006-05-21 12:41:38.805439591 +0200
@@ -134,18 +134,22 @@
    NULL
    };
 
-void pstops(int modulo, int pps, int nobind, PageSpec *specs, double draw)
+void pstops(int modulo, int pps, int nobind, PageSpec *specs, double draw) {
+
+  scanpages(NULL);
+  pstops_write(modulo, pps, nobind, specs, draw, NULL);
+}
+
+void pstops_write(int modulo, int pps, int nobind, PageSpec *specs, double 
draw, long *ignorelist)
 {
    int thispg, maxpage;
    int pageindex = 0;
    char **pro;
 
-   scanpages();
-
    maxpage = ((pages+modulo-1)/modulo)*modulo;
 
    /* rearrange pages: doesn't cope properly with loaded definitions */
-   writeheader((maxpage/modulo)*pps);
+   writeheader((maxpage/modulo)*pps, ignorelist);
 #ifndef SHOWPAGE_LOAD
    writestring("%%BeginProcSet: PStoPS");
 #else

--- End Message ---
--- Begin Message ---
Source: psutils
Source-Version: 1.17-25

We believe that the bug you reported is fixed in the latest version of
psutils, which is due to be installed in the Debian FTP archive:

psutils_1.17-25.diff.gz
  to pool/main/p/psutils/psutils_1.17-25.diff.gz
psutils_1.17-25.dsc
  to pool/main/p/psutils/psutils_1.17-25.dsc
psutils_1.17-25_i386.deb
  to pool/main/p/psutils/psutils_1.17-25_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Jay Berkenbilt <[EMAIL PROTECTED]> (supplier of updated psutils package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sun, 08 Jun 2008 11:16:42 -0400
Source: psutils
Binary: psutils
Architecture: source i386
Version: 1.17-25
Distribution: unstable
Urgency: low
Maintainer: Jay Berkenbilt <[EMAIL PROTECTED]>
Changed-By: Jay Berkenbilt <[EMAIL PROTECTED]>
Description: 
 psutils    - A collection of PostScript document handling utilities
Closes: 368331 434500 437832 464785
Changes: 
 psutils (1.17-25) unstable; urgency=low
 .
   * Update standards version to 3.7.3.  No changes required.
   * Fix error in psmerge manual page.  (Closes: #464785)
   * Include patch from Bernhard R. Link to remove paper size information
     and bounding boxes from psnup and psresize.  This removes bugs
     resulting in having usually incorrect information in files when the
     paper size has changed, reasoning that having no information is better
     than having incorrect information.  (Closes: #368331, #434500)
   * Honor DEB_BUILD_OPTIONS=nostrip by not explicitly calling install -s
     to strip executables and instead letting dh_strip do it for us.
     (Closes: #437832)
Checksums-Sha1: 
 f3213f5f48b443af8d029f14a8e8c1d1d253bf55 952 psutils_1.17-25.dsc
 9ff009bedf5c66bd30afac357397e3e80dbdcba5 18152 psutils_1.17-25.diff.gz
 28d2e507832444c7e589de1b523050fcf9b611ce 85116 psutils_1.17-25_i386.deb
Checksums-Sha256: 
 d3a94f9f6f3d9b17dc745c586cd801509d8aef96a19fd75a6a57a333badb3f3b 952 
psutils_1.17-25.dsc
 bed5d016edbf5a37d7756f8e33c75c2a3e88a385efcb50cd8f61660d9c098473 18152 
psutils_1.17-25.diff.gz
 ab6f84747f2d1f3a83d03e20b1b435e91c835d63f804f96ea5a1f61c0ee83410 85116 
psutils_1.17-25_i386.deb
Files: 
 911db5613a95a61e5e9c3dd57fbdc65b 952 text optional psutils_1.17-25.dsc
 e1cbff1b79764ddaf8756f79c237a2d9 18152 text optional psutils_1.17-25.diff.gz
 9e42dd2762a24e4a3e4279f6d0249398 85116 text optional psutils_1.17-25_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIS/2iEBVk6taI4KcRAlAvAKC7dH6hxA6zPB375i4XuLCb0GXiMQCgjK6V
48yOIdwYQt+mtiusmMgVdDY=
=ygcD
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to