summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2022-02-25 21:53:34 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2022-02-25 21:53:34 +0100
commitac75ed6a8a5ad70a587e5d9a2e085f80348ee610 (patch)
treeaa8ca3da2ebff3761786718b1ec817e6f6190ace
parent160d7ff755a943c63222abe1a860bc92d26c9673 (diff)
parentbf97cbc41a39cd3b8bb0a3357683ef84e6b16c6a (diff)
Merge branch 'release/debian/4.0.17-14'debian/4.0.17-14
-rw-r--r--.gitignore3
-rw-r--r--debian/README.Debian6
-rw-r--r--debian/changelog15
-rw-r--r--debian/copyright27
-rw-r--r--debian/foomatic-filters.examples1
-rw-r--r--debian/patches/0115-Fix_text_filter.patch25
-rw-r--r--debian/patches/0120-Disable_option_docs.patch35
-rw-r--r--debian/patches/series2
-rw-r--r--debian/ppd-doc-extractor184
9 files changed, 296 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 527834c..4fec8f6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,4 +4,5 @@ build/*
Makefile
.valencia
.pc
-.bzr \ No newline at end of file
+.bzr
+debian/files
diff --git a/debian/README.Debian b/debian/README.Debian
index e10326e..cb2fcc9 100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -1,6 +1,12 @@
foomatic-filters for Debian
---------------------------
+At /usr/share/doc/foomatic-filters/examples you can found a new
+ppd-doc-extractor. Thanks to Alexander Zangerl <az@debian.org>.
+
+ -- Jörg Frings-Fürst <debian@jff.email> Thu, 24 Feb 2022 14:09:09 +0100
+
+
Note that the structure of the OpenPrinting (foomatic) printer
configuration system in Debian (and upstream) has changed from the 2.0
series. There are now 3 core packages:
diff --git a/debian/changelog b/debian/changelog
index 98a28a4..73bb182 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,18 @@
+foomatic-filters (4.0.17-14) unstable; urgency=medium
+
+ * New debian/patches/0115-Fix_text_filter.patch (Closes: #776315):
+ - Fix error on handling text filter.
+ * New debian/patches/0120-Disable_option_docs.patch (Closes: #1004417)
+ - Disable not available option docs.
+ * New debian/ppd-doc-extractor installed at
+ /usr/share/doc/foomatic-filters/examples.
+ Thanks to Alexander Zangerl <az@debian.org>
+ * debian/copyright:
+ - Add year 2022 to myself.
+ - New paragraph for debian/ppd-doc-extractor.
+
+ -- Jörg Frings-Fürst <debian@jff.email> Thu, 24 Feb 2022 14:09:09 +0100
+
foomatic-filters (4.0.17-13) unstable; urgency=medium
* Fix error processing package (Closes: #997318):
diff --git a/debian/copyright b/debian/copyright
index e9e74a0..740f451 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -23,9 +23,34 @@ License: GPL-2.0+
Files: debian/*
Copyright: 2003 Chris Lawrence <lawrencc@debian.org>
- 2014-2021 Jörg Frings-Fürst <debian@jff.email>
+ 2014-2022 Jörg Frings-Fürst <debian@jff.email>
License: GPL-2.0+
+Files: debian/ppd-doc-extractor
+Copyright: 2022 Alexander Zangerl <az@snafu.priv.at>
+License: GPL-2.0
+
+License: GPL-2.0
+ This program is free software; you can redistribute it
+ and/or modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation version
+ 2 of the License.
+ .
+ This program is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the GNU General Public License for more
+ details.
+ .
+ You should have received a copy of the GNU General Public
+ License along with this package; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ Boston, MA 02110-1301 USA
+ .
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file
+ `/usr/share/common-licenses/GPL-2'.
+
License: GPL-2.0+
This program is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public
diff --git a/debian/foomatic-filters.examples b/debian/foomatic-filters.examples
index 930b11e..8727d19 100644
--- a/debian/foomatic-filters.examples
+++ b/debian/foomatic-filters.examples
@@ -1 +1,2 @@
filter.conf
+debian/ppd-doc-extractor
diff --git a/debian/patches/0115-Fix_text_filter.patch b/debian/patches/0115-Fix_text_filter.patch
new file mode 100644
index 0000000..b9727fc
--- /dev/null
+++ b/debian/patches/0115-Fix_text_filter.patch
@@ -0,0 +1,25 @@
+Description: Fix error on handling text filter
+Author: Alexander Zangerl <az@snafu.priv.at>
+Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=776315
+Bug: https://bugs.linuxfoundation.org/show_bug.cgi?id=1283
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=776315
+Forwarded: no
+Last-Update: 2022-02-24
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: trunk/fileconverter.c
+===================================================================
+--- trunk.orig/fileconverter.c
++++ trunk/fileconverter.c
+@@ -37,9 +37,9 @@
+ * is not set. (Except if the spooler is CUPS, then 'texttops' is used
+ */
+ const char *fileconverters[][2] = {
+- { "a2ps", "a2ps -1 @@--medium=@@PAGESIZE@@ @@--center-title=@@JOBTITLE@@ -o -" },
++ { "a2ps", "a2ps -1 @@--medium=@@PAGESIZE@@ @@--center-title=\"@@JOBTITLE@@ -o -" },
+ { "enscript", "enscript -G @@-M @@PAGESIZE@@ @@-b \"Page $%|@@JOBTITLE@@ --margins=36:36:36:36 --mark-wrapped-lines=arrow --word-wrap -p-" },
+- { "mpage", "mpage -o -1 @@-b @@PAGESIZE@@ @@-H -h @@JOBTITLE@@ -m36l36b36t36r -f -P- -" },
++ { "mpage", "mpage -o -1 @@-b @@PAGESIZE@@ @@-H -h \"@@JOBTITLE@@ -m36l36b36t36r -f -P- -" },
+ { "paps", "paps @@--paper @@PAGESIZE@@ --header --font=11.5" },
+ { NULL, NULL }
+ };
diff --git a/debian/patches/0120-Disable_option_docs.patch b/debian/patches/0120-Disable_option_docs.patch
new file mode 100644
index 0000000..62060f9
--- /dev/null
+++ b/debian/patches/0120-Disable_option_docs.patch
@@ -0,0 +1,35 @@
+Description: Disable not available option docs
+Author: Jörg Frings-Fürst <debian@jff.email>
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1004417
+Forwarded: not-needed
+Last-Update: 2022-02-24
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: trunk/foomaticrip.c
+===================================================================
+--- trunk.orig/foomaticrip.c
++++ trunk/foomaticrip.c
+@@ -330,8 +330,9 @@ void process_cmdline_options()
+
+ /* "docs" option to print help page */
+ if (!strcasecmp(key, "docs")) {
+- do_docs = 1;
+- continue;
++ do_docs = 0;
++ rip_die(EXIT_OPTION_NOT_AVAILABLE, "Option \"docs\" isn't available now.\n");
++/* continue; */
+ }
+ /* "profile" option to supply a color correction profile to a CUPS raster driver */
+ if (!strcmp(key, "profile")) {
+Index: trunk/foomaticrip.h
+===================================================================
+--- trunk.orig/foomaticrip.h
++++ trunk/foomaticrip.h
+@@ -62,6 +62,7 @@
+ #define EXIT_PRNERR_NORETRY_BAD_SETTINGS 9 /* interface settings are invalid */
+ #define EXIT_PRNERR_NO_SUCH_ADDRESS 10 /* address lookup failed, may be transient */
+ #define EXIT_PRNERR_NORETRY_NO_SUCH_ADDRESS 11 /* address lookup failed, not transient */
++#define EXIT_OPTION_NOT_AVAILABLE 20 /* Otion isn't avalable now */
+ #define EXIT_INCAPABLE 50 /* printer wants (lacks) features or resources */
+
+
diff --git a/debian/patches/series b/debian/patches/series
index e6a186b..7ede85b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,5 @@
0110-fixed-segfault-when-creating-logfile.patch
0001-paps.patch
0500-r7406_also_consider_the_back_tick_as_an_illegal_shell_escape_character.patch
+0115-Fix_text_filter.patch
+0120-Disable_option_docs.patch
diff --git a/debian/ppd-doc-extractor b/debian/ppd-doc-extractor
new file mode 100644
index 0000000..2d29543
--- /dev/null
+++ b/debian/ppd-doc-extractor
@@ -0,0 +1,184 @@
+#!/usr/bin/perl
+# $Id$
+#
+# File: ppd-doc-extractor
+# Date: 27 Jan 2022 16:28:17
+# Author: Alexander Zangerl <az@snafu.priv.at>
+#
+# Abstract:
+# very minimal recreation of the PPD documentation extractor
+# of foomatic-rip 3.x (which you got with foomatic-rip -o docs), which
+# is not part of the rewritten 4.x versions despite the documentation's
+# claims and the broken option code that doesn't reject what it cannot
+# handle.
+#
+# copyright (c) 2022 Alexander Zangerl <az@snafu.priv.at>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2
+# as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+use strict;
+use File::Slurp;
+use Data::Dumper;
+
+my ($ppdfile,@a2ps) = @ARGV;
+die "usage: $0 <ppdfile> [a2ps args]\n
+no a2ps args: print to stdout
+automatically added: --center-title, --footer\n\n" if (!-f $ppdfile);
+
+my @stuff = read_file($ppdfile);
+
+# parse everything but massage and handle just the relevant parts
+my (%x, $curopengroup);
+for (my $i = 0; $i <= $#stuff; ++$i)
+{
+ my $line = $stuff[$i];
+ $line =~ s/\r\n$//; # de-dos
+ chomp $line;
+
+ my ($key, $value, $option, $xlatoption);
+
+ next if ($line =~ /^(\*%.*)?$/ or $line eq "*End");
+ if ($line =~ /^\*([^:]+):\s*(.+)\s*$/)
+ {
+ ($key, $value) = ($1,$2);
+ if ($key =~ /^(\S+)\s+(.+)$/)
+ {
+ $key = $1;
+ $option = $2;
+
+ if ($option =~ m!^([^/]+)/(.+)$!)
+ {
+ ($option,$xlatoption) = ($1,$2);
+ undef $xlatoption if ($xlatoption eq $option); # unnecessary ones
+ }
+ }
+ # invocationvalue and quotedvalue allow continuation
+ if ($value =~ /^"([^"]+)"\s*$/)
+ {
+ $value = $1;
+ }
+ elsif ($value =~ /^"([^"]*)*$/)
+ {
+ $value = $1;
+ while ((my $nextline = $stuff[++$i]) !~ /"/)
+ {
+ $value .= $nextline;
+ }
+ if ($stuff[$i] =~ /^([^"]+)"\s*$/)
+ {
+ $value .= $1;
+ }
+ }
+
+ # orderdependency is laid out extraspecially stupidly
+ if ($key =~ /^(NonUI)?OrderDependency$/)
+ {
+ $key = "OrderDependency"; # we lump these together
+ my ($num,$dontcare,$appliesto) = split(/\s+/,$value);
+ ($option = $appliesto) =~ s/^\*//;
+ $value = $num;
+ }
+ # want the options under openui w/o fluff
+ elsif ($key eq "OpenUI")
+ {
+ $option =~ s/^\*//;
+ }
+ # another instance of shitty structural layout
+ elsif ($key eq "OpenGroup")
+ {
+ if ($value =~ m!^\s*(\S+)/(.+)$!)
+ {
+ ($option,$xlatoption) = ($1,$2);
+ }
+ else
+ {
+ $xlatoption = $option = $value;
+ }
+ $curopengroup = $value = $option;
+ }
+ elsif ($key eq "CloseGroup")
+ {
+ undef $curopengroup;
+ }
+
+ if (defined $option)
+ {
+ # for option entries add a sequence number for sorting - simply use the line number
+ $x{$key}->{$option} = { xlat => $xlatoption,
+ value => $value,
+ sequence => $i,
+ ingroup => $curopengroup, };
+
+ }
+ else
+ {
+ $x{$key} = $value;
+ }
+ }
+ else
+ {
+ die "unrecognized line nr. $i\n";
+ }
+}
+
+# print Dumper(\%x);
+
+if (@a2ps)
+{
+ push @a2ps, ("--center-title=Documentation for $x{ModelName}","--footer=");
+
+ # lazy me: just duping the pipe fd...
+ open(P, "|-", "a2ps", @a2ps) or die "cannot pipe to a2ps: $!\n";
+ open(STDOUT, ">&", \*P) or die "cannot dup: $!\n";
+}
+
+print qq|
+Invocation summary for $x{ModelName}:
+Command line: lpr [-Z opt=value, opt=value...] [lpr options] <file>
+
+List of available options:\n\n|;
+
+# meh...orderdependency is not in all ppds or all sections :-(
+my $odep = $x{OrderDependency};
+my @onames = sort { $odep->{$a}->{ingroup} cmp $odep->{$a}->{ingroup}
+ || $odep->{$a}->{sequence} <=> $odep->{$b}->{sequence}
+ || $odep->{$a}->{value} <=> $odep->{$b}->{value}
+ || $x{OpenUI}->{$a}->{sequence} <=> $x{OpenUI}->{$b}->{sequence} } keys %{$x{OpenUI}};
+
+for my $oname (@onames)
+{
+ my $label = $x{OpenUI}->{$oname}->{xlat} // $oname;
+ my $type = $x{OpenUI}->{$oname}->{value} // "Unknown";
+
+ # one choice is no choice
+ next if ($type eq "PickOne" && keys %{$x{$oname}} == 1);
+
+ my $this = $x{$oname};
+ my $example = (keys %$this)[0];
+ my $sectionname = $x{OpenGroup}->{$this->{$example}->{ingroup}}->{xlat};
+ my $sectionlabel = $sectionname ? " Section: $sectionname\n":"";
+
+ print "Option '$oname': $label\n$sectionlabel Type: $type\n Choices:\n";
+ for my $choice (sort { $this->{$a}->{sequence} <=> $this->{$b}->{sequence} } keys %$this)
+ {
+ my $choicelabel = $x{$oname}->{$choice}->{xlat};
+ print " o '$choice'".($choicelabel? ": $choicelabel":"")."\n";
+ }
+ print " Default: ".$x{"Default$oname"}."\n Example: -Z $oname=$example\n\n";
+}
+
+if (@a2ps)
+{
+ close(STDOUT);
+ close(P);
+}