Hello community,
here is the log from the commit of package yast2-printer
checked in at Fri Nov 21 15:59:11 CET 2008.
--------
--- yast2-printer/yast2-printer.changes 2008-11-20 15:54:21.000000000 +0100
+++ /mounts/work_src_done/STABLE/yast2-printer/yast2-printer.changes 2008-11-21 09:52:47.463897000 +0100
@@ -1,0 +2,12 @@
+Fri Nov 21 09:43:00 CET 2008 - jsmeix@suse.de
+
+- Avoid that the hardware proposal asks the user to install
+ the packages cups-client and cups and skip the hardware
+ proposal if one of those packages is missing
+ (see Novell/Suse Bugzilla bnc#445719)
+ but make sure that when the full printer module is launched
+ from the hardware proposal it asks the user to install
+ the packages cups-client and cups.
+- 2.17.44
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
yast2-printer-2.17.43.tar.bz2
New:
----
yast2-printer-2.17.44.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-printer.spec ++++++
--- /var/tmp/diff_new_pack.U16036/_old 2008-11-21 15:58:09.000000000 +0100
+++ /var/tmp/diff_new_pack.U16036/_new 2008-11-21 15:58:09.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-printer (Version 2.17.43)
+# spec file for package yast2-printer (Version 2.17.44)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -20,12 +20,12 @@
Url: http://en.opensuse.org/YaST/Modules/Printer
Name: yast2-printer
-Version: 2.17.43
+Version: 2.17.44
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-printer-2.17.43.tar.bz2
+Source0: yast2-printer-2.17.44.tar.bz2
Prefix: /usr
BuildRequires: cups-devel update-desktop-files yast2 yast2-core-devel yast2-devtools yast2-testsuite
Recommends: netcat
@@ -64,7 +64,7 @@
Michal Zugec
%prep
-%setup -n yast2-printer-2.17.43
+%setup -n yast2-printer-2.17.44
%build
%{prefix}/bin/y2tool y2autoconf
@@ -118,6 +118,15 @@
%exclude %{prefix}/share/doc/packages/yast2-printer/COPYING
%exclude %{prefix}/share/doc/packages/yast2-printer/README
%changelog
+* Fri Nov 21 2008 jsmeix@suse.de
+- Avoid that the hardware proposal asks the user to install
+ the packages cups-client and cups and skip the hardware
+ proposal if one of those packages is missing
+ (see Novell/Suse Bugzilla bnc#445719)
+ but make sure that when the full printer module is launched
+ from the hardware proposal it asks the user to install
+ the packages cups-client and cups.
+- 2.17.44
* Thu Nov 20 2008 jsmeix@suse.de
- Fixed how to avoid to autoconfigure multiple queues for
the same printer. It is now based upon the URI which is
++++++ yast2-printer-2.17.43.tar.bz2 -> yast2-printer-2.17.44.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.17.43/configure new/yast2-printer-2.17.44/configure
--- old/yast2-printer-2.17.43/configure 2008-11-20 15:44:10.000000000 +0100
+++ new/yast2-printer-2.17.44/configure 2008-11-21 09:47:18.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-printer 2.17.43.
+# Generated by GNU Autoconf 2.61 for yast2-printer 2.17.44.
#
# Report bugs to http://bugs.opensuse.org/.
#
@@ -574,8 +574,8 @@
# Identity of this package.
PACKAGE_NAME='yast2-printer'
PACKAGE_TARNAME='yast2-printer'
-PACKAGE_VERSION='2.17.43'
-PACKAGE_STRING='yast2-printer 2.17.43'
+PACKAGE_VERSION='2.17.44'
+PACKAGE_STRING='yast2-printer 2.17.44'
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-printer 2.17.43 to adapt to many kinds of systems.
+\`configure' configures yast2-printer 2.17.44 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-printer 2.17.43:";;
+ short | recursive ) echo "Configuration of yast2-printer 2.17.44:";;
esac
cat <<\_ACEOF
@@ -1346,7 +1346,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-yast2-printer configure 2.17.43
+yast2-printer configure 2.17.44
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-printer $as_me 2.17.43, which was
+It was created by yast2-printer $as_me 2.17.44, 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-printer'
- VERSION='2.17.43'
+ VERSION='2.17.44'
cat >>confdefs.h <<_ACEOF
@@ -2409,7 +2409,7 @@
-VERSION="2.17.43"
+VERSION="2.17.44"
RPMNAME="yast2-printer"
MAINTAINER="Michal Zugec "
@@ -3304,7 +3304,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by yast2-printer $as_me 2.17.43, which was
+This file was extended by yast2-printer $as_me 2.17.44, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -3347,7 +3347,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-yast2-printer config.status 2.17.43
+yast2-printer config.status 2.17.44
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-printer-2.17.43/configure.in new/yast2-printer-2.17.44/configure.in
--- old/yast2-printer-2.17.43/configure.in 2008-11-20 15:44:05.000000000 +0100
+++ new/yast2-printer-2.17.44/configure.in 2008-11-21 09:47:14.000000000 +0100
@@ -3,7 +3,7 @@
dnl -- This file is generated by y2autoconf 2.16.7 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-printer, 2.17.43, http://bugs.opensuse.org/, yast2-printer)
+AC_INIT(yast2-printer, 2.17.44, http://bugs.opensuse.org/, yast2-printer)
dnl Check for presence of file 'RPMNAME'
AC_CONFIG_SRCDIR([RPMNAME])
@@ -18,7 +18,7 @@
AM_INIT_AUTOMAKE(tar-ustar -Wno-portability)
dnl Important YaST2 variables
-VERSION="2.17.43"
+VERSION="2.17.44"
RPMNAME="yast2-printer"
MAINTAINER="Michal Zugec "
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.17.43/src/Printerlib.ycp new/yast2-printer-2.17.44/src/Printerlib.ycp
--- old/yast2-printer-2.17.43/src/Printerlib.ycp 2008-11-19 17:06:05.000000000 +0100
+++ new/yast2-printer-2.17.44/src/Printerlib.ycp 2008-11-21 08:22:40.000000000 +0100
@@ -82,14 +82,16 @@
* and if yes then install it (Package::Install) if it is not yet installed or
* remove the package (Package::Remove) if it is installed.
* @param package_name string of the package name
- * @param package_name string of the action to be done (installed or install or remove).
+ * @param action string of the action to be done (installed or install or remove).
* @return true on success
*/
global boolean TestAndInstallPackage( string package_name, string action )
{ y2milestone( "TestAndInstallPackage '%1' with action '%2'", package_name, action );
// Intentionally Package::Installed(package_name) is not used here
- // because it does 'rpm -q' and if this fails 'rpm -q --whatprovides'
- // but I am only interested in real package names here.
+ // because it does 'rpm -q' and if this fails it does 'rpm -q --whatprovides'
+ // but I am only interested in the result for the real package name here
+ // because alternatives would be handled in the upper-level functions
+ // (e.g. in the user dialogs) which call TestAndInstallPackage:
if( "installed" == action )
{ if( ExecuteBashCommand( "rpm -q '" + package_name + "'" ) )
{ y2milestone( "TestAndInstallPackage: package '%1' is installed", result["stdout"]:package_name );
@@ -97,7 +99,7 @@
}
// The "%1" makes the YCP Parser happy, otherwise it shows the warning
// "Format string is not constant, no parameter checking possible".
- y2milestone( "TestAndInstallPackage: %1", result["stdout"]:"TestAndInstallPackage: package is not installed" );
+ y2milestone( "TestAndInstallPackage: %1", result["stdout"]:"package is not installed" );
return false;
}
if( "install" == action )
@@ -177,14 +179,19 @@
// (the user may have intentionally accepted whatever package conflict).
// Furthermore Package::Remove(package_name) does additionally install
// whatever other packages for example to "automatically solve" whatever
- // kind of RPM soft requirements (Recommends) for other packages.
- // I am only interested to remove exactly the one package which was specified
- // and I am not interested to get whatever replacement package installed.
+ // kind of soft requirements (Recommends) for other packages.
+ // I am only interested to remove exactly the one package which was specified and
+ // I am not interested to get whatever replacement package installed automatically
+ // because alternatives and/or substitutes would be handled in the upper-level functions
+ // (e.g. in the user dialogs) which call TestAndInstallPackage.
// Usually (i.e. in a openSUSE standard system) the packages which are removed here
// do not have dependencies or the calling function removes dependant packages
// in the right order (e.g. first hplip and then hplip-hpijs, see driveradd.ycp)
// but the user might have installed whatever third-party packages
// which could have dependencies to the package which should be removed here.
+ // Therefore there is a test if the removal would break RPM dependencies
+ // but intentionally it is not tested whether the removal
+ // would "break" whatever kind of soft requirements (Recommends).
if( ! ExecuteBashCommand( "rpm -e --test '" + package_name + "'" ) )
{ // There is no Popup::ContinueCancelHeadlineDetails available.
// Therefore the exact RPM message is shown via a separated Popup::ErrorDetails.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.17.43/src/printer_proposal.ycp new/yast2-printer-2.17.44/src/printer_proposal.ycp
--- old/yast2-printer-2.17.43/src/printer_proposal.ycp 2008-11-20 15:29:28.000000000 +0100
+++ new/yast2-printer-2.17.44/src/printer_proposal.ycp 2008-11-21 09:42:22.000000000 +0100
@@ -57,195 +57,245 @@
string warning = nil;
symbol warning_level = nil;
boolean force_reset = param["force_reset"]:false;
-
if( force_reset || ! Printer::proposal_valid )
{ Printer::proposal_valid = true;
- boolean progress_orig = Progress::set( false );
- Printer::Read();
- Progress::set( progress_orig );
+ // Do not call Printer::Read() here to
+ // avoid that the hardware proposal asks the user
+ // to install the packages cups-client and cups, see
+ // https://bugzilla.novell.com/show_bug.cgi?id=445719#c13
+ //boolean progress_orig = Progress::set( false );
+ //Printer::Read();
+ //Progress::set( progress_orig );
+ y2milestone("Not calling Printer::Read() to avoid that the proposal asks to install cups-client and cups.");
}
-
- // Propose configuration for each local printer
+ // Propose configuration for each local printer:
// TODO: replace by cups-autoconfig
-
- // Determine whether or not it is currently a real client-only config
- // (i.e. a ServerName != "localhost/127.0.0.1" in /etc/cups/client.conf)
- // and ignore when it fails (i.e. use the fallback value silently):
- Printerlib::DetermineClientOnly();
- // Skip automated queue setup when it is a client-only config:
- if( ! Printerlib::client_only )
- { // Determine whether or not a local cupsd is accessible:
- if( ! Printerlib::GetAndSetCupsdStatus( "" ) )
- { // Only in the second stage of the system installation
- // try to make silently sure that a local cupsd is running
- // (i.e. start the cupsd without user confirmation)
- // because it is needed for automated queue setup
- // see https://bugzilla.novell.com/show_bug.cgi?id=418585
- // Note that because of Mode::installation() this happens only
- // if we are doing a fresh installation (but e.g. not for an update)
- // and because of Stage::cont() we are continuing the installation
- // in the target system (but we are e.g. not in the inst-sys system)
- // so that it should be sufficiently safe to (re)-start and enable
- // the cupsd without user confirmation here:
- if( Mode::installation() && Stage::cont() )
- { y2milestone("Silently start and enable the cupsd because we are continuing a fresh installation in the target system.");
- if( Service::Status( "cups" ) != 0 )
- { Service::Start( "cups" );
- }
- else
- { // Restart the cupsd when it seems to run according to Service::Status
- // but actually it is not accessible according to GetAndSetCupsdStatus.
- // For example the cupsd may run but failed to bind to the IPP port 631
- // because whatever other service grabbed this port for a short while
- // so that a restart could help here (a known ypbind/portmapper issue):
- Service::Restart( "cups" );
- }
- Service::Enable( "cups" );
- // Wait until the cupsd is actually accessible.
- // In particular for the very first start of the cupsd it may take several seconds
- // (up to more than a minute on a slow machine) until it is actually accessible,
- // compare https://bugzilla.novell.com/show_bug.cgi?id=429397
- // Sleep one second in any case so that the new started cupsd can become ready to operate:
- sleep( 1000 );
- if( ! Printerlib::GetAndSetCupsdStatus( "" ) )
- { // The cupsd is not yet accessible.
- // Sleep 9 seconds so that the new started cupsd has more time to become ready to operate:
- sleep( 9000 );
- }
+ // Check if the packages cups-client and cups are installed
+ // and skip the automated queue setup if one of them is missing, see
+ // https://bugzilla.novell.com/show_bug.cgi?id=445719#c13
+ // If cups-client is missing, it would run into an endless sequence of errors.
+ // If cups is missing, theer can be no local running cupsd which is
+ // mandatory to set up local print queues.
+ if( ! Printerlib::TestAndInstallPackage( "cups-client", "installed" ) )
+ { y2milestone("Skipped automated queue setup because the package cups-client is not installed.");
+ proposal = [ _("Cannot configure printing (required package cups-client is not installed).") ];
+ }
+ else
+ { if( ! Printerlib::TestAndInstallPackage( "cups", "installed" ) )
+ { y2milestone("Skipped automated queue setup because the package cups is not installed.");
+ proposal = [ _("Cannot configure local printers (required package cups is not installed).") ];
+ }
+ else
+ { // Determine whether or not it is currently a real client-only config
+ // (i.e. a ServerName != "localhost/127.0.0.1" in /etc/cups/client.conf)
+ // and ignore when it fails (i.e. use the fallback value silently):
+ Printerlib::DetermineClientOnly();
+ // Skip automated queue setup when it is a client-only config:
+ if( Printerlib::client_only )
+ { y2milestone("Skipped automated queue setup because it is a client-only config.");
+ proposal = [ sformat( _("No local printer accessible (using remote CUPS server '%1' for printing)."),
+ Printerlib::client_conf_server_name
+ )
+ ];
+ }
+ else
+ { // Determine whether or not a local cupsd is accessible:
if( ! Printerlib::GetAndSetCupsdStatus( "" ) )
- { // After waiting 10 seconds without user notification, become verbose now.
- // Wait half a minute for a new started cupsd:
- Popup::TimedMessage( _("Started the CUPS daemon.\nWaiting half a minute so that it is ready to operate..."),
- 30
- );
+ { // Only in the second stage of the system installation
+ // try to make silently sure that a local cupsd is running
+ // (i.e. start the cupsd without user confirmation)
+ // because it is needed for automated queue setup
+ // see https://bugzilla.novell.com/show_bug.cgi?id=418585
+ // Note that because of Mode::installation() this happens only
+ // if we are doing a fresh installation (but e.g. not for an update)
+ // and because of Stage::cont() we are continuing the installation
+ // in the target system (but we are e.g. not in the inst-sys system)
+ // so that it should be sufficiently safe to (re)-start and enable
+ // the cupsd without user confirmation here:
+ if( Mode::installation() && Stage::cont() )
+ { y2milestone("Silently start and enable the cupsd because we are continuing a fresh installation in the target system.");
+ if( Service::Status( "cups" ) != 0 )
+ { Service::Start( "cups" );
+ }
+ else
+ { // Restart the cupsd when it seems to run according to Service::Status
+ // but actually it is not accessible according to GetAndSetCupsdStatus.
+ // For example the cupsd may run but failed to bind to the IPP port 631
+ // because whatever other service grabbed this port for a short while
+ // so that a restart could help here (a known ypbind/portmapper issue):
+ Service::Restart( "cups" );
+ }
+ Service::Enable( "cups" );
+ // Wait until the cupsd is actually accessible.
+ // In particular for the very first start of the cupsd it may take several seconds
+ // (up to more than a minute on a slow machine) until it is actually accessible,
+ // compare https://bugzilla.novell.com/show_bug.cgi?id=429397
+ // Sleep one second in any case so that the new started cupsd can become ready to operate:
+ sleep( 1000 );
+ if( ! Printerlib::GetAndSetCupsdStatus( "" ) )
+ { // The cupsd is not yet accessible.
+ // Sleep 9 seconds so that the new started cupsd has more time to become ready to operate:
+ sleep( 9000 );
+ }
+ if( ! Printerlib::GetAndSetCupsdStatus( "" ) )
+ { // After waiting 10 seconds without user notification, become verbose now.
+ // Wait half a minute for a new started cupsd:
+ Popup::TimedMessage( _("Started the CUPS daemon.\nWaiting half a minute so that it is ready to operate..."),
+ 30
+ );
+ }
+ if( ! Printerlib::GetAndSetCupsdStatus( "" ) )
+ { // It can take up to a few minutes when a cupsd is started
+ // for the very first time (e.g. on a new installed system)
+ // until the cupsd is actually ready to operate.
+ // E.g. because parsing of thousands of PPDs may need much time.
+ // Therefore enforce waiting one minute now.
+ // (Plain busy message without title.)
+ Popup::ShowFeedback( "", _("The CUPS daemon in not yet accessible.\nWaiting one minute so that it is ready to operate...") );
+ sleep( 60000 );
+ Popup::ClearFeedback();
+ }
+ }
}
+ // Skip automated queue setup when the cupsd is not accessible up to now.
+ // A special case is when the cupsd does not listen on the official IANA IPP port (631).
+ // Then Printerlib::GetAndSetCupsdStatus("") returns false because it calls
+ // "lpstat -h localhost -r" which fails ("-h localhost:port" would have to be used).
+ // The YaST printer modue does not support when the cupsd listens on a non-official port
+ // so that also in this special case no automated queue setup is done.
if( ! Printerlib::GetAndSetCupsdStatus( "" ) )
- { // It can take up to a few minutes when a cupsd is started
- // for the very first time (e.g. on a new installed system)
- // until the cupsd is actually ready to operate.
- // E.g. because parsing of thousands of PPDs may need much time.
- // Therefore enforce waiting one minute now.
- // (Plain busy message without title.)
- Popup::ShowFeedback( "", _("The CUPS daemon in not yet accessible.\nWaiting one minute so that it is ready to operate...") );
- sleep( 60000 );
- Popup::ClearFeedback();
+ { y2milestone("Skipped automated queue setup because there is no local cupsd accessible (via port 631).");
+ proposal = [ _("Cannot configure local printers (no local cupsd accessible).") ];
}
- }
- }
- // Skip automated queue setup when the cupsd is not accessible up to now.
- // A special case is when the cupsd does not listen on the official IANA IPP port (631).
- // Then Printerlib::GetAndSetCupsdStatus("") returns false because it calls
- // "lpstat -h localhost -r" which fails ("-h localhost:port" would have to be used).
- // The YaST printer modue does not support when the cupsd listens on a non-official port
- // so that also in this special case no automated queue setup is done.
- if( Printerlib::GetAndSetCupsdStatus( "" ) )
- { list<term> detected_printers = filter( term row,
- (list<term>)Printer::ConnectionItems( "BasicAddDialog" ),
- { return( ! issubstring( String::CutBlanks(row[1]:""), "Unknown" ) );
- }
- );
- y2milestone( "Detected local printers: %1", detected_printers );
- if( size(detected_printers) > 0 )
- { y2milestone("Local printers detected, will set up queues for them:");
- list<string> already_set_up_uris = [];
- // An empty list of autodetected queues is the fallback which is correct:
- Printer::AutodetectQueues();
- foreach( map< string, string > queue,
- Printer::queues,
- { if( "" != queue["uri"]:"" )
- { already_set_up_uris = add( already_set_up_uris, queue["uri"]:"" );
- }
- }
- );
- foreach( term printer,
- detected_printers,
- { string model = String::CutBlanks(printer[1]:"");
- if( "" != model && "unknown" != tolower( model ) )
- { string uri = String::CutBlanks(printer[2]:"");
- if( "" != uri )
- { y2internal("Setting up a queue for URI '%1'", uri);
- string queue_name = Printer::NewQueueName( tolower( model ) );
- if( contains( already_set_up_uris, uri ) )
- { y2internal("Skipping printer '%1' because a queue with the same URI already exists.", printer);
- continue;
+ else
+ { list<term> detected_printers = filter( term row,
+ (list<term>)Printer::ConnectionItems( "BasicAddDialog" ),
+ { // Printer::ConnectionItems does not return entries
+ // with an empty URI (i.e. no need to test this here)
+ // but Printer::ConnectionItems adds trailing spaces
+ // because the current YaST UI has almost no additional
+ // space between table columns:
+ string model = String::CutBlanks(row[1]:"");
+ return( ! issubstring( tolower( model ), "unknown" ) );
+ }
+ );
+ y2milestone( "Detected local printers: %1", detected_printers );
+ if( size(detected_printers) < 1 )
+ { y2milestone("Skipped automated queue setup because there is no local printer detected.");
+ proposal = [ _("No local printer detected.") ];
+ }
+ else
+ { y2milestone("Local printers detected, will set up queues for them:");
+ list<string> already_set_up_uris = [];
+ // An empty list of autodetected queues is the fallback which is correct:
+ Printer::AutodetectQueues();
+ foreach( map< string, string > queue,
+ Printer::queues,
+ { if( "" != queue["uri"]:"" )
+ { already_set_up_uris = add( already_set_up_uris, queue["uri"]:"" );
}
- y2milestone("Proposed queue name: %1", queue_name);
- string driver_filter_string = "^" + filterchars( tolower( model ), Printer::lower_alnum_chars );
- if( "^" != driver_filter_string )
- { list drivers = Printer::DriverItems( driver_filter_string, true );
- if( size(drivers) > 0 )
- { y2internal("Available drivers: %1", drivers);
- y2internal("Selected driver: %1", drivers[0]:nil);
- Printer::selected_ppds_index = drivers[0,0,0]:-1;
- Printer::selected_connections_index = printer[0,0]:-1;
- if( Printer::AddQueue( queue_name ) )
- { already_set_up_uris = add( already_set_up_uris, uri );
- // Autodetect queues again so that Printer::NewQueueName
- // can compare with existing queue names but ignore whatever failures
- // (an empty list of autodetected queues is the fallback result):
- Printer::AutodetectQueues();
+ }
+ );
+ foreach( term printer,
+ detected_printers,
+ { // Printer::ConnectionItems adds trailing spaces because the current YaST UI
+ // has almost no additional space between table columns:
+ string model = String::CutBlanks(printer[1]:"");
+ if( "" != model && "unknown" != tolower( model ) )
+ { string uri = String::CutBlanks(printer[2]:"");
+ if( "" != uri )
+ { y2internal("Setting up a queue for URI '%1'", uri);
+ string queue_name = Printer::NewQueueName( tolower( model ) );
+ if( contains( already_set_up_uris, uri ) )
+ { y2internal("Skipping printer '%1' because a queue with the same URI already exists.", printer);
+ continue;
+ }
+ y2milestone("Proposed queue name: %1", queue_name);
+ string driver_filter_string = "^" + filterchars( tolower( model ), Printer::lower_alnum_chars );
+ if( "^" != driver_filter_string )
+ { list drivers = Printer::DriverItems( driver_filter_string, true );
+ if( size(drivers) > 0 )
+ { y2internal("Available drivers: %1", drivers);
+ y2internal("Selected driver: %1", drivers[0]:nil);
+ Printer::selected_ppds_index = drivers[0,0,0]:-1;
+ Printer::selected_connections_index = printer[0,0]:-1;
+ if( Printer::AddQueue( queue_name ) )
+ { already_set_up_uris = add( already_set_up_uris, uri );
+ // Autodetect queues again so that Printer::NewQueueName
+ // can compare with existing queue names but ignore whatever failures
+ // (an empty list of autodetected queues is the fallback result):
+ Printer::AutodetectQueues();
+ }
+ }
+ else
+ { y2error("No available drivers for printer %1", printer);
+ }
}
- }
- else
- { y2error("No available drivers for printer %1", printer);
}
}
}
+ );
+ }
+ foreach( term queue,
+ (list<term>)Printer::QueueItems( true, false ),
+ { // Printer::QueueItems adds trailing spaces because the current YaST UI
+ // has almost no additional space between table columns:
+ string name = String::CutBlanks(queue[2]:"");
+ string description = String::CutBlanks(queue[3]:"");
+ proposal = add( proposal, name + ": " + description );
}
- }
- );
- }
- else
- { y2milestone("No local printers detected");
+ );
+ }
}
- foreach( term queue,
- (list<term>)Printer::QueueItems( true, false ),
- { // Each proposal entry is a string of queue name and description:
- proposal = add(proposal, queue[2]:"" + ": " + queue[3]:"");
- }
- );
}
}
-
proposal = filter( string p, proposal, { return p != ""; } );
- if( size (proposal) == 0 )
- { proposal = [ _("No printer queue configured.") ];
+ if( size(proposal) == 0 )
+ { proposal = [ _("No local printer configured.") ];
}
-
ret = $[ "raw_proposal" : proposal,
"warning_level" : warning_level,
"warning" : warning,
];
}
-
/* run the module */
-else if(func == "AskUser") {
- map stored = Printer::Export();
- symbol seq = (symbol) WFM::CallFunction("printer", [.propose]);
- if(seq != `next) Printer::Import(stored);
- y2debug("stored=%1",stored);
- y2debug("seq=%1",seq);
- ret = $[
- "workflow_sequence" : seq
- ];
+else if(func == "AskUser")
+{ // Call Printer::Read() here (compare "MakeProposal" above)
+ // to make sure that when the full printer module is launched
+ // it asks the user to install the packages cups-client and cups:
+ boolean progress_orig = Progress::set( false );
+ Printer::Read();
+ Progress::set( progress_orig );
+ // TODO FIXME: Printer::Export exists but there is nothing implemented
+ map stored = Printer::Export();
+ symbol seq = (symbol) WFM::CallFunction("printer", [.propose]);
+ // TODO FIXME: Printer::Import exists but there is nothing implemented
+ if(seq != `next) Printer::Import(stored);
+ y2debug("stored=%1",stored);
+ y2debug("seq=%1",seq);
+ ret = $[ "workflow_sequence" : seq ];
}
/* create titles */
-else if(func == "Description") {
- ret = $[
- /* Rich text title for Printer in proposals */
- "rich_text_title" : _("Printer"),
- /* Menu title for Printer in proposals */
- "menu_title" : _("&Printer"),
- "id" : "printer",
- ];
+else if(func == "Description")
+{ ret = $[ /* Rich text title for Printer in proposals */
+ "rich_text_title" : _("Printer"),
+ /* Menu title for Printer in proposals */
+ "menu_title" : _("&Printer"),
+ "id" : "printer",
+ ];
}
/* write the proposal */
-else if(func == "Write") {
- Printer::Write();
+else if(func == "Write")
+{ // There is no need to call Printer::Write() here because
+ // it does actually nothing except to exit verbosely, see
+ // http://en.opensuse.org/YaST/Development/Printer_Enhancement#Basic_Implementa...:
+ // for background information.
+ //Printer::Write();
+ y2milestone("No need to call Printer::Write() because it does nothing.");
}
/* unknown function */
-else {
- y2error("unknown function: %1", func);
+else
+{ y2error("unknown function: %1", func);
}
/* Finish */
@@ -256,3 +306,4 @@
/* EOF */
}
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.17.43/VERSION new/yast2-printer-2.17.44/VERSION
--- old/yast2-printer-2.17.43/VERSION 2008-11-20 15:31:16.000000000 +0100
+++ new/yast2-printer-2.17.44/VERSION 2008-11-21 09:42:58.000000000 +0100
@@ -1 +1 @@
-2.17.43
+2.17.44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org