Hello community,
here is the log from the commit of package yast2-printer
checked in at Thu Sep 25 23:53:48 CEST 2008.
--------
--- yast2-printer/yast2-printer.changes 2008-09-19 14:09:54.000000000 +0200
+++ /mounts/work_src_done/STABLE/yast2-printer/yast2-printer.changes 2008-09-25 17:58:14.391177000 +0200
@@ -1,0 +2,11 @@
+Thu Sep 25 17:48:21 CEST 2008 - jsmeix@suse.de
+
+- First usable version of the "Share Printers" dialog.
+ Curently it is not yet implemented to share via
+ individual IP addresses.
+- Increased MAXIMUM_WAIT to 60 seconds in
+ tools/create_printer_ppd_database
+ (see Novell/Suse Bugzilla bnc#429397).
+- 2.17.16
+
+-------------------------------------------------------------------
Old:
----
yast2-printer-2.17.15.tar.bz2
New:
----
yast2-printer-2.17.16.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-printer.spec ++++++
--- /var/tmp/diff_new_pack.b13211/_old 2008-09-25 23:53:38.000000000 +0200
+++ /var/tmp/diff_new_pack.b13211/_new 2008-09-25 23:53:38.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-printer (Version 2.17.15)
+# spec file for package yast2-printer (Version 2.17.16)
#
# 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.15
+Version: 2.17.16
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-printer-2.17.15.tar.bz2
+Source0: yast2-printer-2.17.16.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.15
+%setup -n yast2-printer-2.17.16
%build
%{prefix}/bin/y2tool y2autoconf
@@ -119,6 +119,14 @@
%exclude %{prefix}/share/doc/packages/yast2-printer/COPYING
%exclude %{prefix}/share/doc/packages/yast2-printer/README
%changelog
+* Thu Sep 25 2008 jsmeix@suse.de
+- First usable version of the "Share Printers" dialog.
+ Curently it is not yet implemented to share via
+ individual IP addresses.
+- Increased MAXIMUM_WAIT to 60 seconds in
+ tools/create_printer_ppd_database
+ (see Novell/Suse Bugzilla bnc#429397).
+- 2.17.16
* Fri Sep 19 2008 mzugec@suse.de
- start cups during installation proposal (bnc#418585)
- 2.17.15
++++++ yast2-printer-2.17.15.tar.bz2 -> yast2-printer-2.17.16.tar.bz2 ++++++
++++ 4516 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-printer-2.17.15/configure.in new/yast2-printer-2.17.16/configure.in
--- old/yast2-printer-2.17.15/configure.in 2008-09-16 18:11:13.000000000 +0200
+++ new/yast2-printer-2.17.16/configure.in 2008-09-25 17:50:43.000000000 +0200
@@ -1,9 +1,9 @@
dnl configure.in for yast2-printer
dnl
-dnl -- This file is generated by y2autoconf 2.17.6 - DO NOT EDIT! --
+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.14, http://bugs.opensuse.org/, yast2-printer)
+AC_INIT(yast2-printer, 2.17.16, 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.14"
+VERSION="2.17.16"
RPMNAME="yast2-printer"
MAINTAINER="Michal Zugec "
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-printer-2.17.15/src/helps.ycp new/yast2-printer-2.17.16/src/helps.ycp
--- old/yast2-printer-2.17.15/src/helps.ycp 2008-09-16 16:24:36.000000000 +0200
+++ new/yast2-printer-2.17.16/src/helps.ycp 2008-09-24 17:20:29.000000000 +0200
@@ -220,14 +220,14 @@
The only setting which should be checked in any case is the paper size
which must be set to what is actually used by default in the printer.
</p>") +
-// BasicModifyDialog help 2/3:
+// DriverOptionsDialog help 2/3:
_("<p>
Non-default settings may not work in any case or have unexpected consequences.<br>
For example a high resolution setting may not work for a laser printer
when its default built-in memory is insufficient to process high resolution pages.<br>
Or a high quality setting may print intolerable slow on an inkjet printer.
</p>") +
-// BasicModifyDialog help 3/3:
+// DriverOptionsDialog help 3/3:
_("<p>
On the other hand in certain cases printer-specific driver settings
must be adjusted to get the full functionality of a printer.<br>
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-printer-2.17.15/src/overview.ycp new/yast2-printer-2.17.16/src/overview.ycp
--- old/yast2-printer-2.17.15/src/overview.ycp 2008-09-19 14:07:38.000000000 +0200
+++ new/yast2-printer-2.17.16/src/overview.ycp 2008-09-24 17:20:29.000000000 +0200
@@ -46,9 +46,10 @@
term widgetOverview = `VBox
( `Left
( `HBox
- ( `Label( // Label for CheckBoxes to select local and/or remote print queues to be listed:
- _("Show")
- ),
+ ( `Label
+ ( // Label for CheckBoxes to select local and/or remote print queues to be listed:
+ _("Show")
+ ),
`HSpacing( 2 ),
`CheckBox
( `id(`local_content_checkbox),
@@ -62,6 +63,16 @@
`opt(`notify),
// CheckBox to select remote print queues to be listed:
_("&Remote")
+ ),
+ `HSpacing( 1 ),
+ `Label
+ ( `id(`client_only_server_name),
+ // This spaces string is a workaround for a bug in the UI
+ // to preallocate space on the screen when the spaces string
+ // is replaced by a real string if it is a client-only config.
+ // Otherwise the real string is cut to less than one character
+ // (at least with openSUSE 11.0 and Qt):
+ " "
)
)
),
@@ -118,7 +129,7 @@
{ boolean local_content_selected = Printer::queue_filter_show_local;
boolean remote_content_selected = Printer::queue_filter_show_remote;
boolean local_cupsd_required = true;
- // Determine whether or not it is currently a real client_only config
+ // 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();
@@ -126,6 +137,16 @@
{ 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:
if( local_cupsd_required && ! Printerlib::GetAndSetCupsdStatus( "" ) )
@@ -190,7 +211,7 @@
UI::ChangeWidget( `test, `Enabled, false );
}
else
- { if( "yes" == Printer::queues[selected_queue_index,"rejecting"]:""
+ { if( "yes" == Printer::queues[selected_queue_index,"rejecting"]:""
|| "yes" == Printer::queues[selected_queue_index,"disabled"]:""
)
{ UI::ChangeWidget( `test, `Enabled, false );
@@ -209,8 +230,8 @@
// Disable the modify and delete buttons when a remote queue is selected and by fallback:
}
}
- UI::ChangeWidget(`edit, `Enabled, Printer::selected_queues_index >= 0 );
- UI::ChangeWidget(`delete, `Enabled, Printer::selected_queues_index >= 0 );
+ UI::ChangeWidget( `edit, `Enabled, Printer::selected_queues_index >= 0 );
+ UI::ChangeWidget( `delete, `Enabled, Printer::selected_queues_index >= 0 );
if( `delete == event["ID"]:nil && "Activated" == event["EventReason"]:"" )
{ string queue_name = Printer::queues[selected_queue_index,"name"]:"";
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-printer-2.17.15/src/Printerlib.ycp new/yast2-printer-2.17.16/src/Printerlib.ycp
--- old/yast2-printer-2.17.15/src/Printerlib.ycp 2008-09-16 16:24:36.000000000 +0200
+++ new/yast2-printer-2.17.16/src/Printerlib.ycp 2008-09-24 17:20:29.000000000 +0200
@@ -102,7 +102,7 @@
{ return false;
}
if( ! Service::Start( "cups" ) )
- { Popup::ErrorDetails( // Popup::ErrorDetails header:
+ { Popup::ErrorDetails( // Popup::ErrorDetails message:
_("Failed to start the CUPS daemon"),
Service::Error()
);
@@ -127,7 +127,7 @@
return false;
}
if( ! Service::Enable( "cups" ) )
- { Popup::ErrorDetails( // Popup::ErrorDetails header:
+ { Popup::ErrorDetails( // Popup::ErrorDetails message:
_("Failed to enable starting of the CUPS daemon during system boot"),
Service::Error()
);
@@ -149,7 +149,7 @@
{ return false;
}
if( ! Service::Restart( "cups" ) )
- { Popup::ErrorDetails( // Popup::ErrorDetails header:
+ { Popup::ErrorDetails( // Popup::ErrorDetails message:
_("Failed to restart the CUPS daemon"),
Service::Error()
);
@@ -180,7 +180,7 @@
)
)
{ if( ! Service::Enable( "cups" ) )
- { Popup::ErrorDetails( // Popup::ErrorDetails header:
+ { Popup::ErrorDetails( // Popup::ErrorDetails message:
_("Failed to enable starting of the CUPS daemon during system boot"),
Service::Error()
);
@@ -235,7 +235,8 @@
{ client_conf_server_name = result["stdout"]:"";
if( "" != client_conf_server_name
&& "localhost" != client_conf_server_name
- && "127.0.0.1" != client_conf_server_name )
+ && "127.0.0.1" != client_conf_server_name
+ )
{ // Note that even 'localhost' or '127.0.0.1' is a valid ServerName value
// which is used to force client tools (e.g. lpadmin, lpinfo, lpstat)
// to ask the local cupsd via the IPP port on localhost (127.0.0.1:631)
@@ -244,17 +245,42 @@
// If the ServerName value in /etc/cups/client.conf is 'localhost'
// it is actually no client-only config because the local cupsd is used.
client_only = true;
+ return true;
}
- else
- { client_only = false;
- }
- }
- else
- { // Use fallback values when the command above failed:
- client_conf_server_name = "";
client_only = false;
+ return true;
+ }
+ // The cups_client_only tool failed:
+ client_conf_server_name = result["stdout"]:"";
+ if( "" != client_conf_server_name
+ && "localhost" != client_conf_server_name
+ && "127.0.0.1" != client_conf_server_name
+ )
+ { // When there is a non-empty client_conf_server_name,
+ // cups_client_only fails when the client-only server is not accessible:
+ Popup::ErrorDetails( // Popup::ErrorDetails message
+ // where %1 will be replaced by the server name.
+ sformat( _("The CUPS server '%1' is not accessible"), client_conf_server_name ),
+ result["stderr"]:""
+ );
+ client_only = true;
return false;
}
+ if( "localhost" == client_conf_server_name
+ || "127.0.0.1" == client_conf_server_name
+ )
+ { client_only = false;
+ if( ! GetAndSetCupsdStatus( "" ) )
+ { if( ! GetAndSetCupsdStatus( "start" ) )
+ { return false;
+ }
+ }
+ return true;
+ }
+ // The cups_client_only tool failed for whatever reason.
+ // Use fallback values:
+ client_conf_server_name = "";
+ client_only = false;
return true;
}
@@ -296,7 +322,7 @@
global list< string > cupsd_conf_browse_allow = [ "all" ];
global boolean DetermineBrowseAllow()
-{ // Determine the 'BrowseAllow [ all | none | @LOCAL | IP-address[/netmask] ]' values in /etc/cups/cupsd.conf:
+{ // Determine the 'BrowseAllow [ all | none | @LOCAL | IP-address[/netmask] ]' values in /etc/cups/cupsd.conf:
if( ExecuteBashCommand( yast_bin_dir + "modify_cupsd_conf BrowseAllow" ) )
{ // The command outputs a line where multiple BrowseAllow values are separated by space
// but possible duplicate BrowseAllow values are not removed in the command output:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-printer-2.17.15/src/Printer.ycp new/yast2-printer-2.17.16/src/Printer.ycp
--- old/yast2-printer-2.17.15/src/Printer.ycp 2008-09-16 17:31:24.000000000 +0200
+++ new/yast2-printer-2.17.16/src/Printer.ycp 2008-09-25 13:55:31.000000000 +0200
@@ -41,7 +41,6 @@
import "Message";
import "Popup";
import "Printerlib";
-import "NetworkInterfaces";
import "Mode";
import "Stage";
import "Service";
@@ -613,7 +612,12 @@
);
// Progress 1. stage (Autodetect already configured printers):
if( Abort() ) return false;
- //in second stage of installation be sure that cups is running
+ // Only in the second stage of the system installation make sure that a local cupsd is running
+ // because it is needed for automated queue setup during system installation
+ // see https://bugzilla.novell.com/show_bug.cgi?id=418585
+ // Note that otherwise a local cupsd is not required (e.g. when it is a client-only setup).
+ // There are various checks in each individual case whether or not a local cupsd is required.
+ // E.g. it is required to "Add" a local queue or to "Share Printers" (i.e. share local queues).
if (Mode::installation() && Stage::cont()){
if (Service::Status("cups")!=0)
Service::Start("cups");
@@ -621,10 +625,9 @@
Printerlib::Read();
// Progress last stage (progress finished):
if( Abort() ) return false;
- NetworkInterfaces::Read();
Progress::NextStage();
// Sleep half a second to let the user notice that the progress is finished:
-// sleep( 500 );
+ sleep( 500 );
if( Abort() ) return false;
Progress::Finish();
return true;
@@ -739,8 +742,7 @@
* @return table items
*/
global list QueueItems( boolean local, boolean remote )
-{
- // Invalidate selected_queues_index to be safe:
+{ // Invalidate selected_queues_index to be safe:
selected_queues_index = -1;
if( ! AutodetectQueues() )
{ Report::Error( // Message of a Report::Error.
@@ -748,7 +750,7 @@
// (i.e. a system which is not totally broken or totally messed up).
// Do not confuse this error with the case when no queue was detected
// (e.g. simply because there is no queue). This results no error.
- _("Failed to detect print queues.")
+ _("Cannot show print queues (failed to detect print queues).")
);
// Return an empty list:
return [];
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-printer-2.17.15/src/printingvianetwork.ycp new/yast2-printer-2.17.16/src/printingvianetwork.ycp
--- old/yast2-printer-2.17.15/src/printingvianetwork.ycp 2008-09-19 14:07:38.000000000 +0200
+++ new/yast2-printer-2.17.16/src/printingvianetwork.ycp 2008-09-25 14:04:51.000000000 +0200
@@ -186,7 +186,7 @@
if( ! Printerlib::ExecuteBashCommand( "type -P netcat" ) )
{ // netcat is required for a meaningful test.
// Show negative feedback:
- Popup::ErrorDetails( // Popup::ErrorDetails header:
+ Popup::ErrorDetails( // Popup::ErrorDetails message:
_("Cannot execute the program 'netcat'"),
// Popup::ErrorDetails details:
_("The RPM package 'netcat' is required for a meaningful test.") + "\n"
@@ -194,6 +194,20 @@
);
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" == 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
@@ -208,7 +222,7 @@
if( ! Printerlib::ExecuteBashCommand( "type -P ping" ) )
{ // ping is required for the less meaningful test.
// Show negative feedback:
- Popup::ErrorDetails( // Popup::ErrorDetails header
+ Popup::ErrorDetails( // Popup::ErrorDetails message
_("Cannot execute the program 'ping'"),
// Popup::ErrorDetails details:
_("The RPM package 'iputils' is required for a meaningful test.") + "\n"
@@ -222,7 +236,7 @@
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 header
+ Popup::ErrorDetails( sformat( // Popup::ErrorDetails message
// where %1 will be replaced by the server name.
_("The server '%1' is not accessible"),
server_name
@@ -245,7 +259,7 @@
if( ! Printerlib::ExecuteBashCommand( "type -P host" ) )
{ // host is required for the last test.
// Show negative feedback:
- Popup::ErrorDetails( // Popup::ErrorDetails header
+ 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"
@@ -259,7 +273,7 @@
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 header
+ 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
@@ -275,7 +289,7 @@
}
// The netcat-test and the ping-test and the host-test failed:
// Show negative feedback:
- Popup::ErrorDetails( sformat( // Popup::ErrorDetails header
+ Popup::ErrorDetails( sformat( // Popup::ErrorDetails message
// where %1 will be replaced by the server name.
_("The server '%1' is unknown"),
server_name
@@ -313,7 +327,7 @@
// which might be needed by the "Share Printers" dialog.
// Instead set only "BrowseAllow none" in cupsd.conf:
if( ! Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir + "modify_cupsd_conf BrowseAllow none" ) )
- { Popup::ErrorDetails( // Popup::ErrorDetails header:
+ { Popup::ErrorDetails( // Popup::ErrorDetails message:
_("Failed to set 'BrowseAllow none' in /etc/cups/cupsd.conf"),
Printerlib::result["stderr"]:""
);
@@ -365,7 +379,7 @@
&& "none" != server_name
)
{ if( ! Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir + "cups_client_only " + server_name ) )
- { Popup::ErrorDetails( // Popup::ErrorDetails header
+ { Popup::ErrorDetails( // Popup::ErrorDetails message
// where %1 will be replaced by the server name.
sformat( _("Failed to set 'ServerName %1' in /etc/cups/client.conf"), server_name ),
Printerlib::result["stderr"]:""
@@ -378,7 +392,7 @@
// and afterwards the "No browsing info" radio button was activated.
// This should disable the client-only setup but not start the local cupsd:
if( ! Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir + "cups_client_only none" ) )
- { Popup::ErrorDetails( // Popup::ErrorDetails header:
+ { Popup::ErrorDetails( // Popup::ErrorDetails message:
_("Failed to remove the 'ServerName' entry in /etc/cups/client.conf"),
Printerlib::result["stderr"]:""
);
@@ -427,7 +441,7 @@
}
// Remove the 'ServerName' entry in /etc/cups/client.conf:
if( ! Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir + "cups_client_only none" ) )
- { Popup::ErrorDetails( // Popup::ErrorDetails header:
+ { Popup::ErrorDetails( // Popup::ErrorDetails message:
_("Failed to remove the 'ServerName' entry in /etc/cups/client.conf"),
Printerlib::result["stderr"]:""
);
@@ -480,7 +494,7 @@
{ // Only a not-"none" browse_allow_value requires "Browsing On" in cupsd.conf.
// Otherwise leave the "Browsing" entry in cupsd.conf unchanged.
if( ! Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir + "modify_cupsd_conf Browsing On" ) )
- { Popup::ErrorDetails( // Popup::ErrorDetails header:
+ { Popup::ErrorDetails( // Popup::ErrorDetails message:
_("Failed to set 'Browsing On' in /etc/cups/cupsd.conf"),
Printerlib::result["stderr"]:""
);
@@ -493,7 +507,7 @@
+ "'"
)
)
- { Popup::ErrorDetails( // Popup::ErrorDetails header
+ { Popup::ErrorDetails( // Popup::ErrorDetails message
// where %1 will be replaced by the values for BrowseAllow.
sformat( _("Failed to set BrowseAllow value(s) '%1' in /etc/cups/cupsd.conf"),
browse_allow_value
@@ -524,6 +538,7 @@
// Client-only:
if( `client_only_radio_button == current_radio_button )
{ string server_name = deletechars( tolower( current_server_name_input_value ), " " );
+ boolean enforce_client_only_server_setting = false;
if( "" == server_name
|| "none" == server_name
)
@@ -534,7 +549,7 @@
// is still a "client-only" config (but an already running local cupsd
// is also not stopped):
if( ! Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir + "cups_client_only none" ) )
- { Popup::ErrorDetails( // Popup::ErrorDetails header:
+ { Popup::ErrorDetails( // Popup::ErrorDetails message:
_("Failed to remove the 'ServerName' entry in /etc/cups/client.conf"),
Printerlib::result["stderr"]:""
);
@@ -542,12 +557,34 @@
}
return true;
}
- // A non-accessible client-only server leads to an endless sequence
- // of weird further behaviour of the module so that such a server name
- // is simply not accepted. Do not show additional error messages here
- // because TestClientOnlyServer() shows sufficient popups to the user:
+ // 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 not accepted.
+ // This means that it is not possible to set up a client-only config first
+ // and then make the client-only server accessible (e.g. boot the client-only server,
+ // open ports in firewall, set up the network connection, whatever else).
+ // This would be a problem when a workstation is set up by an admin in the IP department
+ // 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()
+ // shows sufficient popups to the user:
if( ! TestClientOnlyServer( server_name ) )
- { return false;
+ { 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:
+ _("Continue regardless that '%1' is not accessible?"),
+ server_name
+ ),
+ // Body of a Popup::ContinueCancelHeadline
+ // when a client-only server is not accessible:
+ _("A non-accessible server leads to an endless sequence of further failures.")
+ )
+ )
+ { // The user has decided not to continue:
+ return false;
+ }
+ // The user has decided to continue regardless that the client-only server is not accessible:
+ enforce_client_only_server_setting = true;
}
if( `browsing_off_radio_button == initial_radio_button
|| `browsing_on_radio_button == initial_radio_button
@@ -584,23 +621,21 @@
{ // Nothing has changed:
return true;
}
- // Test for "localhost/"127.0.0.1" first and make a local cupsd accessible
- // because the "cups_client_only" tool which sets the ServerName in client.conf
- // tests in any case if the cupsd on ServerName is accessible:
- if( "localhost" == 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( Printerlib::yast_bin_dir + "cups_client_only " + server_name ) )
- { Popup::ErrorDetails( // Popup::ErrorDetails header
+ { if( enforce_client_only_server_setting )
+ { // The user has decided to continue regardless that the client-only server is not accessible.
+ // In this case the cups_client_only tool fails in any case because it also tests accessibility.
+ // But cups_client_only might have failed for whatever other reason.
+ // Therefore a Popup::MessageDetails is shown to inform about the actual result:
+ Popup::MessageDetails( // Popup::MessageDetails message
+ // where %1 will be replaced by the server name.
+ sformat( _("Tried to set 'ServerName %1' in /etc/cups/client.conf"), server_name ),
+ Printerlib::result["stderr"]:""
+ );
+ // Exit successfully in this special case regardless of whatever failures:
+ return true;
+ }
+ Popup::ErrorDetails( // Popup::ErrorDetails message
// where %1 will be replaced by the server name.
sformat( _("Failed to set 'ServerName %1' in /etc/cups/client.conf"), server_name ),
Printerlib::result["stderr"]:""
@@ -649,16 +684,16 @@
// and it should also not contain "none" because this setting
// is implicitely done via browsing_off_radio_button:
string browse_allow_input_value = mergestring( filter( string value,
- Printerlib::cupsd_conf_browse_allow,
- { value = tolower( value );
- return( "all" != value
- && "@local" != value
- && "none" != value
- );
- }
- ),
- " "
- );
+ Printerlib::cupsd_conf_browse_allow,
+ { value = tolower( value );
+ return( "all" != value
+ && "@local" != value
+ && "none" != value
+ );
+ }
+ ),
+ " "
+ );
initial_browse_allow_input_value = browse_allow_input_value;
UI::ChangeWidget( `id(`browse_allow_input), `Value, browse_allow_input_value );
UI::ChangeWidget( `id(`browse_allow_input_label), `Enabled, false );
@@ -765,8 +800,8 @@
{ y2milestone( "entering storeNetworkPrinting with key '%1'\nand event '%2'", key, event );
if( ! ApplyNetworkPrintingSettings() )
{ Popup::Error( // Popup::Error message:
- _("Failed to apply the settings to the system.")
- );
+ _("Failed to apply the settings to the system.")
+ );
}
if( ! printing_via_network_has_changed )
{ y2milestone( "Nothing changed in 'Printing via Network' dialog." );
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-printer-2.17.15/src/sharing.ycp new/yast2-printer-2.17.16/src/sharing.ycp
--- old/yast2-printer-2.17.15/src/sharing.ycp 2008-09-19 14:07:13.000000000 +0200
+++ new/yast2-printer-2.17.16/src/sharing.ycp 2008-09-25 17:40:13.000000000 +0200
@@ -34,11 +34,22 @@
import "Label";
import "Wizard";
import "Printer";
+import "Printerlib";
import "Popup";
-import "NetworkInterfaces";
include "printer/helps.ycp";
+boolean share_printers_dialog_is_useless = false;
+list< term > interface_table_items = [];
+list< term > ip_table_items = [];
+list< string > available_interfaces = [];
+boolean sharing_has_changed = false;
+boolean initial_deny_remote_access = true;
+boolean initial_allow_remote_access = false;
+boolean initial_allow_local_network_access = false;
+boolean initial_publish_to_local_network = false;
+list< term > initial_interface_table_items = [];
+
term widgetSharing = `VBox
( `VSpacing( 1 ),
`RadioButtonGroup
@@ -47,20 +58,20 @@
( `Left
( `RadioButton
( `id(`deny_remote_access_radio_button),
- `opt(`notify),
+ `opt(`notify, `immediate),
// A RadioButton label to deny remote access to local print queues:
_("&Deny remote access"),
- true
+ initial_deny_remote_access
)
),
`VSpacing( 2 ),
`Left
( `RadioButton
( `id(`allow_remote_access_radio_button),
- `opt(`notify),
+ `opt(`notify, `immediate),
// A RadioButton label to allow remote access to local print queues:
_("&Allow remote access"),
- false
+ initial_allow_remote_access
)
)
)
@@ -72,10 +83,11 @@
( `Left
( `CheckBox
( `id(`allow_local_network_access_check_box),
+ `opt(`notify),
// A CheckBox label to allow remote access to local print queues
// for computers within the local network:
_("For computers within the &local network"),
- true
+ initial_allow_local_network_access
)
),
`Left
@@ -83,16 +95,18 @@
( `HSpacing( 2 ),
`CheckBox
( `id(`publish_to_local_network_check_box),
+ `opt(`notify),
// A CheckBox label to publish local print queues by default within the local network:
_("&Publish printers by default within the local network"),
- true
+ initial_publish_to_local_network
)
)
),
`VSpacing( 1 ),
`Left
( `Label
- ( // A caption for a table to allow remote access to local print queues
+ ( `id(`interface_table_label),
+ // A caption for a table to allow remote access to local print queues
// via network interfaces specified in the table below:
_("Via network interfaces specified below")
)
@@ -107,9 +121,7 @@
// via the network interface in the other table column:
_("Publish printers by default via this interface")
),
- [ `item( `id(0), "eth0", "no" ),
- `item( `id(1), "eth1", "yes" )
- ]
+ initial_interface_table_items
),
`Left
( `HBox
@@ -134,9 +146,17 @@
)
),
`VSpacing( 1 ),
+
+ // Have the IP table disabled until its functionality is implemented:
+ `Frame
+ ( "This functionality is not yet implemented:",
+ `VBox
+ (
+
`Left
( `Label
- ( // A caption for a table to allow remote access to local print queues
+ ( `id(`ip_table_label),
+ // A caption for a table to allow remote access to local print queues
// for hosts and/or networks specified in the table below:
_("For hosts / networks specified below")
)
@@ -151,11 +171,7 @@
// via the IP address in the other table column:
_("Publish printers by default for this address")
),
- [ `item( `id(0), "192.168.100.1", "yes" ),
- `item( `id(1), "192.168.100.2", "no" ),
- `item( `id(2), "192.168.200.0/24", "no" ),
- `item( `id(3), "192.168.300.0/255.255.255.0", "yes" )
- ]
+ ip_table_items
),
`Left
( `HBox
@@ -179,43 +195,59 @@
)
)
)
+
+ )
+ )
+
)
),
`VSpacing( 1 )
);
-boolean sharing_has_changed = false;
-
-map showInterfacePopup(string device, boolean publish){
- map result = $[];
- list<string> devices = NetworkInterfaces::List("");
- UI::OpenDialog( `VBox(
- `CheckBox(`id(`publish), _("&Publish printers by default via "), publish),
- // translators: combo box label for list of configured IPs
- `ComboBox( `id(`device), `opt( `editable ), _("Network &Devices:"), devices ),
- `VSpacing(),
- `HBox(
- `PushButton( `id(`ok), Label::OKButton() ),
- `PushButton( `id(`cancel), Label::CancelButton() )
- )
- ));
- if(device!="") UI::ChangeWidget(`device, `Value, device);
- while(true){
- any ret = UI::UserInput();
- if (ret==`cancel){
- result=nil;
- break;
+map< string, string > showInterfacePopup( string interface_name, boolean is_published )
+{ map< string, string > interface_map = $[];
+ UI::OpenDialog
+ ( `VBox
+ ( `CheckBox
+ ( `id(`publish_check_box),
+ // A CheckBox label to publish local print queues by default
+ // via a partivular network interface which is shown below.
+ _("&Publish printers by default via the network interface below."),
+ is_published
+ ),
+ `ComboBox
+ ( `id(`interfaces_combo_box),
+ `opt( `editable ),
+ // A header for a ComboBox which lists network interfaces:
+ _("Available Network &Interfaces:"),
+ available_interfaces
+ ),
+ `VSpacing(),
+ `HBox
+ ( `PushButton( `id(`ok), Label::OKButton() ),
+ `PushButton( `id(`cancel), Label::CancelButton() )
+ )
+ )
+ );
+ if( "" != interface_name )
+ { UI::ChangeWidget( `interfaces_combo_box, `Value, interface_name );
}
- if (ret==`ok){
- publish = (boolean)UI::QueryWidget(`publish, `Value);
- device = (string)UI::QueryWidget(`device, `Value);
- result["device"]=device;
- result["publish"]=publish ? "yes" : "no";
- break;
+ while( true )
+ { any ret = UI::UserInput();
+ if( `cancel == ret )
+ { interface_map = nil;
+ break;
+ }
+ if( `ok == ret )
+ { interface_name = (string)UI::QueryWidget( `interfaces_combo_box, `Value );
+ is_published = (boolean)UI::QueryWidget( `publish_check_box, `Value );
+ interface_map["interface_name"] = interface_name;
+ interface_map["is_published"] = is_published ? "yes" : "no";
+ break;
+ }
}
- }
- UI::CloseDialog();
- return result;
+ UI::CloseDialog();
+ return interface_map;
}
map showIPPopup(string device, boolean publish){
@@ -245,86 +277,550 @@
break;
}
}
- UI::CloseDialog();
+ UI::CloseDialog();
return result;
}
+boolean ApplySharingSettings()
+{ sharing_has_changed = false;
+ // Get the actual settings and values from the dialog.
+ // It does not work well to query the RadioButtonGroup with something like
+ // UI::QueryWidget(`deny_or_allow_remote_access,`CurrentButton))
+ // Reason: At least with openSUSE 11.0 and Qt
+ // it is possible to un-check all buttons in a RadioButtonGroup
+ // by clicking on the currently checked button which un-checks it
+ // so that there might be no CurrentButton which leads to unexpected results.
+ // Therefore the individual buttons are tested directly to be on the safe side:
+ boolean deny_remote_access = (boolean)UI::QueryWidget( `deny_remote_access_radio_button, `Value );
+ y2milestone( "deny_remote_access_radio_button value: '%1'", deny_remote_access );
+ boolean allow_remote_access = (boolean)UI::QueryWidget( `allow_remote_access_radio_button, `Value );
+ y2milestone( "allow_remote_access_radio_button value: '%1'", allow_remote_access );
+ boolean allow_local_network_access = (boolean)UI::QueryWidget( `allow_local_network_access_check_box, `Value );
+ y2milestone( "allow_local_network_access_check_box value: '%1'", allow_local_network_access );
+ boolean publish_to_local_network = (boolean)UI::QueryWidget( `publish_to_local_network_check_box, `Value );
+ y2milestone( "publish_to_local_network_check_box value: '%1'", publish_to_local_network );
+ interface_table_items = (list<term>)UI::QueryWidget( `interface_table, `Items );
+ y2milestone( "interface_table_items: %1", interface_table_items );
+ // Keep deny_remote_access.
+ // Ignore if other settings may have been changed
+ // because whatever Allow and BrowseAddress stuff is meaningless
+ // if remote access is denied at all:
+ if( deny_remote_access && initial_deny_remote_access )
+ { // Nothing has changed:
+ return true;
+ }
+ // Switch to deny_remote_access:
+ // Ignore if other settings may have been changed too
+ // because whatever Allow and BrowseAddress stuff is meaningless
+ // if remote access is denied at all:
+ // When both the deny_remote_access_radio_button and the allow_remote_access_radio_button are un-checked,
+ // assume the user wants deny_remote_access (via '! allow_remote_access') because this is the safe setting:
+ if( deny_remote_access || ! allow_remote_access )
+ { sharing_has_changed = true;
+ // It leads to inconsistencies if only Only set 'Listen localhost' would be set
+ // but Allow and BrowseAddress enties would be kept because when there are
+ // BrowseAddress enties, it must listen on matching remote interfaces
+ // and then also matching Allow enties should be there.
+ if( ! Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir + "modify_cupsd_conf Listen localhost" ) )
+ { Popup::ErrorDetails( // Popup::ErrorDetails message.
+ // Do not change or translate "Listen localhost", it is a system settings name.
+ _("Failed to set only 'Listen localhost' in /etc/cups/cupsd.conf"),
+ Printerlib::result["stderr"]:""
+ );
+ return false;
+ }
+ if( ! Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir + "modify_cupsd_conf Allow none" ) )
+ { Popup::ErrorDetails( // Popup::ErrorDetails message.
+ // Do not change or translate "Allow", it is a system settings name.
+ _("Failed to remove 'Allow' entries from /etc/cups/cupsd.conf"),
+ Printerlib::result["stderr"]:""
+ );
+ return false;
+ }
+ if( ! Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir + "modify_cupsd_conf BrowseAddress none" ) )
+ { Popup::ErrorDetails( // Popup::ErrorDetails message.
+ // Do not change or translate "BrowseAddress", it is a system settings name.
+ _("Failed to remove 'BrowseAddress' entries from /etc/cups/cupsd.conf"),
+ Printerlib::result["stderr"]:""
+ );
+ return false;
+ }
+ // If a local cupsd is accessible, restart it,
+ // otherwise do nothing (i.e. do not start it now):
+ if( Printerlib::GetAndSetCupsdStatus( "" ) )
+ { if( ! Printerlib::GetAndSetCupsdStatus( "restart" ) )
+ { return false;
+ }
+ }
+ return true;
+ }
+ // Any kind of allow_remote_access:
+ // Check if there are real changes:
+ if( allow_local_network_access != initial_allow_local_network_access
+ || publish_to_local_network != initial_publish_to_local_network
+ )
+ { sharing_has_changed = true;
+ }
+ // Check if there are real changes in the table of interfaces.
+ // Ignore ordering and ignore duplicates (toset)
+ // but do not ignore case because network interface names are case sensitive:
+ list< string > initial_interface_table_entries = [];
+ foreach( term initial_interface_table_item,
+ initial_interface_table_items,
+ { initial_interface_table_entries = add( initial_interface_table_entries,
+ initial_interface_table_item[1]:""
+ + initial_interface_table_item[2]:""
+ );
+ }
+ );
+ initial_interface_table_entries = toset( initial_interface_table_entries );
+ list< string > interface_table_entries = [];
+ foreach( term interface_table_item,
+ interface_table_items,
+ { interface_table_entries = add( interface_table_entries,
+ interface_table_item[1]:""
+ + interface_table_item[2]:""
+ );
+ }
+ );
+ interface_table_entries = toset( interface_table_entries );
+ if( mergestring( interface_table_entries, "" ) != mergestring( initial_interface_table_entries, "" ) )
+ { sharing_has_changed = true;
+ }
+ if( ! sharing_has_changed )
+ { // Nothing has changed:
+ return true;
+ }
+ string allow_values = "";
+ string browse_address_values = "";
+ foreach( term interface_table_item,
+ interface_table_items,
+ { string interface_name = interface_table_item[1]:"";
+ string is_published = interface_table_item[2]:"";
+ if( "" != interface_name )
+ { allow_values = "@IF(" + interface_name + ") " + allow_values;
+ // Add the inferface nameto browse_address_values
+ // only if remote access is allowed for this interface:
+ if( "yes" == is_published )
+ { browse_address_values = "@IF(" + interface_name + ") " + browse_address_values ;
+ }
+ }
+ }
+ );
+ if( allow_local_network_access )
+ { allow_values = "@LOCAL " + allow_values;
+ // Add "@LOCAL" to browse_address_values
+ // only if remote access is allowed for "@LOCAL":
+ if( publish_to_local_network )
+ { browse_address_values = "@LOCAL " + browse_address_values;
+ }
+ }
+ if( ! Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir
+ + "modify_cupsd_conf Allow '"
+ + allow_values
+ + "'"
+ )
+ )
+ { Popup::ErrorDetails( sformat( // Popup::ErrorDetails message
+ // where %1 will be replaced by one or more system settings values.
+ // Do not change or translate "Allow", it is a system settings name.
+ _("Failed to set 'Allow' entries '%1' in /etc/cups/cupsd.conf"),
+ allow_values
+ ),
+ Printerlib::result["stderr"]:""
+ );
+ return false;
+ }
+ if( ! Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir
+ + "modify_cupsd_conf BrowseAddress '"
+ + browse_address_values
+ + "'"
+ )
+ )
+ { Popup::ErrorDetails( sformat( // Popup::ErrorDetails message
+ // where %1 will be replaced by one or more system settings values.
+ // // Do not change or translate "BrowseAddress", it is a system settings name.
+ _("Failed to set 'BrowseAddress' entries '%1' in /etc/cups/cupsd.conf"),
+ browse_address_values
+ ),
+ Printerlib::result["stderr"]:""
+ );
+ return false;
+ }
+ // Currently 'Listen *:631' is simply set for any kind of remote access
+ // because the Listen directive supports only network addresses as value.
+ // Neither 'Listen @LOCAL' nor 'Listen @IF(name)' is supported.
+ // TODO: Determine the matching network address for @LOCAL and @IF(name)
+ // and use the matching network address for the Listen directive.
+ if( ! Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir + "modify_cupsd_conf Listen all" ) )
+ { Popup::ErrorDetails( // Popup::ErrorDetails message.
+ // Do not change or translate "Listen *:631", it is a system settings name.
+ _("Failed to set 'Listen *:631' in /etc/cups/cupsd.conf"),
+ Printerlib::result["stderr"]:""
+ );
+ return false;
+ }
+ // If a local cupsd is accessible, restart it,
+ // otherwise do nothing (i.e. do not start it now):
+ if( Printerlib::GetAndSetCupsdStatus( "" ) )
+ { if( ! Printerlib::GetAndSetCupsdStatus( "restart" ) )
+ { return false;
+ }
+ }
+ // Exit successfully by default and as fallback:
+ return true;
+}
+
void initSharing( string key )
{ y2milestone( "entering initSharing with key '%1'", key );
- // Show a user information because the current implementation provides
- // only the dialog but does not read from the system or write to the system:
- Popup::AnyMessage( // Header of a Popup::AnyMessage because of a work-in-progress dialog:
- _("Under Connstruction"),
- // Body of a Popup::AnyMessage because of a work-in-progress dialog:
- _("Currently only the dialog shows up but it does\nneither read from the system nor write to the system.\n")
+ share_printers_dialog_is_useless = false;
+ sharing_has_changed = 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):
+ Printerlib::DetermineClientOnly();
+ if( Printerlib::client_only )
+ { if( ! Popup::YesNoHeadline( sformat( // PopupYesNoHeadline headline
+ // where %1 will be replaced by the server name:
+ _("Disable remote CUPS server '%1'"),
+ Printerlib::client_conf_server_name
+ ),
+ // PopupYesNoHeadline body:
+ _("A remote CUPS server setting conflicts with sharing local printer configurations.")
+ )
+ )
+ { share_printers_dialog_is_useless = true;
+ y2milestone( "share_printers_dialog_is_useless because user decided not to disable client-only CUPS server '%1'",
+ Printerlib::client_conf_server_name
+ );
+ }
+ else
+ { // 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"]:"" + "\n" + Printerlib::result["stdout"]:""
+ );
+ share_printers_dialog_is_useless = true;
+ y2milestone( "share_printers_dialog_is_useless because it failed to disable client-only CUPS server '%1'",
+ Printerlib::client_conf_server_name
);
+ }
+ }
+ }
+ // Determine whether or not a local cupsd is accessible:
+ if( ! Printerlib::GetAndSetCupsdStatus( "" ) )
+ { // Printerlib::GetAndSetCupsdStatus already shows a confirmation popup:
+ if( ! Printerlib::GetAndSetCupsdStatus( "start" ) )
+ { share_printers_dialog_is_useless = true;
+ y2milestone( "share_printers_dialog_is_useless because 'rccups start' failed." );
+ }
+ }
+ // Note that the "Share Printers" dialog is not useless when there is no local queue.
+ // For example the user may like to configure "Share Printers" (e.g. allow remote access)
+ // before he set up the first local queue or he may like to delete all local queues
+ // and then change the "Share Printers" stuff accordingly (e.g. deny remote access).
+ if( share_printers_dialog_is_useless )
+ { // The "Share Printers" dialog is (almost) useless.
+ // Therefore disable all widgets except the deny_remote_access_radio_button
+ // because the user may like to set deny remote access in /etc/cups/cupsd.conf
+ // to be on the safe side before he changes a client-only config into a config
+ // with a local running cupsd (e.g. before he set up the first local queue:
+ // Also the basic buttons "Help", "Cancel", "OK" are enabled.
+ UI::ChangeWidget( `allow_remote_access_radio_button, `Enabled, false );
+ UI::ChangeWidget( `allow_local_network_access_check_box, `Enabled, false );
+ UI::ChangeWidget( `publish_to_local_network_check_box, `Enabled, false );
+ UI::ChangeWidget( `interface_table_label, `Enabled, false );
+ UI::ChangeWidget( `interface_table, `Enabled, false );
+ UI::ChangeWidget( `add_interface, `Enabled, false );
+ UI::ChangeWidget( `edit_interface, `Enabled, false );
+ UI::ChangeWidget( `delete_interface, `Enabled, false );
+ UI::ChangeWidget( `ip_table_label, `Enabled, false );
+ UI::ChangeWidget( `ip_table, `Enabled, false );
+ UI::ChangeWidget( `add_ip, `Enabled, false );
+ UI::ChangeWidget( `edit_ip, `Enabled, false );
+ UI::ChangeWidget( `delete_ip, `Enabled, false );
+ }
+ // Regardless whether or not the "Share Printers" dialog is useless,
+ // fill in the values of the current settings in the system:
+ interface_table_items = [];
+ ip_table_items = [];
+ // Determine the 'Listen' values in /etc/cups/cupsd.conf:
+ // By default there is 'Listen localhost:631' and 'Listen /var/run/cups/cups.sock'.
+ // 'Listen localhost' is mandatory (i.e. it is a broken config when it is missing).
+ // '/var/run/cups/cups.sock' is only an optional default (i.e. not really of interest).
+ // Therefore "modify_cupsd_conf Listen" reports 'localhost' but ignores '/var/run/cups/cups.sock'
+ // so that ["localhost"] is the right fallback value here:
+ list< string > listen_values = [ "" ];
+ if( Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir + "modify_cupsd_conf Listen" ) )
+ { // The command outputs a line where multiple Listen values are separated by space
+ // but possible duplicate Listen values are not removed in the command output:
+ listen_values = toset( splitstring( Printerlib::result["stdout"]:"", " " ) );
+ }
+ else
+ { // Use fallback value when the command above failed:
+ listen_values = [ "localhost" ];
+ }
+ y2milestone( "Initial listen_values: %1", listen_values );
+ // Determine if it listens at least to "localhost" and/or only to "localhost":
+ boolean listen_local = false;
+ boolean listen_remote = false;
+ foreach( string listen_value,
+ listen_values,
+ { if( "" != listen_value )
+ { if( "localhost" == listen_value )
+ { listen_local = true;
+ }
+ else
+ { listen_remote = true;
+ }
+ }
+ }
+ );
+ if( ! listen_local )
+ { // 'Listen localhost' is mandatory (i.e. it is a broken config when it is missing).
+ // Try to do a simple fix for the broken config but ignore possible failures.
+ // Set only 'Listen localhost:631' in /etc/cups/cupsd.conf which means
+ // that all possibly existing non-'localhost' Listen entries are removed.
+ // but this should be no big problem because appropriate Listen values
+ // (depending on the settings in this dialog) would be added when this dialog finishes.
+ // Only while this dialog is open, the non-'localhost' Listen entries are removed
+ // which means that there is no remote access while this dialog is open
+ // which is no big issue for a broken config without any local access ;-)
+ Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir + "modify_cupsd_conf Listen localhost" );
+ Printerlib::GetAndSetCupsdStatus( "restart" );
+ }
+ // Determine the 'Allow' values for the root location '<Location />' in /etc/cups/cupsd.conf:
+ // By default there is only 'Allow 127.0.0.2' but this value is suppressed in the output
+ // of 'modify_cupsd_conf Allow' so that the empty sting is the right fallback value here:
+ list< string > allow_values = [ "" ];
+ if( Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir + "modify_cupsd_conf Allow" ) )
+ { // The command outputs a line where multiple Allow values are separated by space
+ // but possible duplicate Allow values are not removed in the command output:
+ allow_values = toset( splitstring( Printerlib::result["stdout"]:"", " " ) );
+ }
+ else
+ { // Use fallback value when the command above failed:
+ allow_values = [ "" ];
+ }
+ y2milestone( "Initial allow_values: %1", allow_values );
+ // Determine the 'BrowseAddress' values in /etc/cups/cupsd.conf:
+ // By default there is no BrowseAddress value so that the empty sting is the right fallback:
+ list< string > browse_address_values = [ "" ];
+ if( Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir + "modify_cupsd_conf BrowseAddress" ) )
+ { // The command outputs a line where multiple BrowseAddress values are separated by space
+ // but possible duplicate BrowseAddress values are not removed in the command output:
+ browse_address_values = toset( splitstring( Printerlib::result["stdout"]:"", " " ) );
+ }
+ else
+ { // Use fallback value when the command above failed:
+ browse_address_values = [ "" ];
+ }
+ y2milestone( "Initial browse_address_values: %1", browse_address_values );
+ // Reset the different values for the different widgets in the dialog to defaults:
+ initial_deny_remote_access = true;
+ UI::ChangeWidget( `deny_remote_access_radio_button, `Value, true );
+ initial_allow_remote_access = false;
+ UI::ChangeWidget( `allow_remote_access_radio_button, `Value, false );
+ initial_allow_local_network_access = false;
+ UI::ChangeWidget( `allow_local_network_access_check_box, `Value, false );
+ initial_publish_to_local_network = false;
+ UI::ChangeWidget( `publish_to_local_network_check_box, `Value, false );
+ initial_interface_table_items = [];
+ // Split the allow_values list together with the browse_address_values list
+ // into the different values for the different widgets in the dialog.
+ // By default no remote access is allowed (see the defaults in widgetSharing)
+ // but if there is at least one none-empty allow_value, remote access should be allowed
+ // except when there is no remote Listen entry:
+ foreach( string allow_value,
+ allow_values,
+ { if( "" != allow_value && listen_remote )
+ { UI::ChangeWidget( `deny_remote_access_radio_button, `Value, false );
+ initial_deny_remote_access = false;
+ UI::ChangeWidget( `allow_remote_access_radio_button, `Value, true );
+ initial_allow_remote_access = true;
+ }
+ if( "@LOCAL" == allow_value )
+ { UI::ChangeWidget( `allow_local_network_access_check_box, `Value, true );
+ initial_allow_local_network_access = true;
+ // Check if this value appears also in the browse_address_values:
+ if( contains( browse_address_values, allow_value ) )
+ { UI::ChangeWidget( `publish_to_local_network_check_box, `Value, true );
+ initial_publish_to_local_network = true;
+ }
+ }
+ if( issubstring( allow_value, "@IF" ) )
+ { // The allow_value has the form '@IF(interface-name)' e.g. '@IF(eth1)'.
+ // Check if this value appears also in the browse_address_values:
+ string publish_via_this_interface = "no";
+ if( contains( browse_address_values, allow_value ) )
+ { publish_via_this_interface = "yes";
+ }
+ // Extract only the interface-name from the allow_value:
+ integer start = findfirstof( allow_value, "(" );
+ integer end = findfirstof( allow_value, ")" );
+ if( ( nil != start ) && ( nil != end ) && ( end - start - 1 > 0 ) )
+ { string interface_name = substring( allow_value, start + 1, end - start - 1 );
+ interface_table_items = add( interface_table_items, `item( `id( size( interface_table_items ) ),
+ interface_name,
+ publish_via_this_interface
+ )
+ );
+ }
+ }
+ }
+ );
+ y2milestone( "Initial interface_table_items: %1", interface_table_items );
+ UI::ChangeWidget( `interface_table, `Items, interface_table_items );
+ initial_interface_table_items = interface_table_items;
+ UI::ChangeWidget( `interface_table, `CurrentItem, -1 );
+ // Determine the currently available IPv4 (-family inet) network interfaces in the system.
+ // Omit loopback interfaces.
+ available_interfaces = [];
+ if( Printerlib::ExecuteBashCommand( "ip -family inet -oneline link show | grep -v -i loopback | cut -s -d ':' -f 2 | tr -s '[:space:]' ' '" ) )
+ { // The command outputs a line where multiple network interfaces are separated by space.
+ // Remove empty or effectively empty entries (otherwise it would be something like ["", "eth0", "eth1"]):
+ available_interfaces = filter( string interface_name,
+ toset( splitstring( Printerlib::result["stdout"]:"", " " ) ),
+ { return( "" != filterchars( interface_name, Printer::alnum_chars ) );
+ }
+ );
+ }
+ else
+ { // Use fallback value when the command above failed:
+ available_interfaces = [];
+ }
+ y2milestone( "available_interfaces: %1", available_interfaces );
+
+ // Have the IP table disabled until its functionality is implemented:
+ UI::ChangeWidget( `ip_table_label, `Enabled, false );
+ UI::ChangeWidget( `ip_table, `Enabled, false );
+ UI::ChangeWidget( `add_ip, `Enabled, false );
+ UI::ChangeWidget( `edit_ip, `Enabled, false );
+ UI::ChangeWidget( `delete_ip, `Enabled, false );
+
y2milestone( "leaving initSharing" );
}
-symbol handleSharing(string key, map event)
-{ if (event["EventReason"]:""=="Activated"){
- y2milestone("button pressed %1", event);
- switch(event["WidgetID"]:`nil){
- integer current=-1;
- map ret = nil;
- case `add_interface :
- ret = showInterfacePopup("", false);
- if (ret!=nil){
- list items = (list)UI::QueryWidget(`interface_table, `Items);
- items=add(items, `item(`id(size(items)), ret["device"]:"", ret["publish"]:""));
- UI::ChangeWidget(`interface_table, `Items, items);
- UI::ChangeWidget(`interface_table, `CurrentItem, current);
+symbol handleSharing( string key, map event )
+{ y2milestone( "entering handleSharing with key '%1'\nand event '%2'", key, event );
+ if( "ValueChanged" == event["EventReason"]:"" )
+ { switch( event["WidgetID"]:`nil )
+ { case `allow_local_network_access_check_box :
+ if( ! (boolean)UI::QueryWidget( `allow_local_network_access_check_box, `Value ) )
+ { // Set the publish_to_local_network_check_box to false
+ // if the allow_local_network_access_check_box is set to false
+ // because it makes no sense to publish to the local network
+ // but not to allow access from the local network:
+ UI::ChangeWidget( `publish_to_local_network_check_box, `Value, false );
+ }
+ break;
+ case `publish_to_local_network_check_box :
+ if( (boolean)UI::QueryWidget( `publish_to_local_network_check_box, `Value ) )
+ { // Set the allow_local_network_access_check_box to true
+ // if the publish_to_local_network_check_box is set to true
+ // because it makes no sense to publish to the local network
+ // but not to allow access from the local network:
+ UI::ChangeWidget( `allow_local_network_access_check_box, `Value, true );
+ }
+ break;
+ }
+ }
+ if( "Activated" == event["EventReason"]:"" )
+ { switch( event["WidgetID"]:`nil )
+ { integer current_item = -1;
+ map ret = nil;
+ map< string, string > interface_map = nil;
+ case `add_interface :
+ interface_map = showInterfacePopup( "", false );
+ if( interface_map != nil )
+ { interface_table_items = (list<term>)UI::QueryWidget( `interface_table, `Items );
+ interface_table_items = add( interface_table_items,
+ `item( `id(size(interface_table_items)),
+ interface_map["interface_name"]:"",
+ interface_map["is_published"]:""
+ )
+ );
+ UI::ChangeWidget( `interface_table, `Items, interface_table_items );
+ UI::ChangeWidget( `interface_table, `CurrentItem, size(interface_table_items) - 1 );
+ }
+ break;
+ case `edit_interface :
+ current_item = (integer)UI::QueryWidget( `interface_table, `CurrentItem );
+ term interface_item = (term)UI::QueryWidget( `interface_table, `Item( current_item ) );
+ interface_map = showInterfacePopup( (string)interface_item[1]:"",
+ (interface_item[2]:"no"=="yes")
+ );
+ if( interface_map != nil)
+ { interface_table_items = [];
+ foreach( term interface_table_item,
+ (list<term>)UI::QueryWidget( `interface_table, `Items),
+ { if( current_item != interface_table_item[0,0]:-1 )
+ { interface_table_items = add( interface_table_items,
+ `item( `id(size(interface_table_items)),
+ interface_table_item[1]:"",
+ interface_table_item[2]:""
+ )
+ );
}
- break;
- case `edit_interface :
- current = (integer)UI::QueryWidget(`interface_table, `CurrentItem);
- term this = (term)UI::QueryWidget(`interface_table, `Item(current));
- ret = showInterfacePopup((string)this[1]:"", (this[2]:"no"=="yes"));
- if (ret!=nil){
- list items = [];
- foreach(term oneItem, (list<term>)UI::QueryWidget(`interface_table, `Items), {
- if (current != oneItem[0, 0]:-1){
- items = add(items, `item(`id(size(items)), oneItem[1]:"", oneItem[2]:""));
- } else {
- y2milestone("Changing item %1", oneItem);
- items = add(items, `item(`id(size(items)), ret["device"]:"", ret["publish"]:""));
- }
- });
- UI::ChangeWidget(`interface_table, `Items, items);
- UI::ChangeWidget(`interface_table, `CurrentItem, current);
+ else
+ { y2milestone( "Changing interface_table_item %1", interface_table_item );
+ interface_table_items = add( interface_table_items,
+ `item( `id(size(interface_table_items)),
+ interface_map["interface_name"]:"",
+ interface_map["is_published"]:""
+ )
+ );
}
- break;
- case `delete_interface :
- current = (integer)UI::QueryWidget(`interface_table, `CurrentItem);
- if (current!=nil && current>-1){
- list items = [];
- foreach(term oneItem, (list<term>)UI::QueryWidget(`interface_table, `Items), {
- if (current != oneItem[0, 0]:-1){
- items = add(items, `item(`id(size(items)), oneItem[1]:"", oneItem[2]:""));
- } else y2milestone("Deleting item %1", oneItem);
-
- });
- UI::ChangeWidget(`interface_table, `Items, items);
- } else y2error("Unproper index for current item: %1", current);
- break;
+ }
+ );
+ UI::ChangeWidget( `interface_table, `Items, interface_table_items );
+ UI::ChangeWidget( `interface_table, `CurrentItem, current_item );
+ }
+ break;
+ case `delete_interface :
+ current_item = (integer)UI::QueryWidget( `interface_table, `CurrentItem );
+ if( current_item != nil && current_item > -1 )
+ { interface_table_items = [];
+ foreach( term interface_table_item,
+ (list<term>)UI::QueryWidget(`interface_table, `Items),
+ { if( current_item != interface_table_item[0,0]:-1 )
+ { interface_table_items = add( interface_table_items,
+ `item( `id(size(interface_table_items)),
+ interface_table_item[1]:"",
+ interface_table_item[2]:""
+ )
+ );
+ }
+ else
+ { y2milestone("Deleting interface_table_item %1", interface_table_item );
+ }
+ }
+ );
+ UI::ChangeWidget( `interface_table, `Items, interface_table_items);
+ }
+ else
+ { y2error("Unproper index for current interface table item: %1", current_item);
+ }
+ break;
case `add_ip :
ret = showIPPopup("", false);
if (ret!=nil){
list items = (list)UI::QueryWidget(`ip_table, `Items);
items=add(items, `item(`id(size(items)), ret["device"]:"", ret["publish"]:""));
UI::ChangeWidget(`ip_table, `Items, items);
- UI::ChangeWidget(`ip_table, `CurrentItem, current);
+ UI::ChangeWidget(`ip_table, `CurrentItem, current_item);
}
break;
case `edit_ip :
- current = (integer)UI::QueryWidget(`ip_table, `CurrentItem);
- term this2 = (term)UI::QueryWidget(`ip_table, `Item(current));
+ current_item = (integer)UI::QueryWidget(`ip_table, `CurrentItem);
+ term this2 = (term)UI::QueryWidget(`ip_table, `Item(current_item));
ret = showIPPopup((string)this2[1]:"", (this2[2]:"no"=="yes"));
if (ret!=nil){
list items = [];
foreach(term oneItem, (list<term>)UI::QueryWidget(`ip_table, `Items), {
- if (current != oneItem[0, 0]:-1){
+ if (current_item != oneItem[0, 0]:-1){
items = add(items, `item(`id(size(items)), oneItem[1]:"", oneItem[2]:""));
} else {
y2milestone("Changing item %1", oneItem);
@@ -332,50 +828,78 @@
}
});
UI::ChangeWidget(`ip_table, `Items, items);
- UI::ChangeWidget(`ip_table, `CurrentItem, current);
+ UI::ChangeWidget(`ip_table, `CurrentItem, current_item);
}
break;
case `delete_ip :
- current = (integer)UI::QueryWidget(`ip_table, `CurrentItem);
- if (current!=nil && current>-1){
+ current_item = (integer)UI::QueryWidget(`ip_table, `CurrentItem);
+ if (current_item!=nil && current_item>-1){
list items = [];
foreach(term oneItem, (list<term>)UI::QueryWidget(`ip_table, `Items), {
- if (current != oneItem[0, 0]:-1){
+ if (current_item != oneItem[0, 0]:-1){
items = add(items, `item(`id(size(items)), oneItem[1]:"", oneItem[2]:""));
} else y2milestone("Deleting item %1", oneItem);
});
UI::ChangeWidget(`ip_table, `Items, items);
- } else y2error("Unproper index for current item: %1", current);
+ } else y2error("Unproper index for current item: %1", current_item);
break;
+ }
}
- }
- boolean share = (UI::QueryWidget(`deny_or_allow_remote_access, `CurrentButton)==`allow_remote_access_radio_button);
- UI::ChangeWidget(`allow_local_network_access_check_box, `Enabled, share);
- UI::ChangeWidget(`publish_to_local_network_check_box, `Enabled, share);
- UI::ChangeWidget(`interface_table, `Enabled, share);
- UI::ChangeWidget(`add_interface, `Enabled, share);
- UI::ChangeWidget(`edit_interface, `Enabled, share);
- UI::ChangeWidget(`delete_interface, `Enabled, share);
- UI::ChangeWidget(`ip_table, `Enabled, share);
- UI::ChangeWidget(`add_ip, `Enabled, share);
- UI::ChangeWidget(`edit_ip, `Enabled, share);
- UI::ChangeWidget(`delete_ip, `Enabled, share);
- if (share){
- boolean interface_buttons=true;
- boolean ip_buttons=true;
- if (size((list)UI::QueryWidget(`interface_table, `Items))==0) interface_buttons=false;
- UI::ChangeWidget(`edit_interface, `Enabled, interface_buttons);
- UI::ChangeWidget(`delete_interface, `Enabled, interface_buttons);
- if (size((list)UI::QueryWidget(`ip_table, `Items))==0) ip_buttons=false;
- UI::ChangeWidget(`edit_ip, `Enabled, ip_buttons);
- UI::ChangeWidget(`delete_ip, `Enabled, ip_buttons);
- }
- return nil;
+ if( ! share_printers_dialog_is_useless )
+ { // This does not work in any case:
+ // boolean remote_access=(`allow_remote_access_radio_button==UI::QueryWidget(`deny_or_allow_remote_access,`CurrentButton));
+ // Reason: At least with openSUSE 11.0 and Qt
+ // it is possible to un-check all buttons in a RadioButtonGroup
+ // by clicking on the currently checked button which un-checks it
+ // so that there might be no CurrentButton which leads to unexpected results.
+ // Therefore the actual button is tested directly to be on the safe side.
+ // But even this does not work really well.
+ // The reason is that un-checking the currently checked button
+ // does not trigger any event even not with "`opt(`notify, `immediate)"
+ // so that this special action is unnoticed.
+ boolean remote_access = (boolean)UI::QueryWidget( `allow_remote_access_radio_button, `Value );
+ UI::ChangeWidget(`allow_local_network_access_check_box, `Enabled, remote_access);
+ UI::ChangeWidget(`publish_to_local_network_check_box, `Enabled, remote_access);
+ UI::ChangeWidget(`interface_table_label, `Enabled, remote_access);
+ UI::ChangeWidget(`interface_table, `Enabled, remote_access);
+ UI::ChangeWidget(`add_interface, `Enabled, remote_access);
+ UI::ChangeWidget(`edit_interface, `Enabled, remote_access);
+ UI::ChangeWidget(`delete_interface, `Enabled, remote_access);
+ UI::ChangeWidget(`ip_table_label, `Enabled, remote_access);
+ UI::ChangeWidget(`ip_table, `Enabled, remote_access);
+ UI::ChangeWidget(`add_ip, `Enabled, remote_access);
+ UI::ChangeWidget(`edit_ip, `Enabled, remote_access);
+ UI::ChangeWidget(`delete_ip, `Enabled, remote_access);
+ if( remote_access )
+ { boolean interface_modify_buttons = true;
+ if( 0 == size((list)UI::QueryWidget(`interface_table, `Items)) ) interface_modify_buttons = false;
+ UI::ChangeWidget(`edit_interface, `Enabled, interface_modify_buttons);
+ UI::ChangeWidget(`delete_interface, `Enabled, interface_modify_buttons);
+ boolean ip_modify_buttons = true;
+ if( 0 == size((list)UI::QueryWidget(`ip_table, `Items)) ) ip_modify_buttons = false;
+ UI::ChangeWidget(`edit_ip, `Enabled, ip_modify_buttons);
+ UI::ChangeWidget(`delete_ip, `Enabled, ip_modify_buttons);
+ }
+ }
+
+ // Have the IP table disabled until its functionality is implemented:
+ UI::ChangeWidget( `ip_table_label, `Enabled, false );
+ UI::ChangeWidget( `ip_table, `Enabled, false );
+ UI::ChangeWidget( `add_ip, `Enabled, false );
+ UI::ChangeWidget( `edit_ip, `Enabled, false );
+ UI::ChangeWidget( `delete_ip, `Enabled, false );
+
+ return nil;
}
void storeSharing( string key, map event )
{ y2milestone( "entering storeSharing with key '%1'\nand event '%2'", key, event );
+ if( ! ApplySharingSettings() )
+ { Popup::Error( // Popup::Error message:
+ _("Failed to apply the settings to the system.")
+ );
+ }
if( ! sharing_has_changed )
{ y2milestone( "Nothing changed in 'Share Printers' dialog." );
Popup::ShowFeedback( // No title for such a simple feedback message:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-printer-2.17.15/tools/create_printer_ppd_database new/yast2-printer-2.17.16/tools/create_printer_ppd_database
--- old/yast2-printer-2.17.15/tools/create_printer_ppd_database 2008-09-16 16:24:35.000000000 +0200
+++ new/yast2-printer-2.17.16/tools/create_printer_ppd_database 2008-09-24 17:20:29.000000000 +0200
@@ -42,7 +42,7 @@
# Exit after timeout because then no empty YCP map is output
# so that either an existing YCP map could be used or YaST could also exit
# because without a PPD database printer setup makes not much sense.
-MAXIMUM_WAIT="30"
+MAXIMUM_WAIT="60"
$LPINFO -h localhost -l -m >$TMP_DATA_RAW &
lpinfoPID=$!
for i in $( seq $MAXIMUM_WAIT )
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-printer-2.17.15/tools/modify_cupsd_conf new/yast2-printer-2.17.16/tools/modify_cupsd_conf
--- old/yast2-printer-2.17.15/tools/modify_cupsd_conf 2008-09-16 16:24:35.000000000 +0200
+++ new/yast2-printer-2.17.16/tools/modify_cupsd_conf 2008-09-25 14:00:28.000000000 +0200
@@ -232,7 +232,9 @@
# are found if there is more than one which is allowed.
# Remove leading spaces (to cut the right part).
# Remove trailing spaces (needed for the test below).
- RESULT="$( grep -i "^[[:space:]]*$KEY[[:space:]]" $CUPSDCONF | sed -e 's/:631//' -e 's/\*/all/' | tr -s '[:blank:]' ' ' | sed -e 's/^ *//' | cut -s -d ' ' -f2 | tr -s '\n' ' ' | sed -e 's/ *$//' )"
+ # Remove '/var/run/cups/cups.sock' because it is only
+ # an optional default (i.e. not really of interest).
+ RESULT="$( grep -i "^[[:space:]]*$KEY[[:space:]]" $CUPSDCONF | sed -e 's/[^ ]*\/cups\.sock//' -e 's/:631//' -e 's/\*/all/' | tr -s '[:blank:]' ' ' | sed -e 's/^ *//' | cut -s -d ' ' -f2 | tr -s '\n' ' ' | sed -e 's/ *$//' )"
echo -n "$RESULT"
# For a nicer output on a terminal where stdout and stderr is mixed up,
# output a '\n' on stderr to get subsequent stuff (e.g. the shell prompt
@@ -240,9 +242,9 @@
echo 1>&2
# Test if the result is the expected one if a value was specified:
if test -n "$VALUE"
- then if test "localhost" = "$VALUE"
- then SPECIFIC_RESULT="$( echo "$RESULT" | sed -e 's/[^ ]*\/cups\.sock//' -e 's/ *$//' )"
- else SPECIFIC_RESULT="$( echo "$RESULT" | sed -e 's/localhost.*//' -e 's/ *$//' )"
+ then if ! test "localhost" = "$VALUE"
+ then SPECIFIC_RESULT="$( echo "$RESULT" | sed -e 's/localhost.*//' -e 's/ *$//' )"
+ else SPECIFIC_RESULT="$RESULT"
fi
if test "$SPECIFIC_RESULT" != "$VALUE"
then echo "Failed to set '$KEY $VALUE' in $CUPSDCONF." 1>&2
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-printer-2.17.15/VERSION new/yast2-printer-2.17.16/VERSION
--- old/yast2-printer-2.17.15/VERSION 2008-09-16 18:12:31.000000000 +0200
+++ new/yast2-printer-2.17.16/VERSION 2008-09-25 17:48:15.000000000 +0200
@@ -1 +1 @@
-2.17.15
+2.17.16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org