Hello community,
here is the log from the commit of package yast2-scanner
checked in at Tue Mar 25 18:41:05 CET 2008.
--------
--- yast2-scanner/yast2-scanner.changes 2008-03-19 17:25:05.000000000 +0100
+++ /mounts/work_src_done/NOARCH/yast2-scanner/yast2-scanner.changes 2008-03-25 16:24:45.975398000 +0100
@@ -1,0 +2,10 @@
+Tue Mar 25 14:42:30 CET 2008 - jsmeix@suse.de
+
+- V 2.16.2
+- Added much better HP all-in-one device support.
+ Those devices are now autodetected at the USB and if there
+ is already a CUPS queue (the latter in particular for network
+ HP all-in-one devices which do not work without a CUPS queue)
+ and additionally hp-setup can be launched.
+
+-------------------------------------------------------------------
Old:
----
yast2-scanner-2.16.1.tar.bz2
New:
----
yast2-scanner-2.16.2.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-scanner.spec ++++++
--- /var/tmp/diff_new_pack.X25724/_old 2008-03-25 18:39:37.000000000 +0100
+++ /var/tmp/diff_new_pack.X25724/_new 2008-03-25 18:39:37.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-scanner (Version 2.16.1)
+# spec file for package yast2-scanner (Version 2.16.2)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -13,12 +13,12 @@
Url: http://en.opensuse.org/YaST
Name: yast2-scanner
-Version: 2.16.1
+Version: 2.16.2
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-scanner-2.16.1.tar.bz2
+Source0: yast2-scanner-2.16.2.tar.bz2
Prefix: /usr
BuildRequires: docbook-xsl-stylesheets doxygen libxslt perl-XML-Writer sgml-skel update-desktop-files yast2 yast2-devtools yast2-testsuite
Requires: yast2
@@ -43,7 +43,7 @@
Johannes Meixner
%prep
-%setup -n yast2-scanner-2.16.1
+%setup -n yast2-scanner-2.16.2
%build
%{prefix}/bin/y2tool y2autoconf
@@ -76,6 +76,13 @@
%{prefix}/lib/YaST2/bin/*scanner*
%doc %{prefix}/share/doc/packages/yast2-scanner
%changelog
+* Tue Mar 25 2008 jsmeix@suse.de
+- V 2.16.2
+- Added much better HP all-in-one device support.
+ Those devices are now autodetected at the USB and if there
+ is already a CUPS queue (the latter in particular for network
+ HP all-in-one devices which do not work without a CUPS queue)
+ and additionally hp-setup can be launched.
* Wed Mar 19 2008 jsmeix@suse.de
- V 2.16.1
- Added hint how to set up HP all-in-one network scanners
++++++ yast2-scanner-2.16.1.tar.bz2 -> yast2-scanner-2.16.2.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-scanner-2.16.1/configure new/yast2-scanner-2.16.2/configure
--- old/yast2-scanner-2.16.1/configure 2008-03-19 17:07:25.000000000 +0100
+++ new/yast2-scanner-2.16.2/configure 2008-03-25 16:14:56.000000000 +0100
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for yast2-scanner 2.16.1.
+# Generated by GNU Autoconf 2.61 for yast2-scanner 2.16.2.
#
# Report bugs to http://bugs.opensuse.org/.
#
@@ -574,8 +574,8 @@
# Identity of this package.
PACKAGE_NAME='yast2-scanner'
PACKAGE_TARNAME='yast2-scanner'
-PACKAGE_VERSION='2.16.1'
-PACKAGE_STRING='yast2-scanner 2.16.1'
+PACKAGE_VERSION='2.16.2'
+PACKAGE_STRING='yast2-scanner 2.16.2'
PACKAGE_BUGREPORT='http://bugs.opensuse.org/'
ac_unique_file="RPMNAME"
@@ -1197,7 +1197,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 yast2-scanner 2.16.1 to adapt to many kinds of systems.
+\`configure' configures yast2-scanner 2.16.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1268,7 +1268,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of yast2-scanner 2.16.1:";;
+ short | recursive ) echo "Configuration of yast2-scanner 2.16.2:";;
esac
cat <<\_ACEOF
@@ -1346,7 +1346,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-yast2-scanner configure 2.16.1
+yast2-scanner configure 2.16.2
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1360,7 +1360,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by yast2-scanner $as_me 2.16.1, which was
+It was created by yast2-scanner $as_me 2.16.2, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
@@ -2181,7 +2181,7 @@
# Define the identity of the package.
PACKAGE='yast2-scanner'
- VERSION='2.16.1'
+ VERSION='2.16.2'
cat >>confdefs.h <<_ACEOF
@@ -2408,7 +2408,7 @@
-VERSION="2.16.1"
+VERSION="2.16.2"
RPMNAME="yast2-scanner"
MAINTAINER="Johannes Meixner "
@@ -3303,7 +3303,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by yast2-scanner $as_me 2.16.1, which was
+This file was extended by yast2-scanner $as_me 2.16.2, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -3346,7 +3346,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-yast2-scanner config.status 2.16.1
+yast2-scanner config.status 2.16.2
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-scanner-2.16.1/configure.in new/yast2-scanner-2.16.2/configure.in
--- old/yast2-scanner-2.16.1/configure.in 2008-03-19 17:07:22.000000000 +0100
+++ new/yast2-scanner-2.16.2/configure.in 2008-03-25 16:14:53.000000000 +0100
@@ -3,7 +3,7 @@
dnl -- This file is generated by y2autoconf 2.15.9 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-scanner, 2.16.1, http://bugs.opensuse.org/, yast2-scanner)
+AC_INIT(yast2-scanner, 2.16.2, http://bugs.opensuse.org/, yast2-scanner)
dnl Check for presence of file 'RPMNAME'
AC_CONFIG_SRCDIR([RPMNAME])
@@ -17,7 +17,7 @@
AM_INIT_AUTOMAKE(tar-ustar) dnl searches for some needed programs
dnl Important YaST2 variables
-VERSION="2.16.1"
+VERSION="2.16.2"
RPMNAME="yast2-scanner"
MAINTAINER="Johannes Meixner "
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-scanner-2.16.1/src/dialogs.ycp new/yast2-scanner-2.16.2/src/dialogs.ycp
--- old/yast2-scanner-2.16.1/src/dialogs.ycp 2008-03-19 16:06:35.000000000 +0100
+++ new/yast2-scanner-2.16.2/src/dialogs.ycp 2008-03-25 16:24:19.000000000 +0100
@@ -4,8 +4,8 @@
* Summary: Dialogs definitions
* Authors: Johannes Meixner
*
- * $Id: dialogs.ycp 34463 2006-11-20 10:44:16Z jsmeix $
- * $Id: dialogs.ycp 34463 2006-11-20 10:44:16Z jsmeix $
+ * $Id: dialogs.ycp 45696 2008-03-25 15:24:19Z jsmeix $
+ * $Id: dialogs.ycp 45696 2008-03-25 15:24:19Z jsmeix $
*/
{
@@ -105,6 +105,11 @@
// Label of a button to test a scanner:
_("&Test")
],
+ [ `run_hpsetup,
+ // Label of a button to run hp-setup.
+ // Do not change or translate "hp-setup", it is a program name:
+ _("Run &hp-setup")
+ ],
[ `network_scanning,
// Label of a button to go to the network scanning dialog.
// Do not confuse "scanning via network"
@@ -465,9 +470,25 @@
}
/* restart the whole autodetection */
if( ret == `restart_detection )
- { // Scanner::RestartDetection results true in any case, see the function comment.
+ { // Show all USB devices with the device class 255 as possible USB scanners:
+ Scanner::ignore_unknown_USB_scanners = false;
+ // Scanner::RestartDetection results true in any case, see the function comment.
+ Scanner::RestartDetection();
+ // Exit this dialog and run it again via the sequencer in wizards.ycp
+ // to show the new autodetection results:
+ break;
+ }
+ /* run hp-setup */
+ if( ret == `run_hpsetup )
+ { // Run hp-setup and wait until it is finished before the autodetection is restarted.
+ // There is no usable exit code of hp-setup (always zero even in case of error).
+ // The hp-setup exit code does not matter because the autodetection will show
+ // an appropriate result (e.g. no HP all-in-one device if hp-setup failed):
+ Scanner::RunHpsetup();
+ // Scanner::RestartDetection results true in any case, see the function comment.
Scanner::RestartDetection();
- // Exit this dialog and run it again via the sequencer in wizards.ycp:
+ // Exit this dialog and run it again via the sequencer in wizards.ycp
+ // to show the new autodetection results:
break;
}
y2milestone( "Ignoring unexpected returncode in OverviewDialog: %1", ret );
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-scanner-2.16.1/src/helps.ycp new/yast2-scanner-2.16.2/src/helps.ycp
--- old/yast2-scanner-2.16.1/src/helps.ycp 2008-03-19 17:24:28.000000000 +0100
+++ new/yast2-scanner-2.16.2/src/helps.ycp 2008-03-25 16:24:19.000000000 +0100
@@ -4,7 +4,7 @@
* Summary: Help texts of all the dialogs
* Authors: Johannes Meixner
*
- * $Id: helps.ycp 45625 2008-03-19 16:24:28Z jsmeix $
+ * $Id: helps.ycp 45696 2008-03-25 15:24:19Z jsmeix $
*/
{
@@ -47,16 +47,22 @@
// Do not change or translate "HP", it is a manufacturer name.
// Do not change or translate "OfficeJet", it is a model name.
// Do not change or translate "PSC", it is a model (Printer Scanner Copier) name.
+// Do not change or translate "hp-setup", it is a command name.
// Do not change or translate "lsusb", it is a command name.
_("<p>
A normal USB scanner should be detected automatically.
-It might happen that particular USB devices which are no scanners are shown too
-because it is not possible to reliably distinguish a scanner from any other USB device.
-If it was not detected or if there are unexpected results,
+By default only those USB scanners are shown
+for which the UDB vendor and product IDs are known.
+If a USB scanner is not shown or if there are unexpected results,
try <b>Other</b> and <b>Restart Detection</b>.
+Then it might happen that particular USB devices which are no scanners
+are shown too because then all USB devices which might be scanners are shown.
+The reason is that there is no generic way to reliably distinguish a scanner
+from other USB devices because there is no USB device class for scanners.
It may also work to proceed with <b>Add</b>.
-In particular, HP all-in-one devices, such as OfficeJets and PSCs,
-are not detected, but can be configured this way.
+For HP all-in-one devices you may have to run <tt>hp-setup</tt>
+via <b>Other</b> and <b>Run hp-setup</b> before it works
+to configure the scanner unit with this tool.
If you have difficulties configuring your scanner here,
check whether it appears in the output of <tt>lsusb</tt>.
If it is not listed there, the USB system cannot communicate with the scanner.
@@ -71,9 +77,15 @@
Verify that an appropriate kernel module for the SCSI host adapter has been loaded.
</p>") +
// Overview dialog help 5/8:
+// Do not change or translate "hp-setup", it is a command name.
_("<p>
-Parallel port scanners cannot be configured with this tool.
-These devices must be configured manually.
+Parallel port scanners cannot be configured with this tool
+except for HP all-in-one devices.
+Usual parallel port scanners must be configured manually.
+To set up the scanner unit in a HP all-in-one device
+which is connected to the parallel port,
+you may have to run <tt>hp-setup</tt> via <b>Other</b> and <b>Run hp-setup</b>
+before it works to configure the scanner unit with this tool using <b>Add</b>.
</p>") +
// Overview dialog help 6/8:
// Do not confuse a "network scanner" (i.e. a scanner which is directly accessible in the network)
@@ -92,8 +104,8 @@
connected to another host in the network.
To set up the scanner unit in a HP all-in-one device
which is connected via a built-in network interface,
-first run <tt>hp-setup</tt> as root, then you can configure
-the scanner unit with this tool using <b>Add</b>.
+you may have to run <tt>hp-setup</tt> via <b>Other</b> and <b>Run hp-setup</b>
+before it works to configure the scanner unit with this tool using <b>Add</b>.
</p>") +
// Overview dialog help 7/8:
// Do not confuse "scanning via network" (i.e. use a remote scanner via another host in the network)
@@ -101,12 +113,14 @@
// It is not possible to modify or remove an active scanner directly.
// It is only possible to modify or remove a driver and this way
// all scanners which are associated with this driver are modified or removed.
+// Do not change or translate "hp-setup", it is a command name.
_("<p>
The table lists the configured drivers with their associated scanners.
-Press <b>Edit</b> to modify a driver.
-Press <b>Delete</b> to remove a driver.
-If you press <b>Other</b>, you can
-restart the detection, test active scanners, or set up scanning via network.
+Press <b>Add</b> to select model and driver and enable it.
+Press <b>Edit</b> to select and enable a driver.
+Press <b>Delete</b> to disable the driver.
+If you press <b>Other</b>, you can restart the detection, test enabled drivers,
+set up HP all-in-one devices, or set up scanning via network.
</p>") +
// Overview dialog help 8/8:
// The most often problem which is reported by users regarding scanner setup is
@@ -212,9 +226,9 @@
HP all-in-one devices require a special setup.
In this case, an appropriate dialog is shown.
There are two software packages that provide support for HP all-in-one devices:
-the old HPOJ software (package hp-officeJet),
+the outdated HPOJ software (package hp-officeJet),
which provides the PTAL system (with the ptal service) to access HP all-in-one devices,
-and the new HPLIP software (package hplip),
+and the up-to-date HPLIP software (package hplip),
which provides the hplip service to access HP all-in-one devices.
Both software packages can be installed at the same time
but the services cannot be run together.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-scanner-2.16.1/src/Scanner.ycp new/yast2-scanner-2.16.2/src/Scanner.ycp
--- old/yast2-scanner-2.16.1/src/Scanner.ycp 2008-03-19 17:24:28.000000000 +0100
+++ new/yast2-scanner-2.16.2/src/Scanner.ycp 2008-03-25 16:24:19.000000000 +0100
@@ -4,7 +4,7 @@
* Summary: Scanner settings, input and output functions
* Authors: Johannes Meixner
*
- * $Id: Scanner.ycp 45625 2008-03-19 16:24:28Z jsmeix $
+ * $Id: Scanner.ycp 45696 2008-03-25 15:24:19Z jsmeix $
*
* Representation of the configuration of scanner.
* Input and output routines.
@@ -61,6 +61,23 @@
// Define all variables needed for configuration of scanner:
/**
+ * Explicite listing of all alphanumeric ASCII characters.
+ * The reason is that in certain special locales for example [a-z] is not equivalent
+ * to "abcdefghijklmnopqrstuvwxyz" because in certain special languages the 'z' is
+ * not the last character in the alphabet, e.g. the Estonian alphabet ends
+ * with ... s ... z ... t u v w ... x y (non-ASCII characters omitted here)
+ * so that [a-z] would exclude t u v w x y in an Estonian locale.
+ * Therefore uppercase and lowercase characters are both explicitely listed
+ * to avoid any unexpected result e.g. of "tolower(uppercase_characters)".
+ */
+global string number_chars = "0123456789";
+global string upper_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+global string lower_chars = "abcdefghijklmnopqrstuvwxyz";
+global string letter_chars = upper_chars + lower_chars;
+global string alnum_chars = number_chars + letter_chars;
+global string lower_alnum_chars = number_chars + lower_chars;
+
+/**
* Scanner database:
* When package version of sane-backends/hplip/hp-officeJet/iscan/iscan-free changes
* the database is created anew in Scanner::Read() which calls the bash script
@@ -90,6 +107,14 @@
global list< string > database_manufacturers = [];
/**
+ * Known USB scanner USB IDs list:
+ * List of known USB scanner USB vendor and product IDs.
+ * Derived during startup from the scanner database
+ * (in the Read function stage "Read or create the scanner database").
+ */
+global list< string > database_usbids = [];
+
+/**
* Active scanners:
* Determined at runtime via Scanner::DetermineActiveScanners() which calls the bash script
* "/usr/lib/YaST2/bin/determine_active_scanners YCP"
@@ -116,8 +141,9 @@
/**
* Autodetected scanners:
- * Determined at runtime via Scanner::AutodetectScanners() which calls the bash script
- * "/usr/lib/YaST2/bin/autodetect_scanners YCP" which calls "sane-find-scanner"
+ * Determined at runtime via Scanner::AutodetectScanners()
+ * which calls the bash script /usr/lib/YaST2/bin/autodetect_scanners YCP
+ * which calls "sane-find-scanner" and (if available) "hp-probe"
* which may result for example the description strings in the example below.
* Only in case of USB an automated extraction of manufacturer is possible.
* If there are two '[...]' substrings then the first one is the manufacturer
@@ -125,7 +151,7 @@
* The result is a YCP list of @ref autodetected_scanner_map
* where the last list entry is an emtpy map.
* @struct autodetected_scanner_map
- * $[ "connection":"Either USB or SCSI (required)",
+ * $[ "connection":"Either USB or SCSI or NETWORK (required)",
* "device":"The device, e.g. '/dev/sg0' or 'libusb:001:002' (may be the empty string)"
* "manufacturer":"The manufacturer name of the scanner (may be the empty string)",
* "usb_vendor_id":"The vendor ID (e.g. 0x04b8) of a USB scanner (may be the empty string)",
@@ -139,6 +165,8 @@
* USB scanner (vendor=0x03f0 [Hewlett-Packard], product=0x0201 [HP ScanJet 6200C]) at libusb:002:006
* USB scanner (vendor=0x04a9 [Canon], product=0x220e [CanoScan], chip=LM9832/3) at libusb:001:005
* USB scanner (vendor=0x04b8 [EPSON], product=0x010b [Perfection1240]) at libusb:001:004
+ * USB scanner (vendor=0x03f0 [HP], product=0x0000 [HP LaserJet 1220])
+ * NETWORK scanner (vendor [HP], product [Officejet 7200 series])
*/
global list< map< string, string > > autodetected_scanners = [];
@@ -215,6 +243,19 @@
*/
global integer selected_autodetected_scanners_index = -1;
+/**
+ * Ignore unknown USB scanners:
+ * Whether or not unknown USB scanners should be ignored during AutodetectScanners.
+ * As there is no USB device class for scanners (they have the unspecific USB device class 255),
+ * sane-find-scanner can only do some best guess to determine if a USB device is a scanner or not.
+ * Therefore also other USB devices with the device class 255 are reported as possible USB scanners.
+ * Preset to true so that only scanners for which the USB IDs are known by SANE are shown by default.
+ * It changes to false (i.e. show all USB devices with the device class 255 as possible USB scanners)
+ * when the user has explicitely requested a "Restart Detection" in the OverviewDialog.
+ * It is neither somehow automatically reset to true nor can the user reset it manually to true.
+ */
+global boolean ignore_unknown_USB_scanners = true;
+
/*
* Local variables:
*/
@@ -253,6 +294,15 @@
*/
/**
+ * Unify various kind of a hexadecimal string like
+ * "0x01a2", "0x1A2", "0x01A2" to one kind "0x1a2"
+ * so that string comparison is possible:
+ */
+string UnifyHexString( string hexstring )
+{ return tolower( tohexstring( tointeger( hexstring ) ) );
+}
+
+/**
* Wrapper for SCR::Execute to execute a bash command to increase verbosity via y2milestone.
* It reports the command via y2milestone in any case and it reports exit code, stdout
* and stderr via y2milestone in case of non-zero exit code.
@@ -278,7 +328,7 @@
* @return string of a meaningful error message with preceding "The error message is:" or "" otherwise
*/
string OnlyMeaningfulErrorMessage( string error_message )
-{ if ( "" != filterchars( tolower( error_message ), "abcdefghijklmnopqrstuvwxyz" ) )
+{ if( "" != filterchars( error_message, letter_chars ) )
{ return sformat( // Only a simple message because it is only used
// to add a preceding "The error message is:" comment
// to display an error message where
@@ -508,8 +558,9 @@
}
/**
- * Try to autodetect USB and SCSI scanners by calling a bash script
- * which calls "sane-find-scanner" and processes its output
+ * Try to autodetect USB and SCSI scanners and HP all-in-one USB and NETWORK scanners
+ * by calling a bash script which calls "sane-find-scanner"
+ * and (if available) "hp-probe" and processes its output
* and stores the results as YCP list in a temporary file
* and then read the temporary file (SCR::Read)
* to get the YCP list of @ref autodetected_scanner_map
@@ -550,6 +601,28 @@
autodetected_scanners = [];
return false;
}
+ if( ignore_unknown_USB_scanners )
+ { // Entries in autodetected_scanners are skipped in OverviewContents() if the description is empty.
+ // Therefore for unknown USB scanners the description is set to the empty string.
+ integer autodetected_scanners_index = -1;
+ foreach( map< string, string > autodetected_scanner,
+ autodetected_scanners,
+ { // Set the autodetected_scanners_index to the index number
+ // of the actual autodetected_scanner in autodetected_scanners:
+ autodetected_scanners_index = autodetected_scanners_index + 1;
+ // Use local variables to have shorter variable names:
+ string usb_vendor_id = autodetected_scanner["usb_vendor_id"]:"";
+ string usb_product_id = autodetected_scanner["usb_product_id"]:"";
+ if( "" != usb_vendor_id && "" != usb_product_id )
+ { string usb_id = UnifyHexString( usb_vendor_id ) + ":" + UnifyHexString( usb_product_id );
+ if( ! contains( database_usbids, usb_id ) )
+ { autodetected_scanners[autodetected_scanners_index,"description"] = "";
+ y2milestone( "No USB ID in database for %1", autodetected_scanner );
+ }
+ }
+ }
+ );
+ }
y2milestone( "Autodetected scanners: %1", autodetected_scanners );
return true;
}
@@ -634,7 +707,7 @@
* - Read or create the scanner database
* - Determine active scanners
* - Determine active backends
- * - Try to autodetect USB and SCSI scanners
+ * - Try to autodetect USB and SCSI scanners and HP all-in-one USB and NETWORK scanners
* @return true on success
*/
global boolean Read()
@@ -652,7 +725,7 @@
// 4. progress stage name of a Progress::New:
_("Determine active drivers"),
// 5. progress stage name of a Progress::New:
- _("Detect USB and SCSI scanners")
+ _("Detect scanners")
],
[ // 1. progress step progress bar title of a Progress::New:
_("Checking installed packages..."),
@@ -663,7 +736,7 @@
// 4. progress step progress bar title of a Progress::New:
_("Determining active drivers..."),
// 5. progress step progress bar title of a Progress::New:
- _("Detecting USB and SCSI scanners..."),
+ _("Detecting scanners..."),
// Last progress step progress bar title of a Progress::New:
_("Finished")
],
@@ -742,13 +815,25 @@
);
return false;
}
- // Extract a (sorted) list of unique manufacturer names from the scanner database:
+ // Extract a (sorted) list of unique manufacturer names and
+ // another list of known USB scanner USB vendor and product IDs
+ // from the scanner database.
+ // The latter makes sense because it is needed in AutodetectScanners
+ // because ignore_unknown_USB_scanners is set to true by default.
+ string usbid = "";
+ list< string > ids = [];
foreach( map< string, string > database_entry,
database,
{ database_manufacturers = add( database_manufacturers, database_entry["manufacturer"]:"unknown" );
+ usbid = tolower( database_entry["usbid"]:"" );
+ if( regexpmatch( usbid, "0x[0-9a-f]+:0x[0-9a-f]+" ) )
+ { ids = splitstring( usbid, ":" );
+ database_usbids = add( database_usbids, UnifyHexString( ids[0]:"" ) + ":" + UnifyHexString( ids[1]:"" ) );
+ }
}
);
database_manufacturers = toset( database_manufacturers );
+ database_usbids = toset( database_usbids );
// Progress 3. stage (Determine active scanners):
if( Abort() ) return false;
Progress::NextStage();
@@ -761,7 +846,7 @@
if( ! DetermineActiveBackends() )
{ active_backends = [];
}
- // Progress 5. stage (Detect USB and SCSI scanners):
+ // Progress 5. stage (Detect scanners):
if( Abort() ) return false;
Progress::NextStage();
if( ! AutodetectScanners() )
@@ -783,7 +868,7 @@
"",
// Busy message:
// Body of a Popup::ShowFeedback:
- _("Detecting USB and SCSI scanners...")
+ _("Detecting scanners...")
);
// Wait 10 seconds:
sleep( 10000 );
@@ -857,7 +942,7 @@
"",
// Busy message:
// Body of a Popup::ShowFeedback:
- _("Detecting USB and SCSI scanners...")
+ _("Detecting scanners...")
);
if( ! DetermineActiveScanners() )
{ active_scanners = [];
@@ -873,6 +958,24 @@
}
/**
+ * Run hp-setup:
+ * @return true in any case because there is no usable exit code of hp-setup
+ * (always zero even in case of error).
+ */
+global boolean RunHpsetup()
+{ Popup::ShowFeedback( // No title for a simple busy message:
+ "",
+ // Busy message:
+ // Body of a Popup::ShowFeedback.
+ // Do not change or translate "hp-setup", it is a program name:
+ _("Running hp-setup...")
+ );
+ ExecuteBashCommand( "/usr/bin/hp-setup" );
+ Popup::ClearFeedback();
+ return true;
+}
+
+/**
* Create the content for WizardHW::SetContents
* @return a list of maps with keys
* "id" : string = the identification of the device,
@@ -916,15 +1019,39 @@
if( "" != description )
{ // Test whether the autodetected_scanner is one of the active_scanners
// except remote active scanners which are accessed via the "net" meta-backend.
- // If yes, then there is no need to set it up again
+ // For HP all-in-one devices the device entry is empty
+ // (therefore the test for non-empty device before the substring test)
+ // but here the model entry is a substring of the sane_device, for example
+ // "HP LaserJet 1220" in "hpaio:/usb/HP_LaserJet_1220?serial=00XXXXXXXXXX"
+ // "Officejet 7200 series" in "hpaio:/net/Officejet_7200_series?ip=10.10.100.100"
+ // which shows that it is crucial to unify both strings before the substring test.
+ // Even if there are two "HP_LaserJet_1220" connected to the USB
+ // or two "Officejet_7200_series" with different IP addresses,
+ // this should work correctly because once the hpaio driver is activated
+ // it recognizes all HP all-in-one devices which have a CUPS queue
+ // but only those are autodetected, see the autodetect_scanners script.
+ // If an autodetected_scanner is one of the active_scanners,
+ // there is no need to set it up again
// and then don't show it in the list of detected_scanners:
boolean show_as_detected_scanner = true;
foreach( map< string, string > active_scanner,
active_scanners,
- { if( issubstring( active_scanner["sane_device"]:"unknown", device )
- && "net" != active_scanner["backend"]:""
- )
- { show_as_detected_scanner = false;
+ { string backend = active_scanner["backend"]:"";
+ string sane_device = active_scanner["sane_device"]:"unknown";
+ if( "net" != backend )
+ { if( ( "hpaio" != backend
+ && "" != device
+ && issubstring( sane_device, device )
+ )
+ || ( "hpaio" == backend
+ && "" != model
+ && issubstring( filterchars( tolower( sane_device ), alnum_chars ),
+ filterchars( tolower( model ), alnum_chars )
+ )
+ )
+ )
+ { show_as_detected_scanner = false;
+ }
}
}
);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-scanner-2.16.1/src/wizards.ycp new/yast2-scanner-2.16.2/src/wizards.ycp
--- old/yast2-scanner-2.16.1/src/wizards.ycp 2008-03-19 16:06:35.000000000 +0100
+++ new/yast2-scanner-2.16.2/src/wizards.ycp 2008-03-25 16:24:19.000000000 +0100
@@ -4,7 +4,7 @@
* Summary: Wizards definitions
* Authors: Johannes Meixner
*
- * $Id: wizards.ycp 24754 2005-08-09 14:56:41Z jsrain $
+ * $Id: wizards.ycp 45696 2008-03-25 15:24:19Z jsmeix $
*/
{
@@ -66,7 +66,8 @@
`delete: "overview",
`test: "overview",
`restart_detection: "overview",
- `network_scanning: "network"
+ `network_scanning: "network",
+ `run_hpsetup: "overview"
],
"configure": $[ `abort: `abort,
`next: "overview"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-scanner-2.16.1/tools/autodetect_scanners new/yast2-scanner-2.16.2/tools/autodetect_scanners
--- old/yast2-scanner-2.16.1/tools/autodetect_scanners 2008-03-19 16:06:34.000000000 +0100
+++ new/yast2-scanner-2.16.2/tools/autodetect_scanners 2008-03-25 14:57:03.000000000 +0100
@@ -20,16 +20,16 @@
TMP_DATA=$(mktemp -u /tmp/$MY_NAME.XXXXXX)
TMP_DATA_RAW=$(mktemp -u /tmp/$MY_NAME.XXXXXX)
-# Get the raw data
+# Get the raw data for usual scanners via "sane-find-scanner":
MAXIMUM_WAIT="10"
if [ -x /usr/bin/sane-find-scanner ]
then sane-find-scanner -q >$TMP_DATA_RAW &
sanefindscannerPID=$!
for i in $( seq $MAXIMUM_WAIT )
- do ps hp $sanefindscannerPID | grep -q sane-find-scanner || break
+ do ps $sanefindscannerPID &>/dev/null || break
sleep 1
done
- if ps hp $sanefindscannerPID | grep -q sane-find-scanner
+ if ps $sanefindscannerPID &>/dev/null
then kill -9 $sanefindscannerPID &>/dev/null
fi
else echo "Cannot execute /usr/bin/sane-find-scanner" 1>&2
@@ -38,6 +38,42 @@
# Only USB and SCSI scanners are taken into account:
egrep '^found SCSI |^found USB ' <$TMP_DATA_RAW | sort -u | sed -e 's/^found //' | tr \" \' >$TMP_DATA
+# Append the raw data for HP all-in-one devices via "hp-probe -bcups -escan".
+# Because a CUPS queue is a precondition for scanning
+# (the hpaio backend derives its SANE device from the CUPS DeviceURI),
+# only those devices are taken into account for which a CUPS queue exists.
+# It is no fatal error if /usr/bin/hp-probe is not executable
+# (e.g. when the hplip RPM is not installed because no HP device is used):
+MAXIMUM_WAIT="10"
+if [ -x /usr/bin/hp-probe ]
+then hp-probe -busb -escan | tr -s '[:blank:]' | grep 'hp:/usb/' >$TMP_DATA_RAW &
+ hpprobePID=$!
+ for i in $( seq $MAXIMUM_WAIT )
+ do ps $hpprobePID &>/dev/null || break
+ sleep 1
+ done
+ if ps $hpprobePID &>/dev/null
+ then kill -9 $hpprobePID &>/dev/null
+ fi
+ hp-probe -bcups -escan | tr -s '[:blank:]' | grep 'hp:/net/' >>$TMP_DATA_RAW &
+ hpprobePID=$!
+ for i in $( seq $MAXIMUM_WAIT )
+ do ps $hpprobePID &>/dev/null || break
+ sleep 1
+ done
+ if ps $hpprobePID &>/dev/null
+ then kill -9 $hpprobePID &>/dev/null
+ fi
+ # Remove leading and trailing spaces:
+ sed -i -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' $TMP_DATA_RAW
+ # Convert entries with 'hp:/usb/...' DeviceURI to the 'USB scanner' syntax of "sane-find-scanner":
+ sed -i -e 's|^hp:/usb/[^ ]* \(.*\)|USB scanner (vendor=0x03f0 [HP], product=0x0000 [\1])|' $TMP_DATA_RAW
+ # Convert entries with 'hp:/net/...' DeviceURI to a new 'NETWORK scanner' syntax:
+ sed -i -e 's|^hp:/net/[^ ]* \(.*\)|NETWORK scanner (vendor [HP], product [\1])|' $TMP_DATA_RAW
+ # Append the HP all-in-one device entries:
+ sort -u $TMP_DATA_RAW >>$TMP_DATA
+fi
+
# Output:
# Output header:
@@ -49,27 +85,37 @@
# Output scanner entries:
exec <$TMP_DATA
while read DESCRIPTION
-do echo $DESCRIPTION | grep -q '^USB ' && CONNECTION="USB" || CONNECTION="SCSI"
- DEVICE=$( echo $DESCRIPTION | sed -e 's/.* at \(.*\)/\1/' )
+do echo $DESCRIPTION | grep -q '^USB ' && CONNECTION="USB"
+ echo $DESCRIPTION | grep -q '^SCSI ' && CONNECTION="SCSI"
+ echo $DESCRIPTION | grep -q '^NETWORK ' && CONNECTION="NETWORK"
+ DEVICE=$( echo $DESCRIPTION | sed -n -e 's/.* at \(.*\)/\1/p' )
MANUFACTURER=""
MODEL=""
USB_VENDOR_ID=""
USB_PRODUCT_ID=""
if [ "$CONNECTION" = "USB" ]
- then MODEL=$( echo $DESCRIPTION | tr '[]' '||' | cut -d '|' -s -f 4 )
+ then MODEL=$( echo $DESCRIPTION | tr '[]' '||' | cut -d '|' -s -f 4 | tr '_' ' ' )
[ -n "$MODEL" ] && MANUFACTURER=$( echo $DESCRIPTION | tr '[]' '||' | cut -d '|' -s -f 2 )
USB_VENDOR_ID=$( echo $DESCRIPTION | sed -n -e 's/^.*vendor=\(0x[0-9A-Fa-f][0-9A-Fa-f]*\).*$/\1/p' | tr '[:upper:]' '[:lower:]' )
USB_PRODUCT_ID=$( echo $DESCRIPTION | sed -n -e 's/^.*product=\(0x[0-9A-Fa-f][0-9A-Fa-f]*\).*$/\1/p' | tr '[:upper:]' '[:lower:]' )
- else # For SCSI: Simply use the first word as manufacturer name.
+ fi
+ if [ "$CONNECTION" = "SCSI" ]
+ then # For SCSI: Simply use the first word as manufacturer name.
# This is a keep-it-simple attempt because a few SCSI scanners
# may report a two-word manufacturer name on the SCSI bus
# (e.g. something like "Across Technologies" or "Linotype Hell").
# Note that " was changed to ' when TMP_DATA was created above.
MANUFACTURER=$( echo $DESCRIPTION | cut -d \' -s -f 2 | cut -d ' ' -s -f1 )
- # For HP set the name which is used in the SANE description files:
- if [ "$MANUFACTURER" = "HP" -o "$MANUFACTURER" = "hp" ]
- then MANUFACTURER="Hewlett-Packard"
- fi
+ fi
+ if [ "$CONNECTION" = "NETWORK" ]
+ then # Currently this connection happens only for HP all-in-one devices
+ # and then the syntax of an entry is like for a USB scanner:
+ MODEL=$( echo $DESCRIPTION | tr '[]' '||' | cut -d '|' -s -f 4 | tr '_' ' ' )
+ [ -n "$MODEL" ] && MANUFACTURER=$( echo $DESCRIPTION | tr '[]' '||' | cut -d '|' -s -f 2 )
+ fi
+ # For HP set the name which is used in the SANE description files:
+ if [ "$MANUFACTURER" = "HP" -o "$MANUFACTURER" = "hp" ]
+ then MANUFACTURER="Hewlett-Packard"
fi
if [ "$OUTPUT_FORMAT" = "YCP" ]
then echo -e " \$[ \"connection\":\"$CONNECTION\",\n \"device\":\"$DEVICE\",\n \"manufacturer\":\"$MANUFACTURER\",\n \"usb_vendor_id\":\"$USB_VENDOR_ID\",\n \"model\":\"$MODEL\",\n \"usb_product_id\":\"$USB_PRODUCT_ID\",\n \"description\":\"$DESCRIPTION\"\n ],"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-scanner-2.16.1/tools/test_and_set_scanner_access_permissions new/yast2-scanner-2.16.2/tools/test_and_set_scanner_access_permissions
--- old/yast2-scanner-2.16.1/tools/test_and_set_scanner_access_permissions 2008-03-19 16:06:34.000000000 +0100
+++ new/yast2-scanner-2.16.2/tools/test_and_set_scanner_access_permissions 2008-03-19 18:06:55.000000000 +0100
@@ -24,7 +24,8 @@
# Get the raw data (i.e. the SANE devices for the active scanners).
# Either it is specified as command line parameter $1
# (this is how YaST calls it to avoid duplicate time-consuming "scanimage" calls
-# because it knows the SANE devices from its determine_active_scanners call)
+# because it knows the SANE devices from its determine_active_scanners call
+# note that YaST calls it with all SANE devices just like "scanimage -f '%d;'")
# or (if $1 is empty) then run "scanimage" to determine the SANE devices:
if [ -n "$1" ]
then echo "$1" >$TMP_DATA_RAW
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-scanner-2.16.1/VERSION new/yast2-scanner-2.16.2/VERSION
--- old/yast2-scanner-2.16.1/VERSION 2008-03-19 17:07:14.000000000 +0100
+++ new/yast2-scanner-2.16.2/VERSION 2008-03-25 16:14:48.000000000 +0100
@@ -1 +1 @@
-2.16.1
+2.16.2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org