diff --git a/ChangeLog b/ChangeLog index 6a078a9..71c0b3c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,33 @@ +2011-07-25 Till Kamppeter + + * Tagged branch for release 4.0.8. + + * README, USAGE, configure.ac: Updated for release 4.0.8. + +2011-06-30 Till Kamppeter + + * lib/Foomatic/PPD.pm: Improved printer entry searh algorithm + (find_printer() method) in two points: + 1. Score match of only make and model in printer ID of the entry + higher than match of make and model fields of the entry but + lower than match of full printer ID. This raises the relevance + of printer ID matches if the search term contains only a partial + device ID consisting of only the make and model fields. + 2. Score a printer entry with an actual printer XML file 1 point + higher than an implicit printer entry only coming from a + printer name in a driver's printer list. This raises the + relevance of actual printer XML entries. + +2011-03-04 Till Kamppeter + + * lib/Foomatic/PPD.pm: Handle non-UTF-8 encodings in imported PPD + files. Thanks to Richard Hughes (hughsient at gmail dot com) for + supplying me this patch from Red Hat. + + * configure.ac: Added libdir support for the ./configure + script. Thanks to Richard Hughes (hughsient at gmail dot com) for + supplying me this patch from Red Hat. + 2011-02-18 Till Kamppeter * Tagged branch for release 4.0.7. diff --git a/README b/README index 9555f95..349cb9f 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ -Foomatic 4.0.7 +Foomatic 4.0.8 ============== diff --git a/USAGE b/USAGE index 174e1fb..ac6aa78 100644 --- a/USAGE +++ b/USAGE @@ -1,5 +1,5 @@ -Foomatic 4.0.7 +Foomatic 4.0.8 ============== foomatic-db-engine diff --git a/configure b/configure index 431dfb9..3c2a1e0 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for foomatic-db-engine 4.0.7. +# Generated by GNU Autoconf 2.61 for foomatic-db-engine 4.0.8. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -572,8 +572,8 @@ # Identity of this package. PACKAGE_NAME='foomatic-db-engine' PACKAGE_TARNAME='foomatic-db-engine' -PACKAGE_VERSION='4.0.7' -PACKAGE_STRING='foomatic-db-engine 4.0.7' +PACKAGE_VERSION='4.0.8' +PACKAGE_STRING='foomatic-db-engine 4.0.8' PACKAGE_BUGREPORT='' ac_unique_file="foomatic-perl-data.c" @@ -1215,7 +1215,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures foomatic-db-engine 4.0.7 to adapt to many kinds of systems. +\`configure' configures foomatic-db-engine 4.0.8 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1276,7 +1276,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of foomatic-db-engine 4.0.7:";; + short | recursive ) echo "Configuration of foomatic-db-engine 4.0.8:";; esac cat <<\_ACEOF @@ -1361,7 +1361,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -foomatic-db-engine configure 4.0.7 +foomatic-db-engine configure 4.0.8 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1375,7 +1375,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by foomatic-db-engine $as_me 4.0.7, which was +It was created by foomatic-db-engine $as_me 4.0.8, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -4043,8 +4043,8 @@ SYSCONFSEARCHPATH=/etc:/usr/etc:/usr/local/etc:/var/etc SBINSEARCHPATH=/usr/sbin:/sbin:/usr/local/sbin:/etc/sbin BINSEARCHPATH=/usr/bin:/bin:/usr/local/bin -DATASEARCHPATH=/usr/share:/usr/local/share:/usr/lib:/usr/local/lib:/opt -LIBSEARCHPATH=/usr/lib:/lib:/usr/local/lib:/usr/local/libexec:/opt +DATASEARCHPATH=/usr/share:/usr/local/share:$libdir:/usr/local/lib:/opt +LIBSEARCHPATH=$libdir:/lib:/usr/local/lib:/usr/local/libexec:/opt PTALPIPESSEARCHPATH=/var/run:/var:/var/ptal:/usr/var/run:/usr/var:/usr/var/ptal:/usr/local/var/run:/usr/local/var:/usr/local/var/ptal:/dev:/dev/ptal MTINKPIPESSEARCHPATH=/var:/var/run:/usr/var/:/usr/var/run:/usr/local/var:/usr/local/var/run:/dev @@ -6036,7 +6036,7 @@ test -n "$PDQ_CONF" && break done -test -n "$PDQ_CONF" || PDQ_CONF="/usr/lib/pdq" +test -n "$PDQ_CONF" || PDQ_CONF="$libdir/pdq" for ac_prog in pdq/printrc do @@ -6176,7 +6176,7 @@ test -n "$PPR_PPRD" && break done -test -n "$PPR_PPRD" || PPR_PPRD="/usr/lib/ppr/bin/pprd" +test -n "$PPR_PPRD" || PPR_PPRD="$libdir/ppr/bin/pprd" for ac_dir in ppr/interfaces do @@ -6219,7 +6219,7 @@ test -n "$PPR_INTERFACES" && break done -test -n "$PPR_INTERFACES" || PPR_INTERFACES="/usr/lib/ppr/interfaces" +test -n "$PPR_INTERFACES" || PPR_INTERFACES="$libdir/ppr/interfaces" for ac_dir in ppr/PPDFiles do @@ -7424,7 +7424,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by foomatic-db-engine $as_me 4.0.7, which was +This file was extended by foomatic-db-engine $as_me 4.0.8, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7467,7 +7467,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -foomatic-db-engine config.status 4.0.7 +foomatic-db-engine config.status 4.0.8 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/configure.ac b/configure.ac index db944d7..196e0da 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.52]) -AC_INIT([foomatic-db-engine], 4.0.7) +AC_INIT([foomatic-db-engine], 4.0.8) AC_CONFIG_SRCDIR(foomatic-perl-data.c) # If the user didn't specify the $sysconfdir on the command line, let it @@ -69,8 +69,8 @@ SYSCONFSEARCHPATH=/etc:/usr/etc:/usr/local/etc:/var/etc SBINSEARCHPATH=/usr/sbin:/sbin:/usr/local/sbin:/etc/sbin BINSEARCHPATH=/usr/bin:/bin:/usr/local/bin -DATASEARCHPATH=/usr/share:/usr/local/share:/usr/lib:/usr/local/lib:/opt -LIBSEARCHPATH=/usr/lib:/lib:/usr/local/lib:/usr/local/libexec:/opt +DATASEARCHPATH=/usr/share:/usr/local/share:$libdir:/usr/local/lib:/opt +LIBSEARCHPATH=$libdir:/lib:/usr/local/lib:/usr/local/libexec:/opt PTALPIPESSEARCHPATH=/var/run:/var:/var/ptal:/usr/var/run:/usr/var:/usr/var/ptal:/usr/local/var/run:/usr/local/var:/usr/local/var/ptal:/dev:/dev/ptal MTINKPIPESSEARCHPATH=/var:/var/run:/usr/var/:/usr/var/run:/usr/local/var:/usr/local/var/run:/dev @@ -257,15 +257,15 @@ AC_PATH_PROGS(CUPS_LPINFO,lpinfo,/usr/sbin/lpinfo,$SBINSEARCHPATH) # Paths for PDQ -FM_PATH_DIRS(PDQ_CONF,pdq,/usr/lib/pdq,$SYS_LIB_PATH) +FM_PATH_DIRS(PDQ_CONF,pdq,$libdir/pdq,$SYS_LIB_PATH) AC_PATH_PROGS(PDQ_PRINTRC,pdq/printrc,$PDQ_CONF/printrc,$SYS_LIB_PATH) dnl PDQ_FOOMATIC=$PDQ_CONF/drivers/foomatic AC_PATH_PROGS(PDQ_PRINT,pdq lpr-pdq,/usr/bin/pdq,$BINSEARCHPATH) dnl PDQ_JOBDIR=~/.printjobs # Paths for PPR -AC_PATH_PROGS(PPR_PPRD,ppr/bin/pprd,/usr/lib/ppr/bin/pprd,$LIBSEARCHPATH) -FM_PATH_DIRS(PPR_INTERFACES,ppr/interfaces,/usr/lib/ppr/interfaces,$LIBSEARCHPATH) +AC_PATH_PROGS(PPR_PPRD,ppr/bin/pprd,$libdir/ppr/bin/pprd,$LIBSEARCHPATH) +FM_PATH_DIRS(PPR_INTERFACES,ppr/interfaces,$libdir/ppr/interfaces,$LIBSEARCHPATH) FM_PATH_DIRS(PPR_PPDFILES,ppr/PPDFiles,/usr/share/ppr/PPDFiles,$DATASEARCHPATH) FM_PATH_DIRS(PPR_ETC,ppr,/etc/ppr,$SYSCONFSEARCHPATH) AC_PATH_PROGS(PPR_PPR,ppr lpr-ppr,/usr/bin/ppr,$BINSEARCHPATH) diff --git a/debian/changelog b/debian/changelog index 8acec4b..152d7c5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +foomatic-db-engine (4.0.8-0ubuntu1) oneiric; urgency=low + + * New upstream release + - Improved printer entry searh algorithm letting the value of matching + only manufacturer and model in the device ID bein higher than matching + the make and model fields of the Foomatic entry but lower than a full + device ID match and also scoring a printer with actual Foomatic entry + higher than a printer only known by a driver entry. + - Handle non-UTF-8 encodings in imported PPD files. + + -- Till Kamppeter Mon, 25 Jul 2010 12:45:40 +0200 + foomatic-db-engine (4.0.7-2) unstable; urgency=low * Drop the dummy foomatic-filters-ppds package, which was only useful diff --git a/lib/Foomatic/DB.pm b/lib/Foomatic/DB.pm index 5ec8ecb..6526939 100644 --- a/lib/Foomatic/DB.pm +++ b/lib/Foomatic/DB.pm @@ -565,6 +565,7 @@ # "Real" manufacturer, check manufacturer, model, and/or # description my $matched = 1; + my $mfgmdlmatched = 1; my ($mfg, $mdl, $des, $sku); my $ieee1284 = deviceIDfromDBEntry($p); if ($ieee1284 =~ /(MFG|MANUFACTURER):\s*([^:;]+);?/i) { @@ -585,11 +586,13 @@ if ($mfg) { if ($mfg ne $automake) { $matched = 0; + $mfgmdlmatched = 0; } } if ($mdl) { if ($mdl ne $automodel) { $matched = 0; + $mfgmdlmatched = 0; } } if ($des) { @@ -605,12 +608,29 @@ if ($matched && ($des || ($mfg && ($mdl || ($sku && $autosku))))) { # Full match to known auto-detection data - $matchlength = 1000; + $matchlength = 1200; + if (!$p->{noxmlentry}) { + $matchlength += 1; + } $bestmatchlength = $matchlength if $bestmatchlength < $matchlength; $results{$p->{id}} = $matchlength if (!defined($results{$p->{id}}) || - ($results{$p->{id}} < $matchlength)); + ($results{$p->{id}} < $matchlength)); + next; + } + if ($mfgmdlmatched && + ($mfg && $mdl)) { + # Match to known auto-detection make/model data + $matchlength = 1000; + if (!$p->{noxmlentry}) { + $matchlength += 1; + } + $bestmatchlength = $matchlength if + $bestmatchlength < $matchlength; + $results{$p->{id}} = $matchlength if + (!defined($results{$p->{id}}) || + ($results{$p->{id}} < $matchlength)); next; } } @@ -639,6 +659,9 @@ # models if (normalize($task->[1]) eq normalize($task->[0])) { $matchlength = 100; + if (!$p->{noxmlentry}) { + $bestmatchlength += 1; + } $bestmatchlength = $matchlength + $task->[2] if $bestmatchlength < $matchlength + $task->[2]; $results{$p->{id}} = $matchlength + $task->[2] if diff --git a/lib/Foomatic/PPD.pm b/lib/Foomatic/PPD.pm index f1803a0..f97336a 100644 --- a/lib/Foomatic/PPD.pm +++ b/lib/Foomatic/PPD.pm @@ -300,11 +300,17 @@ sub xml_esc { my ($in) = (@_); - $in =~ s!&!&!g; - $in =~ s!!>!g; - - return $in; + @chars = split(//,$in); + $ascii = ""; + foreach (@chars) { + if (ord ($_) > 127) { $_="?"; } + $ascii .= $_; + } + $ascii =~ s!&!&!g; + $ascii =~ s!!>!g; + + return $ascii; } sub pdq_filter {