Hello community,
here is the log from the commit of package yast2-printer for openSUSE:Factory
checked in at Tue Mar 23 22:37:22 CET 2010.
--------
--- yast2-printer/yast2-printer.changes 2010-03-03 14:46:53.000000000 +0100
+++ /mounts/work_src_done/STABLE/yast2-printer/yast2-printer.changes 2010-03-18 16:36:04.000000000 +0100
@@ -1,0 +2,35 @@
+Thu Mar 18 16:17:41 CET 2010 - jsmeix@suse.de
+
+- Major cleanup of the AutoYaST printer client printer_auto.ycp
+ (see Novell/Suse Bugzilla bnc#588679):
+ Now there is verbatim cupsd.conf and client.conf
+ as XML CDATA in the AutoYaST control file.
+ This results a new AutoYaST control file structure:
+ <printer>
+
+ <![CDATA[
+ ... verbatim content of /etc/cups/client.conf ...
+ ]]>
+
+
+ <![CDATA[
+ ... verbatim content of /etc/cups/cupsd.conf ...
+ ]]>
+
+ </printer>
+ Provide a new src/printer.rnc to match the
+ new AutoYaST control file structure.
+- In src/printer.desktop added the line
+ X-SuSE-YaST-AutoInstSchema=printer.rnc
+ to pull in printer.rnc when yast2-schema is build
+ (see Novell/Suse Bugzilla bnc#588998).
+- In printer_proposal.ycp use Printer::DeriveModelName
+ and Printer::DeriveDriverFilterString the same way
+ as in basicadd.ycp so that the proposal results now
+ the same queue setup as if the user would have just
+ clicked [OK] in the BasicAddDialog.
+- Prefer "manufacturer-PPD" over "recommended" PPD
+ (see Novell/Suse Bugzilla bnc#589371).
+- 2.19.6
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
yast2-printer-2.19.5.tar.bz2
New:
----
yast2-printer-2.19.6.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-printer.spec ++++++
--- /var/tmp/diff_new_pack.jerYfA/_old 2010-03-23 22:36:02.000000000 +0100
+++ /var/tmp/diff_new_pack.jerYfA/_new 2010-03-23 22:36:02.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-printer (Version 2.19.5)
+# spec file for package yast2-printer (Version 2.19.6)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,12 +19,12 @@
Name: yast2-printer
-Version: 2.19.5
+Version: 2.19.6
Release: 1
License: GPL
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-printer-2.19.5.tar.bz2
+Source0: yast2-printer-2.19.6.tar.bz2
Prefix: /usr
@@ -35,12 +35,6 @@
Requires: /bin/mktemp /bin/ping /usr/bin/sed
Requires: yast2 >= 2.16.12
-Provides: yast2-config-cups yast2-agent-cups yast2-lib-printer yast2-config-printer y2c_cups y2c_prnt y2l_printer y2a_cups yast2-trans-printer yast2-trans-libprinter yast2-trans-cups yast2-cups-devel
-Obsoletes: yast2-config-cups yast2-agent-cups yast2-lib-printer yast2-config-printer y2c_cups y2c_prnt y2l_printer y2a_cups yast2-trans-printer yast2-trans-libprinter yast2-trans-cups yast2-cups-devel
-
-Provides: yast2-agent-cups-devel y2d_prnt y2t_prnt
-Obsoletes: yast2-agent-cups-devel y2d_prnt y2t_prnt
-
# Used to exclude libX11, libXau, libxcb, and libxcb-xlib from the requires list
# which are pulled in by Autoreqprov because of the basicadd_displaytest tool:
%define my_requires /tmp/my-requires
@@ -60,7 +54,7 @@
Developer documentation for yast2-printer.
%prep
-%setup -n yast2-printer-2.19.5
+%setup -n yast2-printer-2.19.6
%build
%{prefix}/bin/y2tool y2autoconf
@@ -72,7 +66,9 @@
%{?suse_update_config:%{suse_update_config -f}}
./configure --libdir=%{_libdir} --prefix=%{prefix} --mandir=%{_mandir}
-make %{?jobs:-j%jobs}
+# V=1: verbose build in case we used AM_SILENT_RULES(yes)
+# so that RPM_OPT_FLAGS check works
+make %{?jobs:-j%jobs} V=1
%install
make install DESTDIR="$RPM_BUILD_ROOT"
@@ -103,8 +99,6 @@
/usr/share/YaST2/clients/printer*
/usr/share/YaST2/include/printer/*
/usr/share/YaST2/schema/autoyast/rnc/printer.rnc
-/usr/share/YaST2/scrconf/*
-/usr/lib/YaST2/servers_non_y2/*
/usr/share/YaST2/data/testprint.ps
%{prefix}/lib/YaST2/bin/autodetect_print_queues
%{prefix}/lib/YaST2/bin/autodetect_printers
++++++ yast2-printer-2.19.5.tar.bz2 -> yast2-printer-2.19.6.tar.bz2 ++++++
++++ 6004 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.19.5/Makefile.am new/yast2-printer-2.19.6/Makefile.am
--- old/yast2-printer-2.19.5/Makefile.am 2010-03-03 12:34:57.000000000 +0100
+++ new/yast2-printer-2.19.6/Makefile.am 2010-03-20 09:26:41.000000000 +0100
@@ -32,10 +32,10 @@
# less strict; prefer bzip2
AUTOMAKE_OPTIONS = foreign dist-bzip2 no-dist-gzip
-# where devtools instal m4 snippets
+# where devtools install m4 snippets
# argh, executed literally
#ACLOCAL_AMFLAGS = -I $(Y2DEVTOOLS_PREFIX)/share/aclocal
-ACLOCAL_AMFLAGS = -I `if test -d ./devtools/admin; then echo ./devtools/admin; else pkg-config --print-errors --variable=datadir yast2-devtools; fi`/aclocal
+ACLOCAL_AMFLAGS = -I . -I `if test -d ./devtools/admin; then echo ./devtools/admin; else pkg-config --print-errors --variable=datadir yast2-devtools; fi`/aclocal
Makefile.am.common: $(DEVTOOLS_DIR)/admin/Makefile.am.common
cmp -s $< $@ || cp -f $< $@
@@ -214,4 +214,4 @@
test ! -f $(srcdir)/po/Makefile || $(MAKE) -C po checkpo
# test ! -f $(srcdir)/po/Makefile || $(MAKE) -C po checkpo make-pox
# No ./SUBDIRS file found - assuming default: All direct subdirs with Makefile.am
-SUBDIRS = agents data doc src testsuite tools
+SUBDIRS = data doc src testsuite tools
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.19.5/VERSION new/yast2-printer-2.19.6/VERSION
--- old/yast2-printer-2.19.5/VERSION 2010-03-03 12:15:26.000000000 +0100
+++ new/yast2-printer-2.19.6/VERSION 2010-03-11 18:00:36.000000000 +0100
@@ -1 +1 @@
-2.19.5
+2.19.6
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.19.5/agents/Makefile.am new/yast2-printer-2.19.6/agents/Makefile.am
--- old/yast2-printer-2.19.5/agents/Makefile.am 2009-10-29 12:29:33.000000000 +0100
+++ new/yast2-printer-2.19.6/agents/Makefile.am 1970-01-01 01:00:00.000000000 +0100
@@ -1,5 +0,0 @@
-agent_SCRIPTS = ag_cups
-
-scrconf_DATA = cfg_cups.scr
-
-EXTRA_DIST = $(agent_SCRIPTS) $(scrconf_DATA)
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.19.5/agents/ag_cups new/yast2-printer-2.19.6/agents/ag_cups
--- old/yast2-printer-2.19.5/agents/ag_cups 2009-10-29 12:29:33.000000000 +0100
+++ new/yast2-printer-2.19.6/agents/ag_cups 1970-01-01 01:00:00.000000000 +0100
@@ -1,210 +0,0 @@
-#!/usr/bin/perl -w
-package ag_cups_server;
-BEGIN { push( @INC, '/usr/share/YaST2/modules/' ); }
-use ycp;
-use YaST::SCRAgent;
-use YaPI;
-textdomain "printer";
-our @ISA = ("YaST::SCRAgent");
-use strict;
-
- use Data::Dumper;
-
-
-
-sub createOrInsert {
- my ($line, $data_ref) = @_;
- if ( $line=~/\s*(\w*)\s+([\w\W]*)/){
- # add to existing list
- if (exists $$data_ref{$1}){
- push(@{$$data_ref{$1}}, $2);
- # new item
- } else{
- $$data_ref{$1}=[$2];
- }
- }
-}
-
-sub createOrInsertSection {
- my ($line, $section, $data_ref) = @_;
- foreach (@$data_ref){
- if($$section eq "$_->{'Key'} $_->{'Value'}"){
- createOrInsert($line, $_);
- }
- }
-}
-
-sub parseSection{
- my ($sec_r, $line, $data_r) = @_;
- #new section
- if ($line =~ /<([\w]*)\s*([\w\W]*)>/){
- push(@$sec_r, "$1 $2");
-
- if(scalar @$sec_r==2){
- my $pos=0;
- foreach (@{$$data_r{'sections'}}){
- if(@$sec_r[0] eq "$_->{'Key'} $_->{'Value'}"){
- @{$$data_r{'sections'}[$pos]{'sections'}}=() if (!exists $$data_r{'sections'}[$pos]{'sections'});
- $data_r=$$data_r{'sections'}[$pos];
- }
- $pos++;
- }
- }
-
- $$data_r{'sections'}=[] if(!exists $$data_r{'sections'});
- push(@{$$data_r{'sections'}}, {'Key'=>$1, 'Value'=>$2});
-
- } else{
- # global section only
- if (scalar @$sec_r==0 or @$sec_r[0] eq ""){
- createOrInsert($line, \%$data_r);
- #inside sections
- }else{
- my $ref = \@{$$data_r{'sections'}};
- # in case of sub-section ...
- if(scalar @$sec_r==2){
- my $pos=0;
- foreach (@{$$data_r{'sections'}}){
- if(@$sec_r[0] eq "$_->{'Key'} $_->{'Value'}"){
- $ref=\@{$$data_r{'sections'}[$pos]{'sections'}};
- }
- $pos++;
- }
- }
- createOrInsertSection($line, \@$sec_r[scalar @$sec_r-1], $ref);
- }
- }
-}
-
-sub parse_conf {
-# my $class = shift;
- my $file = shift;
-
- my %data=();
- my @section=();
- if( open( FILE, $file ) ) {
- while( my $line = <FILE> ) {
- chomp($line);
- # remove comments
- next if ( $line =~ /^\s*#/ || $line =~ /^\s*$/);
-
- # end of the section
- if($line=~/<\/([\w\W]*)>/){
- pop(@section);
- } else{
- parseSection(\@section, $line, \%data);
- }
- }
- close(FILE);
- }
- return \%data;
-}
-
-sub Execute {
- my $class = shift;
- my ($path, @args) = @_;
-
- return 1;
-}
-
-sub write_params {
- my ($key, $options) = @_;
-
- my @output=();
- foreach my $params (@$options){
- push (@output, "$key $params");
- }
- return @output;
-}
-
-sub write_conf {
- my ($file, $data) = @_;
- my @output = ();
-
-foreach my $key(keys %$data){
- foreach my $options ($$data{$key}){
- if ($key eq "sections"){
- foreach my $item (@$options){
-
- my $section=$$item{'Key'};
- push(@output, "<$section $$item{'Value'}>");
- delete $$item{'Key'};
- delete $$item{'Value'};
- foreach my $key2 (keys %$item){
- if ($key2 eq "sections"){
-
- foreach my $subitem (@{$$item{'sections'}}){
- my $subsection=$$subitem{'Key'};
- push(@output, "<$subsection $$subitem{'Value'}>");
- delete $$subitem{'Key'};
- delete $$subitem{'Value'};
- foreach my $key2 (keys %$subitem){
- @output=(@output, write_params($key2, $$subitem{$key2}));
- }
- push(@output, "$subsection>");
- }
-
- } else{
- @output=(@output, write_params($key2, $$item{$key2}));
- }
- }
- push(@output, "$section>");
- }
- }else{
- @output=(@output, write_params($key, $options));
- }
- }
-}
-
- open( OUT, $file );
- foreach my $line (@output){
- print OUT "$line\n";
- }
- close(OUT);
-
- return 1;
-}
-
-sub Read {
- my $class = shift;
- my ($path, @args) = @_;
- my $server = "< /etc/cups/cupsd.conf";
- my $client = "< /etc/cups/client.conf";
-
- if ($path eq ".server"){
- return parse_conf($server);
- }
- elsif ($path eq ".client"){
- return parse_conf($client);
- }
- elsif ($path eq "."){
- return [('server'=> parse_conf($server), 'client'=>parse_conf($client))];
- }else{
- #not implemented
- }
-}
-
-sub Write {
- my $class = shift;
- my ($path, @args) = @_;
- my $server = "> /etc/cups/cupsd.conf";
- my $client = "> /etc/cups/client.conf";
-
- if ($path eq ".client"){
- return write_conf($client, $args[0]);
- }
- elsif ($path eq ".server"){
- return write_conf($server, $args[0]);
- }
- else{
- #not implemented
- }
-}
-
-sub Dir {
-}
-
-package main;
-
-ag_cups_server->Run ();
-
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.19.5/agents/cfg_cups.scr new/yast2-printer-2.19.6/agents/cfg_cups.scr
--- old/yast2-printer-2.19.5/agents/cfg_cups.scr 2009-10-29 12:29:33.000000000 +0100
+++ new/yast2-printer-2.19.6/agents/cfg_cups.scr 1970-01-01 01:00:00.000000000 +0100
@@ -1,19 +0,0 @@
-/**
- * File:
- * tty.scr
- * Summary:
- * SCR Agent for reading/writing CUPS configuration
- * Access:
- * read/write
- * Authors:
- * See:
- * anyagent
- * libscr
- * Example:
-
- * $Id: cfg_icups_server.scr 14516 2009-01-20 16:34:50Z mzugec $
- *
- */
-.cups
-
-`ag_cups ()
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.19.5/autodocs-ycp.ami new/yast2-printer-2.19.6/autodocs-ycp.ami
--- old/yast2-printer-2.19.5/autodocs-ycp.ami 2010-03-03 12:34:57.000000000 +0100
+++ new/yast2-printer-2.19.6/autodocs-ycp.ami 2010-03-20 09:26:41.000000000 +0100
@@ -1,5 +1,5 @@
# -*- makefile -*- Automake include file
-# $Id: autodocs-ycp.ami 33394 2006-10-13 11:51:40Z mvidner $
+# $Id: autodocs-ycp.ami 57644 2009-06-19 08:38:11Z mvidner $
# Builds source documentation for YCP sources
# Uses ycpdoc
@@ -8,20 +8,25 @@
# Optional - the default is $(srcdir)/../../src/*.ycp
# AUTODOCS_PM: Files that the perl autodocs is built from
# Optional - the default is $(srcdir)/../../src/*.pm
+# AUTODOCS_SUBDIR: To install the result to $(docdir)/SUBDIR/autodocs
+# Optional - the default is no subdir, $(docdir)/autodocs
+# AUTODOCS_STRIP: Strip it from filenames. The remaining / are replaced by __
+# Optional - the default is $(srcdir)/../../src
-htmldir = $(docdir)/autodocs
+htmldir = $(docdir)/$(AUTODOCS_SUBDIR)/autodocs
-html_DATA = index.html $(wildcard *.html)
+html_DATA = index.html $(filter-out index.html, $(wildcard *.html))
CLEANFILES = $(html_DATA) pod2htm*.tmp
AUTODOCS_YCP ?= $(wildcard $(srcdir)/../../src/*.ycp)
AUTODOCS_PM ?= $(wildcard $(srcdir)/../../src/*.pm)
+AUTODOCS_STRIP ?= $(srcdir)/../../src
index.html: $(AUTODOCS_YCP) $(AUTODOCS_PM)
#including *.pm, for the index
- ${YCPDOC} -d. $^
+ ${YCPDOC} -d. -s$(AUTODOCS_STRIP) $(AUTODOCS_YCP)
for i in $(AUTODOCS_PM); do \
- b=`basename $$i`; b=$${b%.pm}; \
+ b=$${i##$(AUTODOCS_STRIP)}; b=$${b#/}; b=$${b//\//__}; b=$${b%.pm}; \
pod2html --title=$$b --infile=$$i --outfile=$$b.html; \
- echo "<a href='$$b.html'>$$b</a>" > $$b.mod.html; \
+ echo "<a href='$$b.html'>$${b/__/::}</a>" > $$b.mod.html; \
done
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.19.5/configure.in new/yast2-printer-2.19.6/configure.in
--- old/yast2-printer-2.19.5/configure.in 2010-03-03 12:34:57.000000000 +0100
+++ new/yast2-printer-2.19.6/configure.in 2010-03-20 09:26:41.000000000 +0100
@@ -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.18.11 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-printer, 2.19.5, http://bugs.opensuse.org/, yast2-printer)
+AC_INIT(yast2-printer, 2.19.6, 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.5"
+VERSION="2.19.6"
RPMNAME="yast2-printer"
MAINTAINER="Michal Zugec "
@@ -157,8 +157,7 @@
])
-AC_CONFIG_FILES(Makefile agents/Makefile
-data/Makefile
+AC_CONFIG_FILES(Makefile data/Makefile
doc/autodocs/Makefile
doc/Makefile
src/Makefile
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.19.5/missing new/yast2-printer-2.19.6/missing
--- old/yast2-printer-2.19.5/missing 2010-03-03 12:35:03.000000000 +0100
+++ new/yast2-printer-2.19.6/missing 2010-03-20 09:26:46.000000000 +0100
@@ -1,10 +1,10 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
-scriptversion=2006-05-10.23
+scriptversion=2009-04-28.21; # UTC
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard , 1996.
# This program is free software; you can redistribute it and/or modify
@@ -18,9 +18,7 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program. If not, see http://www.gnu.org/licenses/.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -89,6 +87,9 @@
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
Send bug reports to ."
exit $?
;;
@@ -106,15 +107,22 @@
esac
+# normalize program name to check for.
+program=`echo "$1" | sed '
+ s/^gnu-//; t
+ s/^gnu//; t
+ s/^g//; t'`
+
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
-# the program).
+# the program). This is about non-GNU programs, so use $1 not
+# $program.
case $1 in
- lex|yacc)
+ lex*|yacc*)
# Not GNU programs, they don't have --version.
;;
- tar)
+ tar*)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
@@ -138,7 +146,7 @@
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
-case $1 in
+case $program in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
@@ -148,7 +156,7 @@
touch aclocal.m4
;;
- autoconf)
+ autoconf*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
@@ -157,7 +165,7 @@
touch configure
;;
- autoheader)
+ autoheader*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
@@ -187,7 +195,7 @@
while read f; do touch "$f"; done
;;
- autom4te)
+ autom4te*)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
@@ -210,7 +218,7 @@
fi
;;
- bison|yacc)
+ bison*|yacc*)
echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
@@ -240,7 +248,7 @@
fi
;;
- lex|flex)
+ lex*|flex*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
@@ -263,7 +271,7 @@
fi
;;
- help2man)
+ help2man*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
@@ -277,11 +285,11 @@
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
- exit 1
+ exit $?
fi
;;
- makeinfo)
+ makeinfo*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
@@ -310,7 +318,7 @@
touch $file
;;
- tar)
+ tar*)
shift
# We have already tried tar in the generic part.
@@ -363,5 +371,6 @@
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
# End:
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.19.5/src/Printer.ycp new/yast2-printer-2.19.6/src/Printer.ycp
--- old/yast2-printer-2.19.5/src/Printer.ycp 2010-03-03 12:15:27.000000000 +0100
+++ new/yast2-printer-2.19.6/src/Printer.ycp 2010-03-18 15:40:13.000000000 +0100
@@ -51,16 +51,6 @@
global boolean modified = false;
/**
- */
-global boolean proposal_valid = false;
-
-/**
- * Write only, used during autoinstallation.
- * Don't run services and SuSEconfig, it's all done at one place.
- */
-global boolean write_only = false;
-
-/**
* Abort function
* return boolean return true if abort
*/
@@ -90,6 +80,43 @@
// Settings:
// Define all variables needed for configuration of a printer:
+/*
+ * Global variables:
+ */
+
+/**
+ * Used by AutoYaST by calling in printer_auto.ycp the "Summary" function.
+ */
+global string printer_auto_summary =
+_("<p>
+AutoYaST settings for printing with CUPS via network.<br>
+There is no AutoYaST support for local print queues.
+</p>");
+
+/**
+ * Set to 'true' by AutoYaST by calling in printer_auto.ycp the "SetModified" function.
+ * Read by AutoYaST by calling in printer_auto.ycp the "GetModified" function.
+ * Preset to false which is the right default for AutoYast.
+ */
+global boolean printer_auto_modified = false;
+
+/**
+ * Filled in by AutoYaST by calling in printer_auto.ycp the "Import" function.
+ * Reset to the empty map by AutoYaST by calling in printer_auto.ycp the "Reset" function.
+ * Preset to the empty map which is the right default for AutoYast.
+ */
+global map autoyast_printer_settings = $[];
+
+/**
+ * Set to 'true' by AutoYaST by calling in printer_auto.ycp the "Change" function.
+ * Lets the Overview dialog disable the checkbox to show local queues
+ * which disables as a consequence in particular the [Delete] button.
+ * Lets the Printing via Network dialog disable the button to
+ * run the Connection Wizard (to set up a local queue for a network printer).
+ * Preset to false which is the right default for all dialogs.
+ */
+global boolean printer_auto_dialogs = false;
+
/**
* Explicite listing of all alphanumeric ASCII characters.
* The reason is that in certain special locales for example [a-z] is not equivalent
@@ -267,10 +294,10 @@
/**
* Queue filter string:
- * Can be either "all" or "local" or "remote" depending on
- * which kind of queues from the queues list (of queue maps)
- * the user wants to see in the overview dialog.
- * Preset to "all" which indicates that all queues are shown.
+ * Both boolean variables queue_filter_show_local and queue_filter_show_remote
+ * can be either 'true' or 'false' depending on which kind of queues
+ * from the queues list (of queue maps) the user wants to see in the overview dialog.
+ * Both are preset to 'true' which indicates that all queues are shown.
*/
global boolean queue_filter_show_local = true;
global boolean queue_filter_show_remote = true;
@@ -1754,12 +1781,12 @@
// This is a PPD which was downloaded by the user:
string downloaded = "\\[downloaded/";
integer downloaded_weight = 32;
- // This is a recommended PPD:
- string recommended = "\\(recommended\\)";
- integer recommended_weight = 16;
// This is an original PPD from a manufacturer:
string manufacturerPPD = "\\[manufacturer-PPDs/";
- integer manufacturerPPD_weight = 8;
+ integer manufacturerPPD_weight = 16;
+ // This is a recommended PPD:
+ string recommended = "\\(recommended\\)";
+ integer recommended_weight = 8;
// This is a PPD from the HPLIP project (HP Linux Imaging and Printing):
string hplip = "/hplip/";
integer hplip_weight = 4;
@@ -2249,47 +2276,6 @@
return true;
}
-/**
- * Get all printer settings from the first parameter
- * (For use by autoinstallation.)
- * @param settings The YCP structure to be imported.
- * @return boolean True on success
- */
-global boolean Import (map settings) {
- Printerlib::WriteClientSettings(settings["cups_remote_server"]:$[]);
- Printerlib::WriteCupsSettings(settings["server_settings"]:$[]);
- return true;
-}
-
-/**
- * Dump the printer settings to a single map
- * (For use by autoinstallation.)
- * @return map Dumped settings (later acceptable by Import ())
- */
-global map Export () {
- Printerlib::DetermineClientOnly();
- AutodetectQueues();
- list <map> p_queues = filter(map queue, queues, { return (queue["config"]:""=="local"); });
- map exp = $[
-// "queues" : p_queues,
-// "filters" : Printerlib::ExportFilters( p_queues ),
- "server_settings" : (map)SCR::Read(.cups.server),
- "cups_remote_server" : (map)SCR::Read(.cups.client)
- ];
-//y2internal("export %1", exp);
- return exp;
-}
-
-/**
- * Return packages needed to be installed and removed during
- * Autoinstallation to insure module has all needed software
- * installed.
- * @return map with 2 lists.
- */
-global map AutoPackages() {
- // TODO FIXME: your code here...
- return $[ "install":[], "remove":[] ];
-}
-
/* EOF */
}
+
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.19.5/src/Printerlib.ycp new/yast2-printer-2.19.6/src/Printerlib.ycp
--- old/yast2-printer-2.19.5/src/Printerlib.ycp 2009-11-12 12:39:35.000000000 +0100
+++ new/yast2-printer-2.19.6/src/Printerlib.ycp 2010-03-18 15:40:13.000000000 +0100
@@ -630,20 +630,5 @@
return false;
}
-global boolean WriteCupsSettings(map ay){
- string cups_file="/etc/cups/cupsd.conf";
- y2milestone("Create backup of %1 file:%2", cups_file, SCR::Execute(.target.bash, sformat("mv %1 %1.$(date -I)", cups_file)));
- SCR::Write(.cups.server, ay);
- return true;
-}
-
-global boolean WriteClientSettings(map ay){
- string cups_file="/etc/cups/client.conf";
- y2milestone("Create backup of %1 file:%2", cups_file, SCR::Execute(.target.bash, sformat("mv %1 %1.$(date -I)", cups_file)));
- SCR::Write(.cups.client, ay);
- return true;
-}
-
-
}
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.19.5/src/dialogs.ycp new/yast2-printer-2.19.6/src/dialogs.ycp
--- old/yast2-printer-2.19.5/src/dialogs.ycp 2009-10-29 12:29:33.000000000 +0100
+++ new/yast2-printer-2.19.6/src/dialogs.ycp 2010-03-12 17:45:24.000000000 +0100
@@ -141,5 +141,63 @@
return ret;
}
+map< string, map< string, any > > AutoDialog_widgets_handling =
+ $[ "OVERVIEW" :
+ $[ "widget" : `custom,
+ "custom_widget" : widgetOverview,
+ "init" : initOverview,
+ "handle" : handleOverview,
+ "help" : HELPS["AutoYaSToverview"]:""
+ ],
+ "NETWORKPRINTING" :
+ $[ "widget" : `custom,
+ "custom_widget" : widgetNetworkPrinting,
+ "init" : initNetworkPrinting,
+ "handle" : handleNetworkPrinting,
+ "help" : HELPS["printing_via_network_dialog"]:""
+ ]
+ ];
+
+map< string, map< string, any > > AutoDialog_tabs_description =
+ $[ "overview" :
+ $[ "header" : _("AutoYaST Printer Configurations"),
+ "tree_item_label" : _("Printer Configurations"),
+ "caption" : _("AutoYaST Printer Configurations"),
+ "contents" : `VBox( "OVERVIEW" ),
+ "widget_names" : ["OVERVIEW"]
+ ],
+ "network" :
+ $[ "header" : _("AutoYaST Print via Network Settings"),
+ "tree_item_label" : _("Print via Network"),
+ "caption" : _("AutoYaST Print via Network Settings"),
+ "contents" : `VBox( "NETWORKPRINTING" ),
+ "widget_names" : ["NETWORKPRINTING"]
+ ]
+ ];
+
+symbol runAutoDialog()
+{ string caption = _("AutoYaST Settings for Printing with CUPS via Network");
+ symbol ret = DialogTree::ShowAndRun
+ ( $[ "ids_order" : [ "overview", "network" ],
+ "initial_screen" : "overview",
+ "screens" : AutoDialog_tabs_description,
+ "widget_descr" : AutoDialog_widgets_handling,
+ // All the dialogs in "ids_order" are single (step) configuration dialogs
+ // and according to the new YaST style guide at
+ // http://en.opensuse.org/YaST/Style_Guide#Single_Configuration.2FOverview.2FEd...
+ // there is no longer a "abort" functionality which exits the whole module.
+ // Instead this button is now named "Cancel" and its functionality is
+ // to go back to the Overview dialog (i.e. what the "back" button would do)
+ // because it reads "Cancel - Closes the window and returns to the overview."
+ // Therefore the button with the "abort" functionality is not shown at all
+ // and the button with the "back" functionality is named "Cancel".
+ "abort_button" : nil,
+ "back_button" : Label::CancelButton(),
+ "next_button" : Label::OKButton()
+ ]
+ );
+ return ret;
+}
+
/* EOF */
}
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.19.5/src/helps.ycp new/yast2-printer-2.19.6/src/helps.ycp
--- old/yast2-printer-2.19.5/src/helps.ycp 2010-02-16 16:14:19.000000000 +0100
+++ new/yast2-printer-2.19.6/src/helps.ycp 2010-03-12 17:45:24.000000000 +0100
@@ -106,6 +106,14 @@
of available remote queues.
</p>"),
+"AutoYaSToverview" :
+// AutoYaST Overview dialog help 1/1:
+_("<p>
+<b><big>AutoYaST Print Queue Overview</big></b><br>
+AutoYaST supports only settings for printing with CUPS via network.<br>
+There is no AutoYaST support to set up local print queues.
+</p>"),
+
"basic_add_dialog" :
// BasicAddDialog help 1/5:
_("<p>
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.19.5/src/overview.ycp new/yast2-printer-2.19.6/src/overview.ycp
--- old/yast2-printer-2.19.5/src/overview.ycp 2010-02-18 13:54:12.000000000 +0100
+++ new/yast2-printer-2.19.6/src/overview.ycp 2010-03-12 17:45:24.000000000 +0100
@@ -222,6 +222,16 @@
}
}
}
+ if( Printer::printer_auto_dialogs )
+ { // When the Overview dialog is called by AutoYaST
+ // (by calling in printer_auto.ycp the "Change" function)
+ // it does not make sense to let the user show local queues:
+ UI::ChangeWidget( `local_content_checkbox, `Enabled, false );
+ // Disable also the [Add] Button.
+ // It stays disabled as long as the dialog runs because
+ // it is nowhere again re-enabled below.
+ UI::ChangeWidget( `add, `Enabled, false );
+ }
UI::ChangeWidget( `local_content_checkbox, `Value, local_content_selected );
UI::ChangeWidget( `remote_content_checkbox, `Value, remote_content_selected );
UI::ChangeWidget( `overview_table, `Items,
@@ -477,7 +487,10 @@
// Body of a Popup::AnyMessage when no queue was selected from the list:
_("Select an entry.")
);
- return nil;
+ // 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;
}
if( "yes" == Printer::queues[selected_queue_index,"rejecting"]:"no" )
{ Popup::AnyMessage( // Header of a Popup::AnyMessage when the queue rejects print jobs:
@@ -485,7 +498,10 @@
// Body of a Popup::AnyMessage when the queue rejects print jobs:
_("The testpage cannot be printed because print jobs are rejected.")
);
- return nil;
+ // 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;
}
if( "yes" == Printer::queues[selected_queue_index,"disabled"]:"no" )
{ Popup::AnyMessage( // Header of a Popup::AnyMessage when printing is disabled for the queue:
@@ -493,7 +509,10 @@
// Body of a Popup::AnyMessage when printing is disabled for the queue:
_("The testpage cannot be printed because printout is disabled.")
);
- return nil;
+ // 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;
}
if( "local" == Printer::queues[selected_queue_index,"config"]:"remote" )
{ // When it is a local queue, remember it as the currently selected queue
@@ -586,7 +605,6 @@
),
Printerlib::result["stderr"]:""
);
-
// When submitting the testpage to the queue failed (also for non-local queues)
// there might be whatever reason (e.g. a remote queue might have been deleted in the meantime)
// so that a refresh of the overview content is needed to be on the safe side.
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.19.5/src/printer.desktop new/yast2-printer-2.19.6/src/printer.desktop
--- old/yast2-printer-2.19.5/src/printer.desktop 2010-01-15 15:11:49.000000000 +0100
+++ new/yast2-printer-2.19.6/src/printer.desktop 2010-03-18 16:09:00.000000000 +0100
@@ -6,16 +6,17 @@
X-KDE-RootOnly=true
X-KDE-HasReadOnlyMode=true
X-KDE-Library=yast2
-X-SuSE-YaST-Call=printer
+X-SuSE-YaST-Call=printer
X-SuSE-YaST-Group=Hardware
X-SuSE-YaST-Argument=
X-SuSE-YaST-RootOnly=true
-X-SuSE-YaST-AutoInst=all
X-SuSE-YaST-Geometry=
X-SuSE-YaST-SortKey=
+X-SuSE-YaST-AutoInst=all
X-SuSE-YaST-AutoInstResource=printer
X-SuSE-YaST-AutoInstClonable=true
+X-SuSE-YaST-AutoInstSchema=printer.rnc
Icon=yast-printer
Exec=xdg-su -c "/sbin/yast2 printer"
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.19.5/src/printer.rnc new/yast2-printer-2.19.6/src/printer.rnc
--- old/yast2-printer-2.19.5/src/printer.rnc 2009-10-29 12:29:33.000000000 +0100
+++ new/yast2-printer-2.19.6/src/printer.rnc 2010-03-18 16:09:00.000000000 +0100
@@ -2,117 +2,12 @@
namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
namespace config = "http://www.suse.com/1.0/configns"
-#
-# redone. I used "Anything*" because for me it looks like a generic parser
-# with unpredictable keys - ug@suse.de
-#
printer = element printer {
- element cups_remote_server { text }? &
- element server_settings {
- Anything*
+ element client_conf_content {
+ element file_contents { text }?
+ }? &
+ element cupsd_conf_content {
+ element file_contents { text }?
}?
}
-
-# removed (read above)
-#
-#printer =
-# element printer {
-# (text
-# | printer_default
-# | printcap
-# | cups_installation
-# | server_hostname
-# | spooler)*
-# }
-
-
-#
-# old stuff
-#
-config = element config { text }
-printer_default = element default { text }
-create_remote_queue =
- element create_remote_queue { BOOLEAN }
-accepting =
- element accepting { BOOLEAN }
-cups-state = element cups-state { text }
-# <!ELEMENT default (#PCDATA)>
-
-# <!ELEMENT device (#PCDATA)>: redefined
-device_ieee = element device_ieee { text }
-ff =
- element ff { BOOLEAN }
-info = element info { text }
-job-sheets = element job-sheets { text }
-lprng-state = element lprng-state { text }
-name = element name { text }
-ownppd = element ownppd { text }
-printcap =
- element printcap {
- LIST,
- printcap_entry*
- }
-y2_printcap_entry =
- accepting
- | allowusers
- | bannerend
- | bannerstart
- | denyusers
- | ff
- | info
- | location
- | manufacturer
- | model
- | name
- | nick
- | printcap_entry_options
- | ppd_options
- | raw
- | printcap_entry_state
- | uri
-location = element location { text }
-bannerstart = element bannerstart { text }
-bannerend = element bannerend { text }
-manufacturer = element manufacturer { text }
-model = element model { text }
-nick = element nick { text }
-printcap_entry_state = element state { text }
-printcap_entry_options = element options { text }
-ppd_options =
- element ppd_options {
- LIST,
- ppd_option*
- }
-ppd_option = element ppd_option { ppd_option_key, ppd_option_val }
-ppd_option_key = element key { text }
-ppd_option_val = element value { text }
-denyusers =
- element denyusers {
- LIST,
- denyuser*
- }
-denyuser = element denyuser { text }
-allowusers =
- element allowusers {
- LIST,
- allowuser*
- }
-allowuser = element allowuser { text }
-printcap_entry = element printcap_entry { y2_printcap_entry* }
-printers =
- element printers {
- LIST,
- printer+
- }
-cups_installation =
- element cups_installation { SYMBOL }
-raw =
- element raw {
- attribute config:type { text },
- text
- }
-type = element type { text }
-spooler = element spooler { text }
-server_hostname = element server_hostname { text }
-uri = element uri { text }
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.19.5/src/printer.ycp new/yast2-printer-2.19.6/src/printer.ycp
--- old/yast2-printer-2.19.5/src/printer.ycp 2009-10-29 12:29:33.000000000 +0100
+++ new/yast2-printer-2.19.6/src/printer.ycp 2010-03-12 17:45:24.000000000 +0100
@@ -79,7 +79,7 @@
/* main ui function */
any ret = nil;
-if(propose) ret = PrinterAutoSequence();
+if(propose) ret = PrinterProposalSequence();
else ret = CommandLine::Run(cmdline_description);
y2debug("ret=%1", ret);
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.19.5/src/printer_auto.ycp new/yast2-printer-2.19.6/src/printer_auto.ycp
--- old/yast2-printer-2.19.5/src/printer_auto.ycp 2009-10-29 12:29:33.000000000 +0100
+++ new/yast2-printer-2.19.6/src/printer_auto.ycp 2010-03-18 15:40:13.000000000 +0100
@@ -22,7 +22,8 @@
* File: clients/printer_auto.ycp
* Package: Configuration of printer
* Summary: Client for autoinstallation
- * Authors: Johannes Meixner
+ * Authors: Michal Zugec
+ * Johannes Meixner
*
* $Id: printer_auto.ycp 27914 2006-02-13 14:32:08Z locilka $
*
@@ -32,6 +33,21 @@
*/
/**
+ * It is perfectly correct and sufficient that the
+ * AutoYaST printer profile contains only the content
+ * of /etc/cups/client.conf and /etc/cups/cupsd.conf
+ * because:
+ * The current AutoYaST printer documentation
+ * in Suse/Novell Bugzilla attachment #269970 in
+ * https://bugzilla.novell.com/show_bug.cgi?id=464364#c22
+ * describes why there cannot be support for
+ * local print queues for USB printers
+ * which is a reason that there is only support
+ * for printing with CUPS via network,
+ * and
+ * https://bugzilla.novell.com/show_bug.cgi?id=464364#c25
+ * describes that AutoYaST support regarding whether or not
+ * the cupsd should run belongs to the runlevel module.
* @param function to execute
* @param map/list of printer settings
* @return map edited settings, Summary or boolean on success depending on called function
@@ -47,6 +63,8 @@
y2milestone("Printer auto started");
import "Printer";
+import "Printerlib";
+import "Progress";
include "printer/wizards.ycp";
any ret = nil;
@@ -59,52 +77,201 @@
if(size(WFM::Args()) > 1 && is(WFM::Args(1), map))
param = (map) WFM::Args(1);
}
-y2debug("func=%1", func);
-y2debug("param=%1", param);
+y2milestone("Printer auto func='%1'", func);
+y2milestone("Printer auto param='%1'", param);
-/* Create a summary*/
-if(func == "Summary") {
- ret = Printer::QueueItems( true, true )[0]:[];
-}
-/* Reset configuration */
-else if (func == "Reset") {
- Printer::Import($[]);
- ret = $[];
-}
-// TODO: use global value to set Printer::dirty
-else if (func == "GetModified") {
- ret = true;
- }
-/* Change configuration (run AutoSequence) */
-else if (func == "Change") {
- ret = PrinterAutoSequence();
-}
-/* Import configuration */
-else if (func == "Import") {
- ret = Printer::Import(param);
-}
-/* Return actual state */
-else if (func == "Export") {
- ret = Printer::Export();
-}
-/* Return needed packages */
-else if (func == "Packages") {
- ret = Printer::AutoPackages();
-}
-/* Read current state */
-else if (func == "Read") {
- import "Progress";
- boolean progress_orig = Progress::set (false);
- ret = Printer::Read();
- Progress::set (progress_orig);
-}
-/* Write givven settings */
-else if (func == "Write") {
- import "Progress";
- boolean progress_orig = Progress::set (false);
- Printer::write_only = true;
- ret = Printer::Write();
- Progress::set (progress_orig);
+string ReadFileContent( string file_name )
+{ if( -1 == SCR::Read( .target.size, file_name ) )
+ { // No user information popup because this would block autoinstallation.
+ // It is no error when /etc/cups/cupsd.conf or /etc/cups/client.conf
+ // cannot be read when those files just do not exist because
+ // it is perfectly o.k. to have a system without the package "cups"
+ // (e.g. a client-only setup without the "cups" RPM which provides /etc/cups/cupsd.conf)
+ // or even without a /etc/cups/client.conf file which is provided by the cups-libs RPM
+ // (e.g. a CUPS default setup where CUPS browsing is used and /etc/cups/client.conf was deleted)
+ y2milestone( "Warning: Cannot read %1 (file may not exist).", file_name );
+ Printer::printer_auto_summary = Printer::printer_auto_summary
+ + "<p>"
+ + sformat( // Warning message in the AutoYaST printer client
+ // which is added to its "Summary" text for AutoYaST
+ // where %1 is replaced by the file name which cannot be read.
+ _("Warning: Cannot read %1 (file may not exist)."),
+ file_name
+ )
+ + "</p>";
+ return "";
+ }
+ string content = (string)SCR::Read( .target.string, file_name );
+ if( "" == filterchars( content, Printer::alnum_chars ) )
+ { // No user information popup because this would block autoinstallation.
+ // It is an error when /etc/cups/cupsd.conf or /etc/cups/client.conf exist
+ // but are effectively empty because this indicates a broken CUPS config.
+ y2milestone( "Error: Failed to read %1 (possibly empty file).", file_name );
+ Printer::printer_auto_summary = Printer::printer_auto_summary
+ + "<p>"
+ + sformat( // Error message in the AutoYaST printer client
+ // which is added to its "Summary" text for AutoYaST
+ // where %1 is replaced by the file name which cannot be read.
+ _("Error: Failed to read %1 (possibly empty file)."),
+ file_name
+ )
+ + "</p>";
+ return "";
+ }
+ return content;
+}
+
+/* Create a summary string */
+if (func == "Summary")
+{ ret = Printer::printer_auto_summary;
+}
+/*
+ * Reset the AutoYaST related printer settings to system defaults
+ * which means /etc/cups/cupsd.conf is overwritten by /etc/cups/cupsd.conf.default
+ * (/etc/cups/cupsd.conf.default is provided by our cups RPM for such cases)
+ * and all entries in /etc/cups/client.conf are commented out.
+ * Then read the content form those system config files
+ * (exactly the same way as it is done in the Export function)
+ * and store it in the Printer::autoyast_printer_settings map
+ * (exactly the same is done in the Import function)
+ * so that a subsequent call of the Export function by AutoYaST
+ * would export the system default values to AutoYaST
+ * and a subsequent call of the Write function by AutoYaST would
+ * write the same system default values again to /etc/cups/client.conf
+ * and to /etc/cups/cupsd.conf (regardless that their content
+ * is already reset to system defaults).
+ * Accordingly return the Printer::autoyast_printer_settings map
+ * to AutoYaST so that also the printer related settings inside AutoYaST
+ * are reset to system defaults so that a subsequent call of the Import
+ * function by AutoYaST would provide the correct system default values.
+ */
+else if (func == "Reset")
+{ // It is o.k. to ignore when the next two commands fail
+ // because then /etc/cups/cupsd.conf and/or /etc/cups/client.conf
+ // were (hopefully) not changed at all which is the right fallback
+ // so that there is no change of system config files in case of errors.
+ Printerlib::ExecuteBashCommand( "cp /etc/cups/cupsd.conf.default /etc/cups/cupsd.conf" );
+ Printerlib::ExecuteBashCommand( "sed -i -e '/^[^#]/s/^/#/' /etc/cups/client.conf" );
+ // Ignore read failures and reset to even empty content because to what else could it be reset instead:
+ Printer::autoyast_printer_settings = $[ "cupsd_conf_content" :
+ $[ "file_contents" : ReadFileContent( "/etc/cups/cupsd.conf" ) ],
+ "client_conf_content" :
+ $[ "file_contents" : ReadFileContent( "/etc/cups/client.conf" ) ]
+ ];
+ ret = Printer::autoyast_printer_settings;
+}
+/* Called appropriately by the AutoYaST framework */
+else if (func == "SetModified")
+{ Printer::printer_auto_modified = true;
+ ret = true;
+}
+/* Provide to AutoYaST what it did set before (or the default "false") */
+else if (func == "GetModified")
+{ ret = Printer::printer_auto_modified;
+}
+/* Change configuration (run the wizards AutoSequence dialogs) */
+else if (func == "Change")
+{ // Call Printer::Read() here (compare the 'func == "Read"' case below)
+ // to make sure that when the full printer module dialogs are launched
+ // it asks the user to install the packages cups-client and cups:
+ boolean progress_orig = Progress::set( false );
+ Printer::Read();
+ Progress::set( progress_orig );
+ // Let the Overview dialog disable the checkbox to show local queues
+ // which disables as a consequence in particular the [Delete] button.
+ // Lets the Printing via Network dialog disable the button to
+ // run the Connection Wizard (to set up a local queue for a network printer).
+ Printer::printer_auto_dialogs = true;
+ // Let the Overview dialog only show remote queues:
+ Printer::queue_filter_show_remote = true;
+ Printer::queue_filter_show_local = false;
+ // PrinterAutoSequence in wizards.ycp runs only the AutoSequence
+ // which is only the "Printing via Network" and the "Overview" dialog
+ // (starting with the "Printing via Network" dialog)
+ // but without running before ReadDialog (which calls only Printer::Read)
+ // and running afterwards WriteDialog (which calls only Printer::Write)
+ // which is the reason that Printer::Read is called explicitely above.
+ ret = PrinterAutoSequence();
+}
+/*
+ * Import the AutoYaST related printer settings map from AutoYaST
+ * and store it to be used later when the Write function is called.
+ */
+else if (func == "Import")
+{ Printer::autoyast_printer_settings = param;
+ ret = true;
+}
+/*
+ * Read AutoYaST related printer configuration from this system's config files
+ * and export them to AutoYaST as a single map so that it can be imported later
+ * on another system from AutoYaST when AutoYaST on the other system
+ * calls the above Import function.
+ */
+else if (func == "Export")
+{ // Ignore read failures and export even empty content because what else could be exported instead:
+ ret = $[ "cupsd_conf_content" : $[ "file_contents" : ReadFileContent( "/etc/cups/cupsd.conf" ) ],
+ "client_conf_content" : $[ "file_contents" : ReadFileContent( "/etc/cups/client.conf" ) ]
+ ];
+}
+/*
+ * Return packages needed to be installed and removed during
+ * Autoinstallation to insure it has all needed software installed.
+ * @return map with 2 lists of strings $["install":[],"remove":[]]
+ */
+else if (func == "Packages")
+{ list< string > to_be_installed_packages = [];
+ if( Printerlib::TestAndInstallPackage( "cups-client", "installed" ) )
+ { to_be_installed_packages = add( to_be_installed_packages, "cups-client" );
+ }
+ if( Printerlib::TestAndInstallPackage( "cups", "installed" ) )
+ { to_be_installed_packages = add( to_be_installed_packages, "cups" );
+ }
+ ret = $[ "install":to_be_installed_packages,
+ "remove":[]
+ ];
+}
+/* Dummy to provide a Read function for the AutoYaST framework */
+else if (func == "Read")
+{ // Do not call Printer::Read() here to
+ // avoid that the AutoYaST printer client asks the user
+ // to install the packages cups-client and cups, see
+ // https://bugzilla.novell.com/show_bug.cgi?id=445719#c13
+ y2milestone("Not calling Printer::Read() to avoid that printer_auto asks to install cups-client and cups.");
+ ret = true;
+}
+/*
+ * Write the AutoYaST related printer settings to the system
+ * according to the Printer::autoyast_printer_settings_import map
+ * which was stored by a previous call of the Import function by AutoYaST
+ * or reset to an empty map by a previous call of the Reset function.
+ */
+else if (func == "Write")
+{ y2milestone("Writing to system '%1'", Printer::autoyast_printer_settings);
+ if( ! SCR::Write( .target.string,
+ "/etc/cups/cupsd.conf",
+ Printer::autoyast_printer_settings["cupsd_conf_content","file_contents"]:""
+ )
+ )
+ { // No user information popup because this would block autoinstallation:
+ y2milestone( "Error: Failed to write /etc/cups/cupsd.conf" );
+ Printer::printer_auto_summary = Printer::printer_auto_summary
+ + "<p>"
+ + _("Error: Failed to write /etc/cups/cupsd.conf")
+ + "</p>";
+ }
+ if( ! SCR::Write( .target.string,
+ "/etc/cups/client.conf",
+ Printer::autoyast_printer_settings["client_conf_content","file_contents"]:""
+ )
+ )
+ { // No user information popup because this would block autoinstallation:
+ y2milestone( "Error: Failed to write /etc/cups/client.conf" );
+ Printer::printer_auto_summary = Printer::printer_auto_summary
+ + "<p>"
+ + _("Error: Failed to write /etc/cups/client.conf")
+ + "</p>";
+ }
+ return true;
}
/* Unknown function */
else {
@@ -112,7 +279,7 @@
ret = false;
}
-y2debug("ret=%1", ret);
+y2milestone("Printer auto ret='%1'", ret);
y2milestone("Printer auto finished");
y2milestone("----------------------------------------");
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.19.5/src/printer_proposal.ycp new/yast2-printer-2.19.6/src/printer_proposal.ycp
--- old/yast2-printer-2.19.5/src/printer_proposal.ycp 2009-10-29 12:29:33.000000000 +0100
+++ new/yast2-printer-2.19.6/src/printer_proposal.ycp 2010-03-18 15:40:13.000000000 +0100
@@ -51,25 +51,20 @@
map param = (map) WFM::Args(1);
map ret = $[];
-/* create a textual proposal */
+/* create a textual proposal and write it instantly to the system */
if( func == "MakeProposal" )
{ list<string> proposal = [];
string warning = nil;
symbol warning_level = nil;
boolean force_reset = param["force_reset"]:false;
- if( force_reset || ! Printer::proposal_valid )
- { Printer::proposal_valid = true;
- // Do not call Printer::Read() here to
+ if( force_reset )
+ { // Do not call Printer::Read() here to
// avoid that the hardware proposal asks the user
// to install the packages cups-client and cups, see
// https://bugzilla.novell.com/show_bug.cgi?id=445719#c13
- //boolean progress_orig = Progress::set( false );
- //Printer::Read();
- //Progress::set( progress_orig );
y2milestone("Not calling Printer::Read() to avoid that the proposal asks to install cups-client and cups.");
}
// Propose configuration for each local printer:
- // TODO: replace by cups-autoconfig
// Check if the packages cups-client and cups are installed
// and skip the automated queue setup if one of them is missing, see
// https://bugzilla.novell.com/show_bug.cgi?id=445719#c13
@@ -205,14 +200,19 @@
{ string uri = String::CutBlanks(printer[2]:"");
if( "" != uri )
{ y2internal("Setting up a queue for URI '%1'", uri);
+ // See basicadd.ycp how a queue_name_proposal is set there:
string queue_name = Printer::NewQueueName( tolower( model ) );
if( contains( already_set_up_uris, uri ) )
{ y2internal("Skipping printer '%1' because a queue with the same URI already exists.", printer);
continue;
}
y2milestone("Proposed queue name: %1", queue_name);
- string driver_filter_string = "^" + filterchars( tolower( model ), Printer::lower_alnum_chars );
- if( "^" != driver_filter_string )
+ // See basicadd.ycp how driver_filter_input_text and driver_filter_string are set there.
+ // The same is done here so that the proposal results the same as if the user
+ // would have blindly clicked [OK] in the BasicAddDialog:
+ string driver_filter_input_text = Printer::DeriveModelName( model, 0 );
+ string driver_filter_string = Printer::DeriveDriverFilterString( driver_filter_input_text );
+ if( "" != driver_filter_string )
{ list drivers = Printer::DriverItems( driver_filter_string, true );
// Printer::DriverItems may result a drivers list with one single element
// [ `item( `id( -1 ), _("No matching driver found.") ) ]
@@ -232,7 +232,11 @@
&& Printer::selected_connections_index >= 0
)
{ y2internal("Selected driver: %1", drivers[0]:nil);
- if( Printer::AddQueue( queue_name, "" ) )
+ // An empty default_paper_size results CUPS's default paper size
+ // (see the Printer::AddQueue function) so that the proposal results the same
+ // as if the user would have blindly clicked [OK] in the BasicAddDialog:
+ string default_paper_size = "";
+ if( Printer::AddQueue( queue_name, default_paper_size ) )
{ already_set_up_uris = add( already_set_up_uris, uri );
// Autodetect queues again so that Printer::NewQueueName
// can compare with existing queue names but ignore whatever failures
@@ -271,20 +275,21 @@
"warning" : warning,
];
}
-/* run the module */
+/* run the full printer module dialogs */
else if(func == "AskUser")
{ // Call Printer::Read() here (compare "MakeProposal" above)
- // to make sure that when the full printer module is launched
+ // to make sure that when the full printer module dialogs are launched
// it asks the user to install the packages cups-client and cups:
boolean progress_orig = Progress::set( false );
Printer::Read();
Progress::set( progress_orig );
- // TODO FIXME: Printer::Export exists but there is nothing implemented
- map stored = Printer::Export();
+ // In printer.ycp the .propose argument calls PrinterAutoSequence and
+ // PrinterAutoSequence in wizards.ycp runs only the MainSequence
+ // which are all the usual dialogs (starting with the "Overview")
+ // but without running before ReadDialog (which calls only Printer::Read)
+ // and running afterwards WriteDialog (which calls only Printer::Write)
+ // which is the reason that Printer::Read is called explicitely above.
symbol seq = (symbol) WFM::CallFunction("printer", [.propose]);
- // TODO FIXME: Printer::Import exists but there is nothing implemented
- if(seq != `next) Printer::Import(stored);
- y2debug("stored=%1",stored);
y2debug("seq=%1",seq);
ret = $[ "workflow_sequence" : seq ];
}
@@ -303,7 +308,6 @@
// it does actually nothing except to exit verbosely, see
// http://en.opensuse.org/YaST/Development/Printer_Enhancement#Basic_Implementa...:
// for background information.
- //Printer::Write();
y2milestone("No need to call Printer::Write() because it does nothing.");
}
/* unknown function */
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.19.5/src/printingvianetwork.ycp new/yast2-printer-2.19.6/src/printingvianetwork.ycp
--- old/yast2-printer-2.19.5/src/printingvianetwork.ycp 2009-12-11 17:49:15.000000000 +0100
+++ new/yast2-printer-2.19.6/src/printingvianetwork.ycp 2010-03-12 17:45:24.000000000 +0100
@@ -802,7 +802,8 @@
initial_client_conf_input_value = "";
UI::ChangeWidget( `id(`test_client_conf_server), `Enabled, false );
// Only the "Connection Wizard" button is enabled by default
- // and disabled in case of "client_only", see "Client only settings" below:
+ // and disabled in case of "client_only" (see "Client only settings" below)
+ // and also disabled in case of Printer::printer_auto_dialogs.
UI::ChangeWidget( `id(`connection_wizard), `Enabled, true );
// Make the actual Browsing settings:
// If "none" is present as a BrowseAllow value it is actually no Browsing config.
@@ -937,6 +938,13 @@
// Fill in the client-only values of the current settings in the system
// regardless if it is actually a client-only config or not (see above):
UI::ChangeWidget( `id(`client_conf_input), `Value, Printerlib::client_conf_server_name );
+ if( Printer::printer_auto_dialogs )
+ { // When the Overview dialog is called by AutoYaST
+ // (by calling in printer_auto.ycp the "Change" function)
+ // it does not make sense to let the user set up a local queue
+ // for a network printer via the "Connection Wizard":
+ UI::ChangeWidget( `id(`connection_wizard), `Enabled, false );
+ }
initial_client_conf_input_value = Printerlib::client_conf_server_name;
y2milestone( "leaving initNetworkPrinting with\ninitial_browsing = '%1'\ninitial_browse_allow = '%2'\ninitial_browse_allow_input_value = '%3'\ninitial_browse_poll = '%4'\ninitial_browse_poll_input_value = '%5'\ninitial_client_only = '%6'\ninitial_client_conf_input_value = '%7'", initial_browsing, initial_browse_allow, initial_browse_allow_input_value, initial_browse_poll, initial_browse_poll_input_value, initial_client_only, initial_client_conf_input_value );
}
@@ -1000,10 +1008,12 @@
}
UI::ChangeWidget( `id(`client_conf_input), `Enabled, false );
UI::ChangeWidget( `id(`test_client_conf_server), `Enabled, false );
- if( ! Printerlib::client_only )
+ if( ! Printerlib::client_only && ! Printer::printer_auto_dialogs )
{ // The "Connection Wizard" button is enabled by default
// and disabled if currently a "client_only" config is active.
- // In this case it is never again enabled as long as the dialog runs, see above:
+ // In this case it is never again enabled as long as the dialog runs, see above.
+ // It is also disabled in case of Printer::printer_auto_dialogs
+ // and then it must stay disabled as long as the dialog runs.
UI::ChangeWidget( `id(`connection_wizard), `Enabled, true );
}
}
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.19.5/src/wizards.ycp new/yast2-printer-2.19.6/src/wizards.ycp
--- old/yast2-printer-2.19.5/src/wizards.ycp 2010-02-17 15:32:36.000000000 +0100
+++ new/yast2-printer-2.19.6/src/wizards.ycp 2010-03-12 17:45:24.000000000 +0100
@@ -113,7 +113,7 @@
"printing_via_network_connection_wizard" : $[ `abort : `abort,
`back : "overview",
`next : "add"
- ],
+ ]
];
return Sequencer::Run( aliases, sequence );
}
@@ -146,7 +146,36 @@
}
/**
- * Whole configuration of printer but without reading and writing.
+ * Workflow of the printer configuration for AutoYaST
+ * @return sequence result
+ */
+any AutoSequence()
+{ map aliases = $[ "overview" : ``( runAutoDialog() )
+ ];
+ map sequence = $[ "ws_start" : "overview",
+ "overview": $[ `abort : `abort,
+ `back : "overview",
+ `next : `next,
+ `add : "overview",
+ `modify : "overview",
+ `delete : "overview",
+ `refresh : "overview",
+ `printing_via_network_back : "overview",
+ `printing_via_network_next : "overview",
+ `printing_via_network_connection_wizard : "overview",
+ `sharing_back : "overview",
+ `sharing_next : "overview",
+ `policies_back : "overview",
+ `policies_next : "overview",
+ `autoconfig_back : "overview",
+ `autoconfig_next : "overview"
+ ]
+ ];
+ return Sequencer::Run( aliases, sequence );
+}
+
+/**
+ * Only "Printing via Network" configuration of printer.
* For use with autoinstallation.
* @return sequence result
*/
@@ -154,6 +183,28 @@
{ /* Initialization dialog caption */
string caption = _("Printer Configuration");
/* Initialization dialog contents */
+ term contents = `Label( _("Initializing...") );
+ Wizard::CreateDialog();
+ Wizard::SetContentsButtons( caption,
+ contents,
+ "",
+ Label::BackButton(),
+ Label::NextButton()
+ );
+ any ret = AutoSequence();
+ UI::CloseDialog();
+ return ret;
+}
+
+/**
+ * Whole configuration of printer but without reading and writing.
+ * For use with proposal at the end of the system installation.
+ * @return sequence result
+ */
+any PrinterProposalSequence()
+{ /* Initialization dialog caption */
+ string caption = _("Printer Configuration");
+ /* Initialization dialog contents */
term contents = `Label( _("Initializing...") );
Wizard::CreateDialog();
Wizard::SetContentsButtons( caption,
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org