Re: Bug#129414: psptools: try this patch -p0 on psplpr.pl.in instead of #129287

2002-01-16 Thread Colin Watson
On Thu, Jan 17, 2002 at 03:11:40AM +, Colin Watson wrote:
> On Wed, Jan 16, 2002 at 11:22:59AM -0700, Don wrote:
> > Please look if there is a missing print; statement causing the
> > dropped and duplicated lines. Then all of the bugs would be gone,
> > at least as far as the program was intended to work.
> 
> I believe I have a fix for this. I'm just building and testing packages
> now, but the diff fragment is:

[...]

> This passes the test given in #116263, and should fix your problems too.
> 
> I'll let you know when I've uploaded new packages.

I believe that the packages currently in incoming
(http://incoming.debian.org/, GPG-signed by me) should fix everything
you've reported so far. Please let me know if there are any further
problems, or file a bug report or inform an existing bug report if
appropriate.

Thanks,

-- 
Colin Watson  [EMAIL PROTECTED]



Bug#129414: psptools: try this patch -p0 on psplpr.pl.in instead of #129287

2002-01-15 Thread Colin Watson
Don wrote:
> This diff supercedes my previous #129287 and #128669.

OK, I am now horribly confused. What with the three patches you've sent
to the bug tracking system, each of which claims to supersede earlier
patches but does different things, and the four mails you sent to me
privately, I really have no clue about what's going on. Bear in mind
that psptools doesn't have a real maintainer, so, while my Perl is good,
I'm not immediately familiar with what psptools does.

Please send *separate* patches for each feature/bugfix you propose,
explaining the problem addressed by each one. You can drop the --lpr
stuff, I've already got that fixed locally. Also please try to avoid
patches containing lots of old commented-out code and whitespace
changes.

If you send the patches to [EMAIL PROTECTED], it will avoid opening
a new bug report for them.

Thanks,

-- 
Colin Watson  [EMAIL PROTECTED]



Bug#129414: psptools: try this patch -p0 on psplpr.pl.in instead of #129287

2002-01-15 Thread Don
Package: psptools
Version: 1.2.2-6
Severity: normal

This diff supercedes my previous #129287 and #128669.

1. My custom output of allfeatures after the EndComments is removed.
I found the outstanding problem with some lines being dropped or duplicated 
in the final postscript output and want those to be fixed first.

2. There are some changes added that my solve that show stopper.
This works on some postscript. The input file is a big variable so a variety
of tests would be needed. Files from dvips could be a problem because
the psplpr tries to replace the dvips %%Feature: . The program maybe should
be used as a filter first and the output examined before printing and
before any regular use.

3. My perl is too poor to really figure this out.

4. If this is good enough then the following diff can be added to the
existing debian package building diff for pstools.


Don
[EMAIL PROTECTED]







--- psptools-1.2.2.orig/src/psplpr.pl.inWed Jul  3 04:49:28 1996
+++ psptools-1.2.2/src/psplpr.pl.in Tue Jan 15 15:34:56 2002
@@ -33,6 +33,8 @@
 require 'ppd.pl';
 require 'printer.pl';
 
+$used_prog_lpr = $prog_lpr; # default value (overridden by --output)
+
 #
 # tell_user(what)
 #
@@ -157,7 +159,7 @@
++$dictsz if $pagesetup;
 }
 
-return unless $dictsz;
+return unless ($dictsz > 1);
 
 if (!$nodsc) {
print "%%BeginResource: procset psplpr\n";
@@ -290,8 +292,8 @@
print "$who\n";
print "%%BoundingBox: 0 0 0 0\n%%Pages: 0\n";
print "%%EndComments\n";
-} else {
-print "%!\n";
+#} else {
+#print "%!\n";
 }
 
 if (!$doc) {
@@ -346,7 +348,7 @@
 }
 
 if (!$doc) {
-   print "psplprdict begin psplprsetup end\n";
+   print "psplprdict begin psplprsetup end\n" if 
countfeatures('PageSetup');
 }
 
 if ($doc && $dsc) {
@@ -507,22 +509,32 @@
 ignoredeps('ExitServer');
 ignoredeps('JCLSetup');
 
+local ($allout) = 0;
+
 $_ = readpsline($conformant);
 
 if (!$_) {
-   %all_options = outputallfeatures($nodsc, !$dirty, $safer,
-   $nonstd, $special);
+print "%!\n%%Creator: psplpr " . localtime() . "\n";
+print "%%EndComments\n";
+print "%\n% " . $myname . ": outputing all features... \n";
+   %all_options = outputallfeatures($nodsc, 666, $safer,
+   $nonstd, $special) unless $allout;
+$allout = 1;
 } else {
$_ =~ s/^\004//;
 
local($bad);
 
-   if ($dirty || ($bad = !/^%!PS/)) {
+   if ($dirty || ($bad = !/^%!PS-Adobe-3/)) {
+print;
+print "% " . $myname .": Looking for PS-Adobe-3.0 DSC conforming 
document...\n"; 
+print "% " . $myname .": with %%BeginProlog, %%BeginSetup, 
%%EndComments, etc. ... or\n";
+print "% " . $myname .": prepending! (not DSC compliant) at " . 
localtime() . "\n%\n";
local($first) = $_;
-
+
%all_options = outputallfeatures($nodsc, 0, $safer, $nonstd,
-   $special);
-
+   $special) unless $allout;
+$allout = 1;
if ($bad && !$dontglob) {
$glob = 1;
}
@@ -538,12 +550,23 @@
 
++$lineno;
 
+   
if (/^%%Begin/) {
$in_comment = 1;
} elsif (/^%%End/) {
$in_comment = 0;
}
 
+# begin 15jan02 change
+#if (/^%%EndComments/) {
+#print "%%Modified: by psplpr ".localtime()."\n" if $nodsc >= 
0;
+#print if $nodsc >= 0;
+#   $printed = 1;
+#outputallfeatures ($nodsc, 0 ,$safer, $nonstd, $special) 
unless $allout;
+#$allout = 1;
+# end 15jan02 change
+#  } els
+
if (/^%%BeginProlog/) {
print if $nodsc >= 0;
($_, $ps) = readfeatures($glob, $conformant, !$inc, !$chg,
@@ -579,12 +602,16 @@
print "%%BeginSetup\n" unless $nodsc;
}
 
-   if (!/^%%Page/) {
+   if (!/^%%Page/) {
+# next two lines added 15jan02
+#  print if $nodsc >= 0;
+#  $printed = 1;
+
($_, $ps) = readfeatures($glob, $conformant,
!$inc, !$chg, $del, $nodsc, $conforms);
$dontread = 1;
}
-
+   
outputfeatures('DocumentSetup', $nodsc, $safer,
$nonstd, !$conformant, $special);
outputfeatures('AnySetup', $nodsc, $safer, $nonstd,
@@ -598,7 +625,7 @@
}
 
if (/^%%Page:/) {
-   local($addsc) = 0;
+   local($adddsc) = 0;
 
if (!$prolog_output) {
outputfeatures('Prolog', $nodsc, $safer, $nonstd,
@@ -617,6 +644,9 @@
}
 
print if $nodsc >= 0;
+#added 15jan02
+   $printed =1;
+   
if ($_ = readpsl