rpms/tetex/F-7 tetex-3.0-epstopdf.patch, 1.2, 1.3 tetex.spec, 1.114, 1.115

Jindrich Novy (jnovy) fedora-extras-commits at redhat.com
Fri Nov 30 14:11:08 UTC 2007


Author: jnovy

Update of /cvs/extras/rpms/tetex/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv23788

Modified Files:
	tetex-3.0-epstopdf.patch tetex.spec 
Log Message:
fix nasty bug in epstopdf (#241794)


tetex-3.0-epstopdf.patch:

Index: tetex-3.0-epstopdf.patch
===================================================================
RCS file: /cvs/extras/rpms/tetex/F-7/tetex-3.0-epstopdf.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- tetex-3.0-epstopdf.patch	5 Jun 2006 12:49:05 -0000	1.2
+++ tetex-3.0-epstopdf.patch	30 Nov 2007 14:11:05 -0000	1.3
@@ -1,7 +1,8 @@
+diff -up tetex-src-3.0/texk/tetex/epstopdf.eps2pdf tetex-src-3.0/texk/tetex/epstopdf
 --- tetex-src-3.0/texk/tetex/epstopdf.eps2pdf	2004-10-22 21:33:51.000000000 +0200
-+++ tetex-src-3.0/texk/tetex/epstopdf	2006-06-05 13:34:26.000000000 +0200
-@@ -1,22 +1,11 @@
--#!/usr/bin/env perl
++++ tetex-src-3.0/texk/tetex/epstopdf	2007-11-30 13:55:43.000000000 +0100
+@@ -1,22 +1,10 @@
+ #!/usr/bin/env perl
 -
 -# Copyright 1998-2001 by Sebastian Rahtz et al.
 -# epstopdf is free software; you can redistribute it and/or modify
@@ -18,8 +19,6 @@
 -# along with epstopdf; if not, write to the Free Software
 -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 -
-+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q'
-+  if 0;
  use strict;
  
 +# Change by Thomas Esser, Sept. 1998: The above lines allows us to find
@@ -29,7 +28,7 @@
  # A script to transform an EPS file so that:
  #   a) it is guarenteed to start at the 0,0 coordinate
  #   b) it sets a page size exactly corresponding to the BoundingBox
-@@ -55,31 +44,33 @@
+@@ -55,31 +43,37 @@ use strict;
  #  2001/03/05 v2.7 (Heiko Oberdiek)
  #    * Newline before grestore for the case that there is no
  #      whitespace at the end of the eps file.
@@ -47,6 +46,10 @@
 +#    * Quote OutFilename
 +#  2005/10/01 v2.9.3draft (Gerben Wierda)
 +#    * Quote OutFilename
++#  2005/10/06 v2.9.4gw (Gerben Wierda)
++#    * This has become the official version for now
++#  2005/10/06 v2.9.5gw (Gerben Wierda)
++#    * Fixed a horrendous bug in the (atend) handling code
  #
  
 -my $IsWin32 = ($^O =~ /MSWin32/i);
@@ -56,9 +59,9 @@
 -my $filedate="2001/03/05";
 -my $fileversion="2.7";
 -my $copyright = "Copyright 1998-2001 by Sebastian Rahtz et al.";
-+my $filedate="2003/04/20";
-+my $fileversion="2.9.3draft";
-+my $copyright = "Copyright 1998-2002 by Sebastian Rahtz et al.";
++my $filedate="2006/01/29";
++my $fileversion="2.9.5gw";
++my $copyright = "Copyright 1998-2006 by Sebastian Rahtz et al.";
  my $title = "\U$program\E $fileversion, $filedate - $copyright\n";
  
  ### ghostscript command name
@@ -79,7 +82,7 @@
  
  ### options
  $::opt_help=0;
-@@ -204,8 +195,8 @@
+@@ -204,8 +198,8 @@ binmode IN;
  
  ### open output file
  if ($::opt_gs) {
@@ -90,7 +93,7 @@
    debug "Ghostscript pipe:", $pipe;
    open(OUT,"|$pipe") or error "Cannot open Ghostscript for piped input";
  }
-@@ -213,9 +204,112 @@
+@@ -213,9 +207,124 @@ else {
    open(OUT,">$OutputFilename") or error "Cannot write '$OutputFilename";
  }
  
@@ -139,13 +142,14 @@
 +  # that array until it is empty, then move again back to <IN>
 +  $buf .= <IN> unless eof( IN);
 +  $buflen = length( $buf);
++  $bufarraypos = 0;
 +
 +  # Some extra magic is needed here: if we set $/ to \r, Perl's re engine
 +  # still thinks eol is \n in regular expressions (not very nice) so we
 +  # cannot split on ^, but have to split on \r and reappend those.
 +  if ($/ eq "\r") {
-+    @bufarray = split( /\r/ms, $buf);
-+    grep( $_ .= "\r", @bufarray);
++    @bufarray = split( /\r/ms, $buf); # split on \r
++    grep( $_ .= "\r", @bufarray); # re-append \r to each array item
 +  }
 +  else {
 +    @bufarray = split( /^/ms, $buf);
@@ -158,6 +162,8 @@
 +    $_ = shift( @bufarray);
 +    unshift( @parsedbufarray, $_); # for myseek and mytell
 +    $bufarraypos += length( $_);
++    # debug "getline from array. bufarraypos = $bufarraypos";
++    # debug "*** READ: $_";
 +  }
 +  else {
 +    $_ = <IN>;
@@ -168,31 +174,40 @@
 +### mytell and myseek, work on <IN> only
 +sub mytell {
 +  if ($#bufarray) {
++    # debug "Telling ARRAY position $bufarraypos";
 +    return $bufarraypos;
 +  }
 +  else {
-+    return tell( IN);
++    my $pos = tell( IN);
++    # debug "Telling FILE position $pos";
++    return $pos;
 +  }
 +}
 +
 +sub myseek {
 +  my $pos = shift;
++  # debug "Seeking to position $pos in input";
 +  if ($pos < $buflen) {
++    # debug "myseek position $pos < buffer size $buflen";
 +    # We were still parsing the array, reset to the end of buf and
 +    # move to the right line in the array.
-+    # Now, move stuff from the @parsedbufarray until we are back at $pos
++    # Now, move stuff from the @parsedbufarray back until we are back at $pos
 +    my $tmpline;
-+    while ($pos > 0) {
++    while ($bufarraypos > $pos) {
++      # debug "myseek bufarray position $bufarraypos > position $pos";
 +      # we test on parsedbufarray to prevent an infinite loop on
 +      # a programming error (DEVELOP only)
 +      die "Programming error 1\n" unless $#parsedbufarray;
-+      $tmpline = pop( @parsedbufarray);
-+      $pos -= length( $tmpline);
-+      push( @bufarray, $tmpline);
++      $tmpline = shift( @parsedbufarray);
++      $bufarraypos -= length( $tmpline);
++      unshift( @bufarray, $tmpline);
++      debug "*** UNREAD: $tmpline";
 +    }
++    # debug "Returning to ARRAY size position $buflen (bufarraypos = $bufarraypos)";
 +    return seek( IN, $buflen, 0);
 +  }
 +  else {
++    # debug "Seeking to FILE position $pos";
 +    return seek( IN, $pos, 0);
 +  }
 +}
@@ -204,7 +219,7 @@
  if (/%!/) {
    # throw away binary junk before %!
    s/(.*)%!/%!/o;
-@@ -245,7 +339,9 @@
+@@ -245,7 +354,9 @@ sub CorrectBoundingBox {
  
  ### scan header
  if ($header) {
@@ -215,7 +230,7 @@
  
      ### end of header
      if (!/^%/ or /^%%EndComments/) {
-@@ -268,14 +364,14 @@
+@@ -268,14 +379,14 @@ if ($header) {
                  "with option --filter";
          last;
        }
@@ -233,7 +248,7 @@
              last if /^%%EndDocument/;
            }
          }
-@@ -287,7 +383,7 @@
+@@ -287,7 +398,7 @@ if ($header) {
        }
  
        # go back
@@ -242,7 +257,7 @@
        last;
      }
  
-@@ -297,7 +393,7 @@
+@@ -297,7 +408,7 @@ if ($header) {
  }
  
  ### print rest of file


Index: tetex.spec
===================================================================
RCS file: /cvs/extras/rpms/tetex/F-7/tetex.spec,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -r1.114 -r1.115
--- tetex.spec	13 Nov 2007 14:51:25 -0000	1.114
+++ tetex.spec	30 Nov 2007 14:11:05 -0000	1.115
@@ -11,7 +11,7 @@
 Summary: The TeX text formatting system.
 Name: tetex
 Version: 3.0
-Release: 40.3%{?dist}
+Release: 40.4%{?dist}
 License: Public Domain and GPLv2 and MIT and LPPL and Utopia and Artistic 2.0
 Group: Applications/Publishing
 Requires: tmpwatch, dialog, ed
@@ -883,6 +883,9 @@
 %defattr(-,root,root)
 
 %changelog
+* Fri Nov 30 2007 Jindrich Novy <jnovy at redhat.com> 3.0-40.4
+- fix nasty bug in epstopdf (#241794)
+
 * Tue Nov 13 2007 Jindrich Novy <jnovy at redhat.com> 3.0-40.3
 - fix dvips -z buffer overflow with long href (#368591)
 - fix insecure usage of temporary file in dviljk (#368611, #368641)




More information about the fedora-extras-commits mailing list