Hello community,
here is the log from the commit of package yast2-printer for openSUSE:Factory
checked in at Sun Apr 25 18:43:51 CEST 2010.
--------
--- yast2-printer/yast2-printer.changes 2010-03-30 15:17:43.000000000 +0200
+++ /mounts/work_src_done/STABLE/yast2-printer/yast2-printer.changes 2010-04-23 12:42:16.000000000 +0200
@@ -1,0 +2,20 @@
+Fri Apr 23 11:39:13 CEST 2010 - jsmeix@suse.de
+
+- In overview.ycp added an initial responsive test if CUPS server
+ is accessible by using the TestClientOnlyServer function
+ which was moved from printingvianetwork.ycp to Printer.ycp
+ and adapted so that it can be used both for overview.ycp and
+ printingvianetwork.ycp (see Novell/Suse Bugzilla bnc#595612).
+- Fixed English spelling in basicadd.ycp, basicmodify.ycp,
+ and Printerlib.ycp (see Novell/Suse Bugzilla bnc#596526).
+- In overview.ycp for testpage printing added "tail -n 20"
+ when the CUPS error_log info is grepped to avoid a too
+ tall popup which may show too many lines (in particular
+ in case of the oververbose Gutenprint driver).
+- In overview.ycp show a generic text when the user selected
+ that testpage printing had failed for a local queue but
+ there are no messages in /var/log/cups/error_log regarding
+ the testpage print job.
+- 2.19.8
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
yast2-printer-2.19.7.tar.bz2
New:
----
yast2-printer-2.19.8.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-printer.spec ++++++
--- /var/tmp/diff_new_pack.3kYq12/_old 2010-04-25 18:43:42.000000000 +0200
+++ /var/tmp/diff_new_pack.3kYq12/_new 2010-04-25 18:43:42.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-printer (Version 2.19.7)
+# spec file for package yast2-printer (Version 2.19.8)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,12 +19,12 @@
Name: yast2-printer
-Version: 2.19.7
+Version: 2.19.8
Release: 1
License: GPL
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-printer-2.19.7.tar.bz2
+Source0: yast2-printer-2.19.8.tar.bz2
Prefix: /usr
@@ -54,7 +54,7 @@
Developer documentation for yast2-printer.
%prep
-%setup -n yast2-printer-2.19.7
+%setup -n yast2-printer-2.19.8
%build
%{prefix}/bin/y2tool y2autoconf
++++++ yast2-printer-2.19.7.tar.bz2 -> yast2-printer-2.19.8.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-printer-2.19.7/VERSION new/yast2-printer-2.19.8/VERSION
--- old/yast2-printer-2.19.7/VERSION 2010-03-30 14:57:54.000000000 +0200
+++ new/yast2-printer-2.19.8/VERSION 2010-04-08 15:10:33.000000000 +0200
@@ -1 +1 @@
-2.19.7
+2.19.8
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-printer-2.19.7/configure new/yast2-printer-2.19.8/configure
--- old/yast2-printer-2.19.7/configure 2010-03-30 14:58:07.000000000 +0200
+++ new/yast2-printer-2.19.8/configure 2010-04-23 11:47:43.000000000 +0200
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for yast2-printer 2.19.7.
+# Generated by GNU Autoconf 2.63 for yast2-printer 2.19.8.
#
# Report bugs to http://bugs.opensuse.org/.
#
@@ -596,8 +596,8 @@
# Identity of this package.
PACKAGE_NAME='yast2-printer'
PACKAGE_TARNAME='yast2-printer'
-PACKAGE_VERSION='2.19.7'
-PACKAGE_STRING='yast2-printer 2.19.7'
+PACKAGE_VERSION='2.19.8'
+PACKAGE_STRING='yast2-printer 2.19.8'
PACKAGE_BUGREPORT='http://bugs.opensuse.org/'
ac_unique_file="RPMNAME"
@@ -1336,7 +1336,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.19.7 to adapt to many kinds of systems.
+\`configure' configures yast2-printer 2.19.8 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1407,7 +1407,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of yast2-printer 2.19.7:";;
+ short | recursive ) echo "Configuration of yast2-printer 2.19.8:";;
esac
cat <<\_ACEOF
@@ -1502,7 +1502,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-yast2-printer configure 2.19.7
+yast2-printer configure 2.19.8
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1516,7 +1516,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.19.7, which was
+It was created by yast2-printer $as_me 2.19.8, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@@ -2363,7 +2363,7 @@
# Define the identity of the package.
PACKAGE='yast2-printer'
- VERSION='2.19.7'
+ VERSION='2.19.8'
cat >>confdefs.h <<_ACEOF
@@ -2587,7 +2587,7 @@
-VERSION="2.19.7"
+VERSION="2.19.8"
RPMNAME="yast2-printer"
MAINTAINER="Michal Zugec "
@@ -5413,7 +5413,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.19.7, which was
+This file was extended by yast2-printer $as_me 2.19.8, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -5467,7 +5467,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-yast2-printer config.status 2.19.7
+yast2-printer config.status 2.19.8
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-printer-2.19.7/configure.in new/yast2-printer-2.19.8/configure.in
--- old/yast2-printer-2.19.7/configure.in 2010-03-30 14:58:01.000000000 +0200
+++ new/yast2-printer-2.19.8/configure.in 2010-04-23 11:47:38.000000000 +0200
@@ -3,7 +3,7 @@
dnl -- This file is generated by y2autoconf 2.17.6 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-printer, 2.19.7, http://bugs.opensuse.org/, yast2-printer)
+AC_INIT(yast2-printer, 2.19.8, 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.19.7"
+VERSION="2.19.8"
RPMNAME="yast2-printer"
MAINTAINER="Michal Zugec "
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-printer-2.19.7/src/Printer.ycp new/yast2-printer-2.19.8/src/Printer.ycp
--- old/yast2-printer-2.19.7/src/Printer.ycp 2010-03-24 11:35:20.000000000 +0100
+++ new/yast2-printer-2.19.8/src/Printer.ycp 2010-04-22 10:56:39.000000000 +0200
@@ -2208,6 +2208,227 @@
}
/**
+ * Test whether or not a "client-only" server is accessible.
+ * @param server_name string of the "client-only" server name
+ * @param fail_if_executable_is_missing boolean which lets this function fail
+ * if netcat, ping, or host are not executable (e.g. because of not installed packages)
+ * @return false if the "client-only" server is not accessible.
+ */
+global boolean TestClientOnlyServer( string server_name, boolean fail_if_executable_is_missing )
+{ // Test for "localhost" or "127.0.0.1" and make a local cupsd accessible
+ // because a local cupsd is needed if the server name is "localhost" or "127.0.0.1":
+ if( "localhost" == tolower( server_name )
+ || "127.0" == substring( server_name, 0, 5 )
+ )
+ { // The server name is "localhost" or "127.0.0.1"
+ // which makes it effectively a config with a local running cupsd.
+ // If a local cupsd is already accessible, exit successfully, otherwise start it:
+ if( Printerlib::GetAndSetCupsdStatus( "" ) )
+ { return true;
+ }
+ return Printerlib::GetAndSetCupsdStatus( "start" );
+ }
+ // The tests here are the same (except verbosity) as in the cups_client_only tool.
+ // First do the most meaningful test and only if this works return true.
+ // The subsequent tests are only there to provide more info for the user
+ // what might be the reason why the server is not accessible via port 631.
+ string netcat_test_good_message = sformat( // Popup message
+ // where %1 will be replaced by the server name.
+ _("The server '%1' is accessible via port 631 (IPP/CUPS)."),
+ server_name
+ );
+ string netcat_test_fail_message = sformat( // Popup message
+ // where %1 will be replaced by the server name.
+ _("The server '%1' is not accessible via port 631 (IPP/CUPS)."),
+ server_name
+ );
+ string ping_test_good_message = sformat( // Popup message
+ // where %1 will be replaced by the server name.
+ _("The server '%1' responds to a 'ping' in the network."),
+ server_name
+ );
+ string ping_test_fail_message = sformat( // Popup message
+ // where %1 will be replaced by the server name.
+ _("The server '%1' does not respond to a 'ping' in the network."),
+ server_name
+ );
+ string host_test_good_message = sformat( // Popup message
+ // where %1 will be replaced by the server name.
+ _("The server name '%1' is known in the network."),
+ server_name
+ );
+ string host_test_fail_message = sformat( // Popup message
+ // where %1 will be replaced by the server name.
+ _("The server name '%1' is not known in the network."),
+ server_name
+ );
+ string separator = "\n===========================================================\n";
+ string error_messages = "";
+ string result_details = "";
+ boolean netcat_test_failed = false;
+ boolean ping_test_failed = false;
+ boolean host_test_failed = false;
+ // Only the netcat test provides a really meaningful result
+ // so that only this test returns immediately true if it was successful.
+ if( ! Printerlib::ExecuteBashCommand( "type -P netcat" ) )
+ { // netcat is required for a meaningful test.
+ // Show negative feedback:
+ Popup::ErrorDetails( // Popup::ErrorDetails message:
+ _("Cannot execute the program 'netcat'"),
+ // Popup::ErrorDetails details:
+ _("The RPM package 'netcat' is required for a meaningful test.") + "\n"
+ + Printerlib::result["stderr"]:"" + "\n" + Printerlib::result["stdout"]:""
+ );
+ if( fail_if_executable_is_missing )
+ { return false;
+ }
+ }
+ else
+ { // netcat is executable:
+ // Make netcat verbose, otherwise there would be no output at all
+ // but some output is needed for the Popup::ErrorDetails below:
+ if( Printerlib::ExecuteBashCommand( "netcat -v -w 1 -z " + server_name + " 631" ) )
+ { // Show positive feedback.
+ // Show it as TimedMessage so that is disappears automatically
+ // when TestClientOnlyServer() is called from ApplyNetworkPrintingSettings():
+ Popup::TimedMessage( netcat_test_good_message, 3 );
+ return true;
+ }
+ // The netcat-test failed:
+ netcat_test_failed = true;
+ error_messages = netcat_test_fail_message;
+ result_details = Printerlib::result["stderr"]:"" + "\n" + Printerlib::result["stdout"]:"";
+ }
+ // When the netcat-test failed or when netcat is not executable, do a less meaningful test:
+ if( ! Printerlib::ExecuteBashCommand( "type -P ping" ) )
+ { // ping is required for the less meaningful test
+ // but it the less meaningful test is not really important
+ // so that the less meaningful test is silently skipped
+ // and no negative feedback is shown when ping is not executable:
+ if( fail_if_executable_is_missing )
+ { // Show negative feedback:
+ Popup::ErrorDetails( // Popup::ErrorDetails message
+ _("Cannot execute the program 'ping'"),
+ // Popup::ErrorDetails details:
+ _("The RPM package 'iputils' is required for a meaningful test.") + "\n"
+ + Printerlib::result["stderr"]:"" + "\n" + Printerlib::result["stdout"]:""
+ + separator
+ + error_messages + "\n"
+ + result_details
+ );
+ return false;
+ }
+ }
+ else
+ { // ping is executable:
+ if( Printerlib::ExecuteBashCommand( "ping -w 1 -c 1 " + server_name ) )
+ { // The ping-test was successful.
+ if( netcat_test_failed )
+ { // The netcat-test had failed.
+ // Show negative feedback:
+ Popup::ErrorDetails( sformat( // Popup::ErrorDetails message
+ // where %1 will be replaced by the server name.
+ _("The server '%1' is not accessible"),
+ server_name
+ ),
+ // Popup::ErrorDetails details:
+ error_messages + "\n"
+ + ping_test_good_message
+ + separator
+ + result_details + "\n"
+ + Printerlib::result["stderr"]:"" + "\n"
+ + Printerlib::result["stdout"]:""
+ );
+ return false;
+ }
+ // netcat was not executable but at least the ping-test was successful.
+ // There was already a Popup::ErrorDetails that netcat is required for a meaningful test
+ // so that the less meaningful ping-test is all what could be done in this case.
+ return true;
+ }
+ // The ping-test failed:
+ ping_test_failed = true;
+ error_messages = error_messages + "\n" + ping_test_fail_message;
+ result_details = result_details + "\n" + Printerlib::result["stderr"]:"" + "\n" + Printerlib::result["stdout"]:"";
+ }
+ // When the netcat-test failed or when netcat is not executable
+ // and when the ping-test failed or when ping is not executable
+ // do a last test:
+ if( ! Printerlib::ExecuteBashCommand( "type -P host" ) )
+ { // host is required for the last test
+ // but it the last test is not really important
+ // so that the last test is silently skipped
+ // and no negative feedback is shown when host is not executable:
+ if( fail_if_executable_is_missing )
+ { // Show negative feedback:
+ Popup::ErrorDetails( // Popup::ErrorDetails message
+ _("Cannot execute the program 'host'"),
+ // Popup::ErrorDetails details:
+ _("The RPM package 'bind-utils' is required for a meaningful test.") + "\n"
+ + Printerlib::result["stderr"]:"" + "\n" + Printerlib::result["stdout"]:""
+ + separator
+ + error_messages + "\n"
+ + result_details
+ );
+ return false;
+ }
+ }
+ else
+ { // host is executable:
+ if( Printerlib::ExecuteBashCommand( "host -W 1 " + server_name ) )
+ { // The host-test was successful.
+ if( netcat_test_failed || ping_test_failed )
+ { // The netcat-test or the ping-test failed.
+ // Show negative feedback:
+ Popup::ErrorDetails( sformat( // Popup::ErrorDetails message
+ // where %1 will be replaced by the server name.
+ _("The server '%1' does not respond in the network"),
+ server_name
+ ),
+ // Popup::ErrorDetails details:
+ error_messages + "\n"
+ + host_test_good_message
+ + separator
+ + result_details + "\n"
+ + Printerlib::result["stderr"]:"" + "\n" + Printerlib::result["stdout"]:""
+ );
+ return false;
+ }
+ // ping was not executable but at least the host-test was successful.
+ // There was already a Popup::ErrorDetails that netcat is required for a meaningful test
+ // so that the last host-test is all what could be done in this case.
+ return true;
+ }
+ // The host-test failed:
+ host_test_failed = true;
+ error_messages = error_messages + "\n" + host_test_fail_message;
+ result_details = result_details + "\n" + Printerlib::result["stderr"]:"" + "\n" + Printerlib::result["stdout"]:"";
+ }
+ // When the netcat-test failed or when netcat is not executable
+ // and when the ping-test failed or when ping is not executable
+ // and when the host-test failed or when host is not executable:
+ if( netcat_test_failed || ping_test_failed || host_test_failed )
+ { // The netcat-test or the ping-test or the host-test failed.
+ // Show negative feedback:
+ Popup::ErrorDetails( sformat( // Popup::ErrorDetails message
+ // where %1 will be replaced by the server name.
+ _("The server '%1' is unknown"),
+ server_name
+ ),
+ // Popup::ErrorDetails details:
+ error_messages
+ + separator
+ + result_details
+ );
+ return false;
+ }
+ // Neither netcat nor ping nor host were executable.
+ // There was already a Popup::ErrorDetails that netcat is required for a meaningful test
+ // so that nothing else could be done in this case except a "hope-for-the-best" successful return:
+ return true;
+}
+
+/**
* Run hp-setup:
* @return false if hp-setup cannot be run and return true in any other case
* because there is no usable exit code of hp-setup (always zero even in case of error).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-printer-2.19.7/src/Printerlib.ycp new/yast2-printer-2.19.8/src/Printerlib.ycp
--- old/yast2-printer-2.19.7/src/Printerlib.ycp 2010-03-17 08:53:58.000000000 +0100
+++ new/yast2-printer-2.19.8/src/Printerlib.ycp 2010-04-14 16:51:09.000000000 +0200
@@ -593,7 +593,7 @@
// by calling time() which returns the number of seconds since 1.1.1970:
integer time_before = time();
Popup::TimedMessage( // Message of a Popup::TimedMessage:
- popupheader + "\n\n" + _("Waiting until the config files are updated..."),
+ popupheader + "\n\n" + _("Updating configuration files..."),
dirty_clean_interval + 1
);
integer waiting_time = time() - time_before;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-printer-2.19.7/src/basicadd.ycp new/yast2-printer-2.19.8/src/basicadd.ycp
--- old/yast2-printer-2.19.7/src/basicadd.ycp 2010-01-21 11:41:03.000000000 +0100
+++ new/yast2-printer-2.19.8/src/basicadd.ycp 2010-04-14 16:45:33.000000000 +0200
@@ -386,7 +386,7 @@
// in particular when no local queues were shown before:
Printer::queue_filter_show_local = true;
// Since CUPS 1.4 the new DirtyCleanInterval directive controls the delay when cupsd updates config files:
- if( ! Printerlib::WaitForUpdatedConfigFiles( _("Created New Printer Setup") ) )
+ if( ! Printerlib::WaitForUpdatedConfigFiles( _("Creating New Printer Setup") ) )
{ // It returns false if the user had interrupted the waiting for updated config files:
Popup::ErrorDetails( // Message of a Popup::ErrorDetails:
_("New Printer Configuration not yet Stored in the System"),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-printer-2.19.7/src/basicmodify.ycp new/yast2-printer-2.19.8/src/basicmodify.ycp
--- old/yast2-printer-2.19.7/src/basicmodify.ycp 2010-01-21 11:40:37.000000000 +0100
+++ new/yast2-printer-2.19.8/src/basicmodify.ycp 2010-04-14 16:46:07.000000000 +0200
@@ -669,7 +669,7 @@
}
}
// Since CUPS 1.4 the new DirtyCleanInterval directive controls the delay when cupsd updates config files:
- if( ! Printerlib::WaitForUpdatedConfigFiles( _("Modified Printer Setup") ) )
+ if( ! Printerlib::WaitForUpdatedConfigFiles( _("Modifying Printer Setup") ) )
{ // It returns false if the user had interrupted the waiting for updated config files:
Popup::WarningDetails( // Message of a Popup::WarningDetails.
_("Modified Printer Configuration not yet Stored in the System"),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-printer-2.19.7/src/overview.ycp new/yast2-printer-2.19.8/src/overview.ycp
--- old/yast2-printer-2.19.7/src/overview.ycp 2010-03-12 14:55:07.000000000 +0100
+++ new/yast2-printer-2.19.8/src/overview.ycp 2010-04-23 11:36:03.000000000 +0200
@@ -145,6 +145,7 @@
_("The CUPS daemon seems not to listen on the official IANA IPP port (631).
Check with 'netstat -nap | grep cupsd' where the cupsd actually listens.
This happens when there is a 'Listen ...:1234' or 'Port 1234' setting
+(where 1234 means any port number which is not the official port 631)
in /etc/cups/cupsd.conf (check also if there is 'BrowsePort 1234').
The YaST printer module does not support a non-official port.
A non-official port leads to an endless sequence of further failures.
@@ -160,28 +161,117 @@
boolean local_content_selected = Printer::queue_filter_show_local;
boolean remote_content_selected = Printer::queue_filter_show_remote;
boolean local_cupsd_required = true;
+ boolean feedback_popup_exists = false;
// 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):
+ integer time_before = time();
Printerlib::DetermineClientOnly();
if( Printerlib::client_only )
- { local_cupsd_required = false;
- local_content_selected = false;
- remote_content_selected = true;
- UI::ChangeWidget( `client_only_server_name,
- `Value,
- sformat( // Show the CUPS server name if it is a client-only config
- // where %1 will be replaced by the CUPS server name.
- _("CUPS Server %1"),
- Printerlib::client_conf_server_name
- )
- );
- // In case of a client-only config it does not work to show local queues:
- UI::ChangeWidget( `local_content_checkbox, `Enabled, false );
+ { if( time() - time_before > 10 )
+ { y2milestone( "DetermineClientOnly took longer than 10 seconds. CUPS server is '%1'",
+ Printerlib::client_conf_server_name
+ );
+ // When Printerlib::DetermineClientOnly took longer than 10 seconds
+ // something is fishy regarding CUPS server access.
+ // In this case show feedback what goes on because for example
+ // when a CUPS server is unknown by the DNS there can be longer DNS timeouts
+ // which would also delay Printer::TestClientOnlyServer for up to a few minutes
+ // so that the user must be informed what goes on while he is wainting:
+ Popup::ShowFeedback( // No title for a simple busy message:
+ "",
+ // Busy message:
+ // Body of a Popup::ShowFeedback
+ _("Running several tests regarding CUPS server accessibility...\n(this might take some time)")
+ );
+ feedback_popup_exists = true;
+ // Sleep one second to let the feedback popup stay for at least one second
+ // to avoid a flickering popup which appears and disappears at the same time:
+ sleep( 1000 );
+ }
+ // A non-accessible client-only server leads to an endless sequence of weird further behaviour
+ // of the module so that a non-accessible server is only accepted after insistent warning popups:
+ if( ! Printer::TestClientOnlyServer( Printerlib::client_conf_server_name, false ) )
+ { if( feedback_popup_exists )
+ { Popup::ClearFeedback();
+ feedback_popup_exists = false;
+ }
+ if( Popup::YesNoHeadline( // Popup::YesNoHeadline headline question
+ // where %1 will be replaced by the server name:
+ sformat( _("Do no longer use the inaccessible CUPS server '%1'?"),
+ Printerlib::client_conf_server_name
+ ),
+ // Popup::YesNoHeadline body recommendation how to answer the headline question
+ // where %1 will be replaced by the server name:
+ sformat( _("To proceed, you should agree that '%1' will be no longer used."),
+ Printerlib::client_conf_server_name
+ )
+ )
+ )
+ { // Remove the 'ServerName' entry in /etc/cups/client.conf:
+ if( ! Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir + "cups_client_only none" ) )
+ { Popup::ErrorDetails( // Popup::ErrorDetails message:
+ _("Failed to remove the 'ServerName' entry in /etc/cups/client.conf"),
+ Printerlib::result["stderr"]:""
+ );
+ Popup::Warning( // Popup::Warning message:
+ _("A non-accessible server leads to an endless sequence of delays and failures.")
+ );
+ }
+ // The 'ServerName' entry in /etc/cups/client.conf was removed
+ // so that it is now no longer a real client-only config and
+ // therefore the Printerlib::client_* values must be determined anew:
+ Printerlib::DetermineClientOnly();
+ }
+ else
+ { // The user decided not to remove the non-accessible 'ServerName' in /etc/cups/client.conf:
+ Popup::Warning( // Popup::Warning message:
+ _("A non-accessible server leads to an endless sequence of delays and failures.")
+ );
+ }
+ }
+ // The 'ServerName' entry in /etc/cups/client.conf may have been removed above
+ // when the client-only server was non-accessible so that it might be now
+ // no longer a real client-only config and therefore it is tested again
+ // whether or not it is still a real client-only config:
+ if( Printerlib::client_only )
+ { local_cupsd_required = false;
+ local_content_selected = false;
+ remote_content_selected = true;
+ UI::ChangeWidget( `client_only_server_name,
+ `Value,
+ sformat( // Show the CUPS server name if it is a client-only config
+ // where %1 will be replaced by the CUPS server name.
+ _("CUPS Server %1"),
+ Printerlib::client_conf_server_name
+ )
+ );
+ // In case of a client-only config it does not work to show local queues:
+ UI::ChangeWidget( `local_content_checkbox, `Enabled, false );
+ }
}
// Determine whether or not a local cupsd is accessible:
+ time_before = time();
if( local_cupsd_required && ! Printerlib::GetAndSetCupsdStatus( "" ) )
- { // Printerlib::GetAndSetCupsdStatus results also false when
+ { if( time() - time_before > 10 )
+ { y2milestone( "GetAndSetCupsdStatus('') took longer than 10 seconds." );
+ // When Printerlib::GetAndSetCupsdStatus took longer than 10 seconds
+ // something is fishy regarding CUPS server access.
+ // In this case show feedback what goes on because subsequent
+ // Printerlib::GetAndSetCupsdStatus calls would be also delayed
+ // so that the user must be informed what goes on while he is wainting:
+ Popup::ShowFeedback( // No title for a simple busy message:
+ "",
+ // Busy message:
+ // Body of a Popup::ShowFeedback:
+ _("Testing if CUPS server is accessible...")
+ );
+ feedback_popup_exists = true;
+ // Sleep one second to let the feedback popup stay for at least one second
+ // to avoid a flickering popup which appears and disappears at the same time:
+ sleep( 1000 );
+ }
+ // Printerlib::GetAndSetCupsdStatus results also false when
// a local running cupsd does not listen on the official IPP port.
// Therefore, to be on the safe side, do a restart here.
// Printerlib::GetAndSetCupsdStatus already shows a confirmation popup:
@@ -191,7 +281,11 @@
// the user may have aborted the Popup::TimedMessage from the above call
// which would wait until a started cupsd becomes actually accessible.
if( ! Printerlib::GetAndSetCupsdStatus( "" ) )
- { Popup::ErrorDetails( required_cupsd_not_accessible,
+ { if( feedback_popup_exists )
+ { Popup::ClearFeedback();
+ feedback_popup_exists = false;
+ }
+ Popup::ErrorDetails( required_cupsd_not_accessible,
Printerlib::result["stderr"]:"" + "\n" + Printerlib::result["stdout"]:""
);
// A special case is when the cupsd does not listen on the official IANA IPP port (631).
@@ -222,6 +316,10 @@
}
}
}
+ if( feedback_popup_exists )
+ { Popup::ClearFeedback();
+ feedback_popup_exists = false;
+ }
if( Printer::printer_auto_dialogs )
{ // When the Overview dialog is called by AutoYaST
// (by calling in printer_auto.ycp the "Change" function)
@@ -487,10 +585,7 @@
// Body of a Popup::AnyMessage when no queue was selected from the list:
_("Select an entry.")
);
- // When testpage printing failed there might be whatever reason
- // so that a refresh of the overview content is needed to be on the safe side.
- // Re-run the OverviewDialog (with re-created queue status) via the sequencer:
- return `refresh;
+ return nil;
}
if( "yes" == Printer::queues[selected_queue_index,"rejecting"]:"no" )
{ Popup::AnyMessage( // Header of a Popup::AnyMessage when the queue rejects print jobs:
@@ -498,8 +593,8 @@
// Body of a Popup::AnyMessage when the queue rejects print jobs:
_("The testpage cannot be printed because print jobs are rejected.")
);
- // When testpage printing failed there might be whatever reason
- // so that a refresh of the overview content is needed to be on the safe side.
+ // Do a refresh of the overview content to be on the safe side.
+ // Perhaps the actual current queue state is no longer "rejecting".
// Re-run the OverviewDialog (with re-created queue status) via the sequencer:
return `refresh;
}
@@ -509,8 +604,8 @@
// Body of a Popup::AnyMessage when printing is disabled for the queue:
_("The testpage cannot be printed because printout is disabled.")
);
- // When testpage printing failed there might be whatever reason
- // so that a refresh of the overview content is needed to be on the safe side.
+ // Do that a refresh of the overview content to be on the safe side.
+ // Perhaps the actual current queue state is no longer "disabled".
// Re-run the OverviewDialog (with re-created queue status) via the sequencer:
return `refresh;
}
@@ -726,7 +821,6 @@
{ // When the user had selected in the Popup::AnyQuestion that "Testpage printing failed"
// and when it is a local queue, extract logging information about the test print job
// from /var/log/cups/error_log and show them to the user:
- string test_print_cups_error_log = "";
test_print_command_stdout = deletechars( test_print_command_stdout, "'" );
Printerlib::ExecuteBashCommand( // sed is greedy and cuts all up to the last '-' for example
// echo ' funprinter-1000-123 ' | sed -e 's/.*-//'
@@ -741,13 +835,14 @@
+ "-[0-9]* ' | sed -e 's/.*-//' | tr -d -c '[:digit:]'"
);
string test_print_job_number = Printerlib::result["stdout"]:"";
+ string test_print_cups_error_log = "";
if( "" != test_print_job_number )
{ // Note the YCP quoting: \\ becomes \ in the commandline:
Printerlib::ExecuteBashCommand( "grep '\\[Job "
+ test_print_job_number
- + "\\]' /var/log/cups/error_log | grep -v '^[dD]'"
+ + "\\]' /var/log/cups/error_log | grep -v '^[dD]' | tail -n 20"
);
- test_print_cups_error_log = Printerlib::result["stdout"]:"";
+ test_print_cups_error_log = "...\n" + Printerlib::result["stdout"]:"";
}
// Ignore an effectively empty test_print_cups_error_log:
if( "" != filterchars( test_print_cups_error_log, Printer::alnum_chars ) )
@@ -762,6 +857,13 @@
+ where_full_log
);
}
+ else
+ { Popup::Notify( // When the user had selected that "Testpage printing failed" for a local queue
+ // but the test_print_cups_error_log was effectively empty,
+ // show a very generic info to the user to show at least something:
+ _( "For CUPS log information, see the /var/log/cups/error_log file." )
+ );
+ }
}
}
else
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-printer-2.19.7/src/printingvianetwork.ycp new/yast2-printer-2.19.8/src/printingvianetwork.ycp
--- old/yast2-printer-2.19.7/src/printingvianetwork.ycp 2010-03-12 13:33:48.000000000 +0100
+++ new/yast2-printer-2.19.8/src/printingvianetwork.ycp 2010-04-22 11:15:12.000000000 +0200
@@ -181,167 +181,6 @@
`VStretch()
);
-boolean TestClientOnlyServer( string server_name )
-{ string netcat_test_good_message = sformat( // Popup message
- // where %1 will be replaced by the server name.
- _("The server '%1' is accessible via port 631 (IPP/CUPS)."),
- server_name
- );
- string netcat_test_fail_message = sformat( // Popup message
- // where %1 will be replaced by the server name.
- _("The server '%1' is not accessible via port 631 (IPP/CUPS)."),
- server_name
- );
- string ping_test_good_message = sformat( // Popup message
- // where %1 will be replaced by the server name.
- _("The server '%1' responds to a 'ping' in the network."),
- server_name
- );
- string ping_test_fail_message = sformat( // Popup message
- // where %1 will be replaced by the server name.
- _("The server '%1' does not respond to a 'ping' in the network."),
- server_name
- );
- string host_test_good_message = sformat( // Popup message
- // where %1 will be replaced by the server name.
- _("The server name '%1' is known in the network."),
- server_name
- );
- string host_test_fail_message = sformat( // Popup message
- // where %1 will be replaced by the server name.
- _("The server name '%1' is not known in the network."),
- server_name
- );
- string separator = "\n===========================================================\n";
- string error_messages = "";
- string result_details = "";
- // The tests here are the same (except verbosity) as in the cups_client_only tool.
- // First do the most meaningful test and only if this works return true.
- // The subsequent tests are only there to provide more info for the user
- // what might be the reason why the server is not accessible via port 631.
- // Make netcat verbose, otherwise there would be no output at all
- // but some output is needed for the Popup::MessageDetails below:
- if( ! Printerlib::ExecuteBashCommand( "type -P netcat" ) )
- { // netcat is required for a meaningful test.
- // Show negative feedback:
- Popup::ErrorDetails( // Popup::ErrorDetails message:
- _("Cannot execute the program 'netcat'"),
- // Popup::ErrorDetails details:
- _("The RPM package 'netcat' is required for a meaningful test.") + "\n"
- + Printerlib::result["stderr"]:"" + "\n" + Printerlib::result["stdout"]:""
- );
- return false;
- }
- // Test for "localhost" or "127.0.0.1" and make a local cupsd accessible
- // because a local cupsd is needed if the server name is "localhost" or "127.0.0.1":
- if( "localhost" == tolower( server_name )
- || "127.0" == substring( server_name, 0, 5 )
- )
- { // The user has entered "localhost" or "127.0.0.1" as server name
- // which makes it effectively a config with a local running cupsd.
- // If a local cupsd is already accessible, do nothing, otherwise start it:
- if( ! Printerlib::GetAndSetCupsdStatus( "" ) )
- { if( ! Printerlib::GetAndSetCupsdStatus( "start" ) )
- { return false;
- }
- }
- }
- if( Printerlib::ExecuteBashCommand( "netcat -v -w 1 -z " + server_name + " 631" ) )
- { // Show positive feedback.
- // Show it as TimedMessage so that is disappears automatically
- // when TestClientOnlyServer() is called from ApplyNetworkPrintingSettings():
- Popup::TimedMessage( netcat_test_good_message, 3 );
- return true;
- }
- // The netcat-test failed:
- error_messages = netcat_test_fail_message;
- result_details = Printerlib::result["stderr"]:"" + "\n" + Printerlib::result["stdout"]:"";
- // When the netcat-test failed, do a less meaningful test:
- if( ! Printerlib::ExecuteBashCommand( "type -P ping" ) )
- { // ping is required for the less meaningful test.
- // Show negative feedback:
- Popup::ErrorDetails( // Popup::ErrorDetails message
- _("Cannot execute the program 'ping'"),
- // Popup::ErrorDetails details:
- _("The RPM package 'iputils' is required for a meaningful test.") + "\n"
- + Printerlib::result["stderr"]:"" + "\n" + Printerlib::result["stdout"]:""
- + separator
- + error_messages + "\n"
- + result_details
- );
- return false;
- }
- if( Printerlib::ExecuteBashCommand( "ping -w 1 -c 1 " + server_name ) )
- { // The netcat-test failed but the ping-test was successful.
- // Show negative feedback:
- Popup::ErrorDetails( sformat( // Popup::ErrorDetails message
- // where %1 will be replaced by the server name.
- _("The server '%1' is not accessible"),
- server_name
- ),
- // Popup::ErrorDetails details:
- error_messages + "\n"
- + ping_test_good_message
- + separator
- + result_details + "\n"
- + Printerlib::result["stderr"]:"" + "\n"
- + Printerlib::result["stdout"]:""
- );
- return false;
- }
- // The ping-test failed:
- error_messages = error_messages + "\n" + ping_test_fail_message;
- result_details = result_details + "\n" + Printerlib::result["stderr"]:"" + "\n" + Printerlib::result["stdout"]:"";
- // When the netcat-test and the ping-test failed
- // do a last test:
- if( ! Printerlib::ExecuteBashCommand( "type -P host" ) )
- { // host is required for the last test.
- // Show negative feedback:
- Popup::ErrorDetails( // Popup::ErrorDetails message
- _("Cannot execute the program 'host'"),
- // Popup::ErrorDetails details:
- _("The RPM package 'bind-utils' is required for a meaningful test.") + "\n"
- + Printerlib::result["stderr"]:"" + "\n" + Printerlib::result["stdout"]:""
- + separator
- + error_messages + "\n"
- + result_details
- );
- return false;
- }
- if( Printerlib::ExecuteBashCommand( "host -W 1 " + server_name ) )
- { // The netcat-test and the ping-test failed but the host-test was successful.
- // Show negative feedback:
- Popup::ErrorDetails( sformat( // Popup::ErrorDetails message
- // where %1 will be replaced by the server name.
- _("The server '%1' does not respond in the network"),
- server_name
- ),
- // Popup::ErrorDetails details:
- error_messages + "\n"
- + host_test_good_message
- + separator
- + result_details + "\n"
- + Printerlib::result["stderr"]:"" + "\n" + Printerlib::result["stdout"]:""
- );
- return false;
- }
- // The netcat-test and the ping-test and the host-test failed:
- // Show negative feedback:
- Popup::ErrorDetails( sformat( // Popup::ErrorDetails message
- // where %1 will be replaced by the server name.
- _("The server '%1' is unknown"),
- server_name
- ),
- // Popup::ErrorDetails details:
- error_messages + "\n"
- + host_test_fail_message
- + separator
- + result_details + "\n"
- + Printerlib::result["stderr"]:"" + "\n" + Printerlib::result["stdout"]:""
- );
- return false;
-}
-
boolean ShowBrowsingFirewallPopup()
{ if( Printerlib::FirewallSeemsToBeActive() )
{ Popup::MessageDetails( // Popup::MessageDetails message:
@@ -453,9 +292,9 @@
// for a client-only config but the workstation is currently not connected to the network
// where the client-only server is (e.g. in the department for which the workstation is set up).
// Therefore the admin can force YaST to proceed here.
- // Do not show additional error messages here because TestClientOnlyServer()
+ // Do not show additional error messages here because Printer::TestClientOnlyServer()
// shows sufficient popups to the user:
- if( ! TestClientOnlyServer( current_client_conf_value ) )
+ if( ! Printer::TestClientOnlyServer( current_client_conf_value, true ) )
{ if( ! Popup::ContinueCancelHeadline( sformat( // Header of a Popup::ContinueCancelHeadline
// when a client-only server is not accessible
// where %1 will be replaced by the server name:
@@ -1086,7 +925,7 @@
if( `test_client_conf_server == event["ID"]:nil )
{ string current_client_conf_input_value = (string)UI::QueryWidget( `id(`client_conf_input), `Value );
// Ignore what TestClientOnlyServer() returns, it shows sufficient popups to the user:
- TestClientOnlyServer( deletechars( tolower( current_client_conf_input_value ), " " ) );
+ Printer::TestClientOnlyServer( deletechars( tolower( current_client_conf_input_value ), " " ), true );
}
}
return nil;
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org