commit yast2-printer for openSUSE:Factory
![](https://seccdn.libravatar.org/avatar/e2145bc5cf53dda95c308a3c75e8fef3.jpg?s=120&d=mm&r=g)
Hello community, here is the log from the commit of package yast2-printer for openSUSE:Factory checked in at Wed Jul 29 00:35:52 CEST 2009. -------- --- yast2-printer/yast2-printer.changes 2009-06-03 09:38:08.000000000 +0200 +++ yast2-printer/yast2-printer.changes 2009-07-28 13:08:52.000000000 +0200 @@ -1,0 +2,26 @@ +Tue Jul 28 12:14:43 CEST 2009 - jsmeix@suse.de + +- Be prepared for CUPS 1.4: + * Since CUPS 1.4 'lpstat -r' results true even when scheduler + is not running. Therefore we must now grep in its output for + 'scheduler is running' (see Novell/Suse Bugzilla bnc#520599). + * Since CUPS 1.4 there is no longer a readymade PostScript + testpage in CUPS. Therefore a slightly modified CUPS 1.3.10 + testprint.ps was added as /usr/share/YaST2/data/testprint.ps + (see Novell/Suse Bugzilla bnc#520617). + * Since CUPS 1.4 there are several seconds delay until cupsd + writes confug files like printers.conf which requires the + new function Printerlib::WaitForUpdatedConfigFiles + (see Novell/Suse Bugzilla bnc#520612). + * At least in CUPS 1.4.rc1 a 'sleep 1' workaround is required + to ensure that 'lpoptions -l' reports correct defaults + (see Novell/Suse Bugzilla bnc#520642 and + CUPS STR #3264 http://www.cups.org/str.php?L3264). +- 2.18.18 + +------------------------------------------------------------------- +Wed Jul 8 12:23:59 CEST 2009 - ug@suse.de + +- redone RNC file + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- yast2-printer-2.18.17.tar.bz2 New: ---- yast2-printer-2.18.18.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-printer.spec ++++++ --- /var/tmp/diff_new_pack.g5XvC9/_old 2009-07-29 00:33:51.000000000 +0200 +++ /var/tmp/diff_new_pack.g5XvC9/_new 2009-07-29 00:33:51.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package yast2-printer (Version 2.18.17) +# spec file for package yast2-printer (Version 2.18.18) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -17,21 +17,19 @@ # norootforbuild -Url: http://en.opensuse.org/YaST/Modules/Printer Name: yast2-printer -Version: 2.18.17 +Version: 2.18.18 Release: 1 -License: GPL v2 or later +License: GPL Group: System/YaST BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: yast2-printer-2.18.17.tar.bz2 +Source0: yast2-printer-2.18.18.tar.bz2 Prefix: /usr BuildRequires: cups-devel update-desktop-files yast2 yast2-core-devel yast2-devtools yast2-testsuite Recommends: netcat Requires: /usr/bin/host cups-libs Requires: yast2 >= 2.16.12 -#Requires: cups >= 1.2 Provides: yast2-config-cups yast2-agent-printerdb yast2-agent-cups yast2-lib-printer yast2-config-printer y2c_cups y2c_prnt y2l_printer y2a_cups y2a_printerdb yast2-trans-printer yast2-trans-libprinter yast2-trans-printerdb yast2-trans-cups yast2-printerdb-devel yast2-cups-devel Obsoletes: yast2-config-cups yast2-agent-printerdb yast2-agent-cups yast2-lib-printer yast2-config-printer y2c_cups y2c_prnt y2l_printer y2a_cups y2a_printerdb yast2-trans-printer yast2-trans-libprinter yast2-trans-printerdb yast2-trans-cups yast2-printerdb-devel yast2-cups-devel Provides: yast2-agent-cups-devel yast2-agent-printerdb-devel y2d_prnt y2t_prnt yast2-db-printer yast2-printerdb @@ -39,33 +37,19 @@ Summary: YaST2 - Printer Configuration %package devel-doc -License: GPL v2 or later +License: GPL Group: Documentation/SUSE BuildRequires: cups-devel yast2-core-devel -Summary: YaST2 - Developer documentation for yast2-printer +Summary: Developer documentation for yast2-printer %description This package contains the YaST2 component for printer configuration. - - -Authors: --------- - Johannes Meixner <jsmeix@suse.de> - Michal Zugec <mzugec@suse.cz> - %description devel-doc -This package contains Developer documentation for YaST2 printer -configuration module. - - - -Authors: --------- - Michal Zugec <mzugec@suse.cz> +Developer documentation for yast2-printer. %prep -%setup -n yast2-printer-2.18.17 +%setup -n yast2-printer-2.18.18 %build %{prefix}/bin/y2tool y2autoconf @@ -93,7 +77,6 @@ %files %defattr(-,root,root) %dir /usr/share/YaST2/include/printer -#%dir /usr/share/YaST2/data/printer %{prefix}/share/applications/YaST2/printer.desktop /usr/share/YaST2/modules/*.y* /usr/share/YaST2/clients/printer* @@ -101,9 +84,7 @@ /usr/share/YaST2/schema/autoyast/rnc/printer.rnc /usr/share/YaST2/scrconf/* /usr/lib/YaST2/servers_non_y2/* -#data -#check this - we need testpage! -#/usr/share/YaST2/data/printer/testpg.* +/usr/share/YaST2/data/testprint.ps %{prefix}/lib/YaST2/bin/autodetect_print_queues %{prefix}/lib/YaST2/bin/autodetect_printers %{prefix}/lib/YaST2/bin/create_printer_ppd_database ++++++ yast2-printer-2.18.17.tar.bz2 -> yast2-printer-2.18.18.tar.bz2 ++++++ ++++ 1715 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.18.17/Makefile.am new/yast2-printer-2.18.18/Makefile.am --- old/yast2-printer-2.18.17/Makefile.am 2009-06-02 16:43:07.000000000 +0200 +++ new/yast2-printer-2.18.18/Makefile.am 2009-07-28 12:12:42.000000000 +0200 @@ -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 doc src testsuite tools +SUBDIRS = agents 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.18.17/VERSION new/yast2-printer-2.18.18/VERSION --- old/yast2-printer-2.18.17/VERSION 2009-06-02 16:35:54.000000000 +0200 +++ new/yast2-printer-2.18.18/VERSION 2009-07-28 12:12:16.000000000 +0200 @@ -1 +1 @@ -2.18.17 +2.18.18 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.18.17/configure.in new/yast2-printer-2.18.18/configure.in --- old/yast2-printer-2.18.17/configure.in 2009-06-02 16:43:07.000000000 +0200 +++ new/yast2-printer-2.18.18/configure.in 2009-07-28 12:12:42.000000000 +0200 @@ -3,7 +3,7 @@ dnl -- This file is generated by y2autoconf 2.17.6 - DO NOT EDIT! -- dnl (edit configure.in.in instead) -AC_INIT(yast2-printer, 2.18.17, http://bugs.opensuse.org/, yast2-printer) +AC_INIT(yast2-printer, 2.18.18, 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.18.17" +VERSION="2.18.18" RPMNAME="yast2-printer" MAINTAINER="Michal Zugec <mzugec@novell.com>" @@ -151,6 +151,7 @@ AC_CONFIG_FILES(Makefile agents/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.18.17/data/Makefile.am new/yast2-printer-2.18.18/data/Makefile.am --- old/yast2-printer-2.18.17/data/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-printer-2.18.18/data/Makefile.am 2009-07-09 15:23:29.000000000 +0200 @@ -0,0 +1,5 @@ +# Makefile.am for printer/data + +ydata_DATA = testprint.ps + +EXTRA_DIST = $(ydata_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.18.17/data/testprint.ps new/yast2-printer-2.18.18/data/testprint.ps --- old/yast2-printer-2.18.17/data/testprint.ps 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-printer-2.18.18/data/testprint.ps 2009-07-09 15:25:26.000000000 +0200 @@ -0,0 +1,598 @@ +%!PS-Adobe-3.0 +%%BoundingBox: 0 0 612 792 +%%Pages: 1 +%%LanguageLevel: 1 +%%DocumentData: Clean7Bit +%%DocumentSuppliedResources: procset testprint/1.3 +%%DocumentNeededResources: font Helvetica Helvetica-Bold Times-Roman +%%Creator: Michael Sweet, Apple Inc. +%%CreationDate: D:20090113092400+0800 +%%Title: Test Page +%%EndComments +%%BeginProlog +%%BeginResource procset testprint 1.3 0 +% +% PostScript test page for the Common UNIX Printing System ("CUPS"). +% +% Copyright 2007-2009 Apple Inc. +% Copyright 1993-2007 Easy Software Products +% +% These coded instructions, statements, and computer programs are the +% property of Apple Inc. and are protected by Federal copyright law. +% Distribution and use rights are outlined in the file "LICENSE.txt" +% which is included with the CUPS source distribution. +% +/SEXTANT { % Draw a color wheel sextant... + % (name) white radius r g b SEXTANT - + % Loop through 100 shades... + 0 0.010101 0.98 { + % Set the color... + dup 0.75 le { % Get "white" value + % Start from black + dup 0.75 div % val2 = val / 0.75 + + 0 index 5 index mul % R = R * val2 + 1 index 5 index mul % G = G * val2 + 2 index 5 index mul % B = B * val2 + + 4 -1 roll pop % Discard val2 + } { + % Fade to white + dup neg 1 add 4 mul % val2 = (1 - val) * 4 + + 0 index 5 index mul % R = R * val2 + 1 index neg 1 add add % + (1 - val2) + 1 index 5 index mul % G = G * val2 + 2 index neg 1 add add % + (1 - val2) + 2 index 5 index mul % B = B * val2 + 3 index neg 1 add add % + (1 - val2) + + 4 -1 roll pop % Discard val2 + } ifelse + setrgbcolor % Set the color... + + % Draw the polygon... + newpath % Start a new path... + dup 5 index mul % r1 = radius * val + 0 0 3 -1 roll 0 60 arc % Draw the inner arc + + dup 0.010101 add 5 index mul% r2 = (radius + 0.010101) * val + 0 0 3 -1 roll 60 0 arcn % Draw the outer arc + + closepath % Close the path + fill % Fill it... + + pop % Pop value... + } for + + % Draw a line around the polygons... + pop pop pop dup % Pop R, G, B, start + 0 setgray % Black + newpath + 0 0 moveto % Center + 0 0 3 -1 roll 0 60 arc % Arc around octant + closepath % Back to center + stroke % Stroke it... + + % Draw the label... + dup % Save radius + dup 30 cos mul % X = radius * cos(30) + exch 30 sin mul % Y = radius * sin(30) + moveto % Position label + + gsave + 30 rotate % Rotate label + dup 0.05 mul % Offset to the right + exch -0.05 mul % and down... + rmoveto % Offset label + show % Show label + grestore +} bind def +/CENTER { % Draw centered text + % (name) CENTER - + dup stringwidth pop % Get the width of the string + 0.5 mul neg 0 rmoveto % Shift left 1/2 of the distance + show % Show the string +} bind def +/RIGHT { % Draw right-justified text + % (name) RIGHT - + dup stringwidth pop % Get the width of the string + neg 0 rmoveto % Shift left the entire distance + show % Show the string +} bind def +/NUMBER { % Draw a number + % power n NUMBER - + 1 index 1 eq { % power == 1? + round cvi exch pop % Convert "n" to integer + } { + 1 index mul round exch div % Truncate extra decimal places + } ifelse + 100 string cvs show % Convert to a string and show it... +} bind def +/CUPSLOGO { % Draw the CUPS logo + % height CUPSLOGO + % Start with a big C... + /Helvetica findfont 1 index scalefont setfont + 0 setgray + 0 0 moveto + (C) show + + % Then "UNIX Printing System" much smaller... + /Helvetica-Bold findfont 1 index 9 div scalefont setfont + 0.25 mul + dup dup 2.0 mul moveto + (UNIX) show + dup dup 1.6 mul moveto + (Printing) show + dup 1.2 mul moveto + (System) show +} bind def +%%EndResource +%%EndProlog +%%Page: 1 1 +gsave + + % Determine the imageable area and device resolution... + initclip newpath clippath pathbbox % Get bounding rectangle + 72 div /pageTop exch def % Get top margin in inches + 72 div /pageRight exch def % Get right margin in inches + 72 div /pageBottom exch def % Get bottom margin in inches + 72 div /pageLeft exch def % Get left margin in inches + + 4 setlinewidth % Draw wide lines + 0 setgray closepath stroke % Draw a clipping rectangle + + /pageWidth pageRight pageLeft sub def % pageWidth = pageRight - pageLeft + /pageHeight pageTop pageBottom sub def% pageHeight = pageTop - pageBottom + + 72 72 dtransform % Get device resolution per inch + /yResolution exch abs def % yResolution = abs(yres) + /xResolution exch abs def % xResolution = abs(xres) + + % Figure out the sizes of things... + /wheelSize % size of wheels + pageWidth pageHeight lt + { pageWidth 9 mul } + { pageHeight 7 mul } + ifelse def + + % Create fonts... + /bigFont /Helvetica-Bold findfont % bigFont = Helvetica-Bold + pageHeight 3 mul scalefont def % size = pageHeight * 3 (nominally 33) + + /mediumFont /Helvetica findfont % mediumFont = Helvetica + pageHeight 1.5 mul scalefont def % size = pageHeight * 1.5 (nominally 16.5) + + /smallFont /Times-Roman findfont % smallFont = Times-Roman + pageHeight scalefont def % size = pageHeight (nominally 11) + + % Draw rulers along the edges... + /CENTIMETER 72 2.54 div def + /MILLIMETER 72 25.4 div def + + /Times-Roman findfont % Font for ruler numbers + 11 scalefont setfont % 11 points + + gsave % Left side inches + pageLeft 72 mul 0 translate % Offset left edge + + 1 setlinewidth % Draw normal lines + 72 72 pageTop 72 mul { % Height inches + dup dup + 0 exch moveto 24 0 rlineto stroke % Draw tic mark + 24 exch pageHeight sub moveto % Draw number + 72 div cvi 10 string cvs RIGHT + } for + + 0.5 setlinewidth % Draw thin lines + 18 18 pageTop 72 mul { % 1/4 inches + 0 exch moveto 15 0 rlineto stroke % Draw tic mark + } for + + 9 9 pageTop 72 mul { % 1/8 inches + 0 exch moveto 6 0 rlineto stroke % Draw tic mark + } for + grestore + + gsave % Bottom inches + 0 pageBottom 72 mul translate % Offset bottom edge + + 1 setlinewidth % Draw normal lines + 72 72 pageRight 72 mul { % Width inches + dup dup + 0 moveto 0 24 rlineto stroke % Draw tic mark + 3 add 27 pageHeight sub moveto % Draw number + 72 div cvi 10 string cvs show + } for + + 0.5 setlinewidth % Draw thin lines + 18 18 pageRight 72 mul { % 1/4 inches + 0 moveto 0 15 rlineto stroke % Draw tic mark + } for + + 9 9 pageRight 72 mul { % 1/8 inches + 0 moveto 0 6 rlineto stroke % Draw tic mark + } for + grestore + + gsave % Right side centimeters + pageRight 72 mul 0 translate % Offset right edge + + 1 setlinewidth % Draw normal lines + CENTIMETER CENTIMETER + pageTop 72 mul { % Height centimeters + 0 exch moveto -24 0 rlineto stroke% Draw tic mark + } for + 1 1 pageTop 2.54 mul { % Height labels + dup + -24 exch CENTIMETER mul + pageHeight sub moveto % Draw number + cvi 10 string cvs show + } for + + 0.5 setlinewidth % Draw thin lines + 0 0.5 CENTIMETER mul + pageTop 72 mul { % 1/2 centimeters + 0 exch moveto -15 0 rlineto stroke% Draw tic mark + } for + 0 MILLIMETER pageTop 72 mul { % Millimeters + 0 exch moveto -6 0 rlineto stroke % Draw tic mark + } for + grestore + + gsave % Top centimeters + 0 pageTop 72 mul translate % Offset top edge + + 1 setlinewidth % Draw normal lines + CENTIMETER CENTIMETER + pageRight 72 mul { % Width centimeters + 0 moveto 0 -24 rlineto stroke % Draw tic mark + } for + 1 1 pageRight 2.54 mul { % Width labels + dup + CENTIMETER mul 3 add -24 moveto % Draw number + cvi 10 string cvs show + } for + + 0.5 setlinewidth % Draw thin lines + 0 0.5 CENTIMETER mul + pageRight 72 mul { % 1/2 centimeters + 0 moveto 0 -15 rlineto stroke % Draw tic mark + } for + 0 MILLIMETER pageRight 72 mul { % Millimeters + 0 moveto 0 -6 rlineto stroke % Draw tic mark + } for + grestore + + % Offset page to account for lower-left margin... + pageLeft 72 mul + pageBottom 72 mul + translate + + % Set text font and color... + mediumFont setfont % Font + 0 setgray % Color + 1 setlinewidth % Draw normal lines + + % Draw the color wheel... + gsave + % Position the wheel on the left side... + pageWidth 18 mul % x = pageWidth * 1/4 * 72 + pageHeight 54 mul % y = pageHeight * 3/4 * 72 + translate + + % Size the wheel... + wheelSize + + % Draw the colors... + dup (C) 3 -1 roll 0 1 1 SEXTANT 60 rotate + dup (M) 3 -1 roll 1 0 1 SEXTANT 60 rotate + dup (Y) 3 -1 roll 1 1 0 SEXTANT 60 rotate + dup (R) 3 -1 roll 1 0 0 SEXTANT 60 rotate + dup (G) 3 -1 roll 0 1 0 SEXTANT 60 rotate + dup (B) 3 -1 roll 0 0 1 SEXTANT 60 rotate + + pop + grestore + + % Label the color wheel... + pageWidth 18 mul % x = pageWidth * 1/4 * 72 + pageHeight 43 mul % y = pageHeight * 19/32 * 72 + moveto % Position the text + (Color Wheel) CENTER % Show the text centered + + % Draw the gray ramp... + gsave + % Position the gray ramp in the center... + pageWidth 36 mul % x = pageWidth * 1/2 * 72 + pageHeight 54 mul % y = pageHeight * 3/4 * 72 + wheelSize sub % - wheelSize + translate + + % Loop through 100 shades... + 0 0.010101 0.98 { + % Set the color... + dup setgray % Set the grayscale... + + % Draw the polygon... + newpath % Start a new path... + + wheelSize -0.2 mul % X = -wheelSize / 5 + 1 index 2 mul wheelSize mul % Y = val * 2 * wheelSize + moveto % Move there... + + wheelSize 0.4 mul 0 rlineto % Right side... + + wheelSize 0.2 mul % X = wheelSize / 5 + 1 index 0.010101 add 2 mul wheelSize mul + % Y = (val + 0.010101) * 2 * wheelSize + lineto % Move there... + + wheelSize -0.4 mul 0 rlineto % Left side... + + closepath % Close the path + fill % Fill it... + + pop % Pop value... + } for + + 0 setgray % Black + + newpath % Start a new path + wheelSize -0.2 mul 0 moveto % Bottom left + wheelSize 0.4 mul 0 rlineto % Bottom right + 0 wheelSize 2 mul rlineto % Upper right + wheelSize -0.4 mul 0 rlineto % Upper left + closepath % Close the path + stroke % Stroke it... + + 0 wheelSize -0.2 mul moveto % Center bottom for label + (K) CENTER % Center K at bottom + + 0 wheelSize 2.05 mul moveto % Center top for label + (W) CENTER % Center W at top + grestore + + % Label the gray ramp... + pageWidth 36 mul % x = pageWidth * 1/2 * 72 + pageHeight 43 mul % y = pageHeight * 19/32 * 72 + moveto % Position the text + (Gray Ramp) CENTER % Show the text centered + + + % Draw radial lines... + gsave + 0 setlinewidth % 1 pixel lines + + % Position the lines on the left side... + pageWidth 54 mul % x = pageWidth * 3/4 * 72 + pageHeight 54 mul % y = pageHeight * 3/4 * 72 + translate + + % Size the wheel... + wheelSize + + % Loop at 1 degree increments + 0 1 359 { + pop % Discard angle - not used + 0 0 moveto % Start line at the center + dup 0 lineto % Draw to the radius + 1 rotate % Rotate 1 degree + } for + + pop % Discard radius - not needed anymore + stroke % Draw lines... + + grestore + + % Label the lines... + pageWidth 54 mul % x = pageWidth * 3/4 * 72 + pageHeight 43 mul % y = pageHeight * 19/32 * 72 + moveto % Position the text + (1 Degree Radial Lines) CENTER % Show the text centered + + % Imageable area... + pageHeight 15 mul % Height of imageable area + + pageWidth 4.5 mul % x = pageWidth * 1/16 * 72 + pageHeight 35.5 mul % y = pageHeight * 1/2 * 72 + 2 index sub % y -= height + pageWidth 28 mul % width = pageWidth * 1/4 * 72 + 3 index % height + 0.5 setgray rectfill % Draw a shadow + + pageWidth 4 mul % x = pageWidth * 1/16 * 72 + pageHeight 36 mul % y = pageHeight * 1/2 * 72 + 2 index sub % y -= height + pageWidth 28 mul % width = pageWidth * 3/8 * 72 + 3 index % height + 4 copy 1 setgray rectfill % Clear the box to white + 0 setgray rectstroke % Draw a black box around it... + + pop % Discard height + + % Label the imageable area... + pageWidth 4 mul % x = pageWidth * 1/16 * 72 + pageHeight 37 mul % y = pageHeight * 1/2 * 72 + moveto % Position the text + mediumFont setfont % Font + (Imageable Area) show % Show the text + + smallFont setfont % Font + pageWidth 14 mul % x = pageWidth * 3/16 * 72 + pageHeight 36 mul % y = pageWidth * 1/2 * 72 + pageHeight -2 mul add % y -= 2 * smallFont height + + % Page Size inches + 2 copy moveto % Move to x & y + (Page Size: ) RIGHT % Label + 100 pageWidth NUMBER % pageWidth + (x) show % "x" + 100 pageHeight NUMBER % pageHeight + (in) show % "in" + + % Page Size millimeters + pageHeight sub % Move down... + + 2 copy moveto % Move to x & y + 10 pageWidth 25.4 mul NUMBER % pageWidth + (x) show % "x" + 10 pageHeight 25.4 mul NUMBER % pageHeight + (mm) show % "mm" + + % Lower-left inches + pageHeight 2 mul sub % Move down... + + 2 copy moveto % Move to x & y + (Lower-Left: ) RIGHT % Label + 100 pageLeft NUMBER % pageLeft + (x) show % "x" + 100 pageBottom NUMBER % pageBottom + (in) show % "in" + + % Lower-left millimeters + pageHeight sub % Move down... + + 2 copy moveto % Move to x & y + 10 pageLeft 25.4 mul NUMBER % pageLeft + (x) show % "x" + 10 pageBottom 25.4 mul NUMBER % pageBottom + (mm) show % "mm" + + % Upper-right inches + pageHeight 2 mul sub % Move down... + + 2 copy moveto % Move to x & y + (Upper-Right: ) RIGHT % Label + 100 pageRight NUMBER % pageRight + (x) show % "x" + 100 pageTop NUMBER % pageTop + (in) show % "in" + + % Upper-right millimeters + pageHeight sub % Move down... + + 2 copy moveto % Move to x & y + 10 pageRight 25.4 mul NUMBER % pageRight + (x) show % "x" + 10 pageTop 25.4 mul NUMBER % pageTop + (mm) show % "mm" + + % Resolution dots-per-inch + pageHeight 2 mul sub % Move down... + + 2 copy moveto % Move to x & y + (Resolution: ) RIGHT % Label + 1 xResolution NUMBER % xResolution + (x) show % "x" + 1 yResolution NUMBER % yResolution + (dpi) show % "dpi" + + % Resolution dots-per-meter + pageHeight sub % Move down... + + moveto % Move to x & y + 1 xResolution 39.27 mul NUMBER % xResolution + (x) show % "x" + 1 yResolution 39.27 mul NUMBER % yResolution + (dpm) show % "dpm" + + % Interpreter Information... + pageHeight 15 mul % Height of interpreter information + + pageWidth 40.5 mul % x = pageWidth * 9/16 * 72 + pageHeight 35.5 mul % y = pageHeight * 1/2 * 72 + 2 index sub % y -= height + pageWidth 28 mul % width = pageWidth * 1/4 * 72 + 3 index % height + 0.5 setgray rectfill % Draw a shadow + + pageWidth 40 mul % x = pageWidth * 9/16 * 72 + pageHeight 36 mul % y = pageHeight * 1/2 * 72 + 2 index sub % y -= height + pageWidth 28 mul % width = pageWidth * 3/8 * 72 + 3 index % height + 4 copy 1 setgray rectfill % Clear the box to white + 0 setgray rectstroke % Draw a black box around it... + + pop % Discard height + + % Label the interpreter info... + pageWidth 40 mul % x = pageWidth * 9/16 * 72 + pageHeight 37 mul % y = pageHeight * 1/2 * 72 + moveto % Position the text + mediumFont setfont % Font + (Interpreter Information) show % Show the text + + smallFont setfont % Font + pageWidth 49 mul % x = pageWidth * 11/16 * 72 + pageHeight 36 mul % y = pageWidth * 1/2 * 72 + pageHeight 2 mul sub % y -= 2 * smallFont height + + % Language level + 2 copy moveto % Move to x & y + (PostScript: ) RIGHT % Label + (Level ) show % "Level " + 1 languagelevel NUMBER % Language level + + % Version + pageHeight 2 mul sub % Move down... + 2 copy moveto % Move to x & y + (Version: ) RIGHT % Label + version show % Version + ( \() show % " (" + 1 revision NUMBER % Revision + (\)) show % ")" + + % Product + pageHeight 2 mul sub % Move down... + 2 copy moveto % Move to x & y + (Product: ) RIGHT % Label + product show % Product name + + % Serial Number + pageHeight 2 mul sub % Move down... + moveto % Move to x & y + (Serial #: ) RIGHT % Label + 1 serialnumber NUMBER % S/N + + % Draw the label at the top... + pageWidth 36 mul % Center of page + pageHeight 66 mul % Top of page (11/12ths) + moveto % Position text + bigFont setfont % Font + (CUPS Printer Test Page) CENTER % Show text centered + + % Draw the copyright notice at the bottom... + pageWidth 17 mul % Center of page + pageHeight 9.5 mul % Bottom of page + moveto % Position text + (Printed with CUPS) show + + pageWidth 17 mul % Left side of page + pageHeight 7.5 mul % Move down... + 2 copy moveto % Position text + smallFont setfont % Font + (Copyright 2007-2009 Apple Inc., All Rights Reserved. CUPS and the CUPS logo are) show + pageHeight 2 add sub % Move down... + 2 copy moveto % Position text + (the trademark property of Apple Inc., 1 Infinite Loop, Cupertino, CA 95014, USA.) show + pageHeight 2 mul 4 add sub % Move down... + moveto % Position text + (Need help? Contact your operating system vendor or visit "http://www.cups.org/".) show + + % Then the CUPS logo.... + gsave + pageWidth 4 mul + pageHeight 4 mul + translate + pageWidth 15 mul CUPSLOGO + grestore + +% Show the page... +grestore +showpage +% +% End of "$Id: testprint.ps 8236 2009-01-13 17:27:16Z mike $". +% +%%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.18.17/src/Printer.ycp new/yast2-printer-2.18.18/src/Printer.ycp --- old/yast2-printer-2.18.17/src/Printer.ycp 2009-04-30 15:35:41.000000000 +0200 +++ new/yast2-printer-2.18.18/src/Printer.ycp 2009-07-17 13:57:14.000000000 +0200 @@ -1735,7 +1735,14 @@ // see https://bugzilla.novell.com/show_bug.cgi?id=395760 // and http://www.cups.org/str.php?L2848 if( "" != default_paper_size ) - { // The following command fails intentionally if the queue has no PPD file - i.e. when it is a "raw" queue + { // Since CUPS 1.4 there is a weird timing-effect regarding which defaults 'lpoptions -l' reports + // after the defaults have been changed directly after a new queue was set up + // see https://bugzilla.novell.com/show_bug.cgi?id=520642 + // and http://www.cups.org/str.php?L3264 + // Regardless of the DirtyCleanInterval setting it works when there is one second delay + // between a new queue was set up and before its defaults were changed: + sleep( 1000 ); + // The following command fails intentionally if the queue has no PPD file - i.e. when it is a "raw" queue // (a queue with a "System V style interface script" cannot be set up with YaST). // '\>' is used to find an available choice also when it is the last value on the line. // Note the YCP quoting: \\< becomes \< and \\> becomes \> in the commandline. 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.18.17/src/Printerlib.ycp new/yast2-printer-2.18.18/src/Printerlib.ycp --- old/yast2-printer-2.18.17/src/Printerlib.ycp 2009-04-30 15:35:41.000000000 +0200 +++ new/yast2-printer-2.18.18/src/Printerlib.ycp 2009-07-16 15:33:34.000000000 +0200 @@ -36,7 +36,7 @@ import "Package"; import "Popup"; import "Service"; -import "Map"; + // Fortunately the tools are for all architectures always // installed in /usr/lib/YaST2/bin/ (i.e. no "lib64"). // I tested this on Thu Aug 28 2008 using the command @@ -241,8 +241,10 @@ global boolean GetAndSetCupsdStatus( string new_status ) { // Determine whether or not a local cupsd is accessible. // The value 'false' is also the right one when the command itself fails - // (e.g. when there is no /usr/bin/lpstat binary or whatever broken stuff): - string local_cupsd_accessible_commandline = "/usr/bin/lpstat -h localhost -r"; + // (e.g. when there is no /usr/bin/lpstat binary or whatever broken stuff). + // Since CUPS 1.4 'lpstat -r' results true even when scheduler is not running. + // Therefore we must now grep in its output: + string local_cupsd_accessible_commandline = "/usr/bin/lpstat -h localhost -r | grep -q 'scheduler is running'"; local_cupsd_accessible = ExecuteBashCommand( local_cupsd_accessible_commandline ); // Start cupsd: if( "start" == new_status ) @@ -510,6 +512,83 @@ return true; } +// Up to CUPS 1.3 cupsd writes changes to config files immediately so that the updated files +// will be available after the corresponding command, function call, or IPP operation is completed. +// Since CUPS 1.4 the new DirtyCleanInterval directive controls the delay when cupsd updates config files, +// which defaults to 30 seconds. Setting it to 0 will have it write the changes on the next pass through +// the main run loop - less immediate than before, but still should be within a few milliseconds. +// To be on the safe side regarding "within a few milliseconds" (which could become much more +// depending on which processes the scheduler lets run - in particular cupsd versus yast2-printer) +// it sleeps in any case at least one second: +global boolean WaitForUpdatedConfigFiles( string popupheader ) +{ // By default there is no DirtyCleanInterval entry in /etc/cups/cupsd.conf + // and then the default delay until cupsd writes config files like printers.conf + // is 30 seconds which is also used here as fallback. + integer dirty_clean_interval = 30; + // Determine the DirtyCleanInterval value in /etc/cups/cupsd.conf: + if( ExecuteBashCommand( yast_bin_dir + "modify_cupsd_conf DirtyCleanInterval" ) ) + { // I must use "0123456789" here instead of Printer::number_chars because + // the latter would require 'import "Printer"' but Printer does already 'import "Printerlib"' + // and a cyclic import drives the YaST machinery mad (it collapses with "too many open files"): + string dirty_clean_interval_string = filterchars( result["stdout"]:"30", "0123456789" ); + if( "" != dirty_clean_interval_string + && nil != tointeger( dirty_clean_interval_string ) + ) + { dirty_clean_interval = tointeger( dirty_clean_interval_string ); + } + // Use fallback value when there is no DirtyCleanInterval entry or + // when the DirtyCleanInterval value cannot be converted to an integer. + } + // Use fallback cupsd_conf_dirty_clean_interval value when the command above failed. + y2milestone( "Waiting DirtyCleanInterval='%1'+1 seconds for updated config files.", dirty_clean_interval ); + if( dirty_clean_interval < 1 ) + { // Even in case if "immediate" update of the config files + // be on the safe side and sleep one second but without user notification: + sleep( 1000 ); + return true; + } + if( dirty_clean_interval < 31 ) + { // If 1 <= dirty_clean_interval <= 30 (30 is the default and fallback value) + // do not let the user interrupt the waiting for updated config files. + // To be on the safe side sleep one second longer than the dirty_clean_interval: + Popup::ShowFeedback( popupheader, + sformat( // Message of a Popup::ShowFeedback where %1 will be replaced + // by the number of seconds how long it takes. + // The number of seconds is always greater or equal than 2 + // so that it is always the plural "seconds" here: + _("It takes %1 seconds until the config files are updated..."), + dirty_clean_interval + 1 + ) + ); + sleep( ( 1000 * dirty_clean_interval ) + 1000 ); + Popup::ClearFeedback(); + return true; + } + // If dirty_clean_interval > 30 let the user interrupt the waiting for updated config files + // and return true if the user did not interrupt the waiting for updated config files + // but return false if the user interrupted the waiting for updated config files. + // To be on the safe side sleep one second longer than the dirty_clean_interval. + // Only Popup::TimedAnyQuestion and Popup::TimedOKCancel return a non-void value + // but neither of them return false if the user interrupted the waiting + // because both of them return true if the user interrupted via the 'Yes' or 'OK' button + // so that both are useless to determine if the user interrupted the waiting + // and therefore I return depending on calculating the waiting time directly + // by calling time() which returns the number of seconds since 1.1.1970: + integer time_before = time(); + Popup::TimedMessage( // Message of a Popup::TimedMessage: + popupheader + "\n\n" + _("Waiting until the config files are updated..."), + dirty_clean_interval + 1 + ); + integer waiting_time = time() - time_before; + if( waiting_time < dirty_clean_interval ) + { // To avoid needless error popups be on the safe side and return false only + // when the waiting_time is strictly less than the dirty_clean_interval: + return false; + } + return true; +} + + 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))); @@ -517,7 +596,6 @@ 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))); 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.18.17/src/basicadd.ycp new/yast2-printer-2.18.18/src/basicadd.ycp --- old/yast2-printer-2.18.17/src/basicadd.ycp 2009-04-30 15:35:41.000000000 +0200 +++ new/yast2-printer-2.18.18/src/basicadd.ycp 2009-07-16 15:38:42.000000000 +0200 @@ -310,6 +310,17 @@ // After a local queue was added, enforce to show also local queues // in particular when no local queues were shown before: Printer::queue_filter_show_local = true; + // Since CUPS 1.4 the new DirtyCleanInterval directive controls the delay when cupsd updates config files: + if( ! Printerlib::WaitForUpdatedConfigFiles( _("Created New Printer Setup") ) ) + { // It returns false if the user had interrupted the waiting for updated config files: + Popup::ErrorDetails( // Message of a Popup::ErrorDetails: + _("New Printer Configuration not yet Stored in the System"), + // Explanation details of a Popup::ErrorDetails. + // The 'next dialog' is the overview dialog where the printer configurations are shown + // which has a 'Refresh List' button to update the shown printer configurations: + _("If the next dialog does not show the new printer configuration as expected, wait some time and use the 'Refresh List' button.") + ); + } Wizard::EnableBackButton(); Wizard::EnableNextButton(); // Exit this dialog in any case: 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.18.17/src/basicmodify.ycp new/yast2-printer-2.18.18/src/basicmodify.ycp --- old/yast2-printer-2.18.17/src/basicmodify.ycp 2009-04-30 15:35:41.000000000 +0200 +++ new/yast2-printer-2.18.18/src/basicmodify.ycp 2009-07-16 14:13:57.000000000 +0200 @@ -604,6 +604,17 @@ } } } + // Since CUPS 1.4 the new DirtyCleanInterval directive controls the delay when cupsd updates config files: + if( ! Printerlib::WaitForUpdatedConfigFiles( _("Modified Printer Setup") ) ) + { // It returns false if the user had interrupted the waiting for updated config files: + Popup::WarningDetails( // Message of a Popup::WarningDetails. + _("Modified Printer Configuration not yet Stored in the System"), + // Explanation details of a Popup::WarningDetails. + // The 'next dialog' is the overview dialog where the printer configurations are shown + // which has a 'Refresh List' button to update the shown printer configurations: + _("If the next dialog does not show the expected modifications, wait some time and use the 'Refresh List' button.") + ); + } Wizard::EnableBackButton(); Wizard::EnableNextButton(); } 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.18.17/src/overview.ycp new/yast2-printer-2.18.18/src/overview.ycp --- old/yast2-printer-2.18.17/src/overview.ycp 2009-04-30 15:35:41.000000000 +0200 +++ new/yast2-printer-2.18.18/src/overview.ycp 2009-07-09 15:36:03.000000000 +0200 @@ -483,14 +483,29 @@ } string testprint_job_title = "YaST2testprint_" + queue_name; // Do not enforce to talk to the cupsd on localhost when submiting the testpage - // because testpage printing must also work for a "client-only" config: + // because testpage printing must also work for a "client-only" config. + // Since CUPS 1.4 there is no longer a readymade PostScript testpage in CUPS, see + // https://bugzilla.novell.com/show_bug.cgi?id=520617 + // Therefore a slightly modified CUPS 1.3.10 testprint.ps was added + // to yast2-printer as /usr/share/YaST2/data/testprint.ps + // The following modifications + // --- cups-1.3.10/data/testprint.ps 2009-01-13 18:27:16.000000000 +0100 + // +++ data/testprint.ps 2009-07-09 15:25:26.000000000 +0200 + // @@ -564 +564 @@ + // - (Printer Test Page) CENTER % Show text centered + // + (CUPS Printer Test Page) CENTER % Show text centered + // @@ -570 +570 @@ + // - (Printed with CUPS v1.3.x) show + // + (Printed with CUPS) show + // make it obvious that it is not a YaST testpage but a CUPS testpage + // and it is now independent of the CUPS version. if( ! Printerlib::ExecuteBashCommand( "/usr/bin/lp -d '" + queue_name + "' -t '" + testprint_job_title + "' -o page-label=\"" + queue_name - + ":YaST2testprint@$(hostname)\" /usr/share/cups/data/testprint.ps" + + ":YaST2testprint@$(hostname)\" /usr/share/YaST2/data/testprint.ps" ) ) { Popup::ErrorDetails( sformat( // Message of a Popup::ErrorDetails 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.18.17/src/printer.rnc new/yast2-printer-2.18.18/src/printer.rnc --- old/yast2-printer-2.18.17/src/printer.rnc 2009-04-30 15:35:41.000000000 +0200 +++ new/yast2-printer-2.18.18/src/printer.rnc 2009-07-09 14:11:28.000000000 +0200 @@ -2,15 +2,34 @@ namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" namespace config = "http://www.suse.com/1.0/configns" -printer = - element printer { - (text - | printer_default - | printcap - | cups_installation - | server_hostname - | spooler)* - } +# +# 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* + }? +} + + +# 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 = 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.18.17/tools/autodetect_print_queues new/yast2-printer-2.18.18/tools/autodetect_print_queues --- old/yast2-printer-2.18.17/tools/autodetect_print_queues 2009-06-02 16:28:54.000000000 +0200 +++ new/yast2-printer-2.18.18/tools/autodetect_print_queues 2009-07-16 11:44:06.000000000 +0200 @@ -38,7 +38,9 @@ if test -z "$SERVERNAME" then SERVERNAME="localhost" fi -if ! $LPSTAT -h $SERVERNAME -r &>/dev/null +# Since CUPS 1.4 'lpstat -r' results true even when scheduler is not running. +# Therefore we must now grep in its output: +if $LPSTAT -h $SERVERNAME -r | grep -q 'scheduler is not running' then echo "Cannot access cupsd on '$SERVERNAME'" 1>&2 exit 2 fi @@ -125,7 +127,7 @@ # a local queue (in /etc/cups/printers.conf) and a remote queue (on another host) and # therefore /etc/cups/printers.conf is directly inspected to distinguish local and remote queues. # Reason: -# In the CUPS sources systemv/lpstat.c uses CUPS_PRINTER_REMOTE to distinguish between +# In the CUPS sources systemv/lpstat.c uses only CUPS_PRINTER_REMOTE to distinguish between # its output "Connection: remote" and "Connection: direct". # But the new support for "hard-wired" remote printers has muddied the waters: # CUPS_PRINTER_REMOTE means that the printer is hosted (does filtering) on a remote system. @@ -133,13 +135,12 @@ # If both bits are set, then the queue is a traditional CUPS browsing remote printer. # If CUPS_PRINTER_DISCOVERED is not set, it is a local queue but filtering happens remote. # Summary table: -# Type CUPS_PRINTER_RREMOTE CUPS_PRINTER_DISCOVERED -# --------------------- -------------------- ----------------------- -# Local queue No No -# CUPS-browsing printer Yes Yes -# Raw IPP queue Yes No -# Bonjour queue Yes No - +# Type CUPS_PRINTER_RREMOTE CUPS_PRINTER_DISCOVERED exists in printers.conf +# --------------------- -------------------- ----------------------- ----------------------- +# Local queue No No Yes +# CUPS-browsing printer Yes Yes No +# Raw IPP queue Yes No Yes +# Bonjour queue Yes No (I don't know) exec <$TMP_DATA while read KEY VALUE do case "$KEY" in 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.18.17/tools/autodetect_printers new/yast2-printer-2.18.18/tools/autodetect_printers --- old/yast2-printer-2.18.17/tools/autodetect_printers 2009-04-30 15:35:38.000000000 +0200 +++ new/yast2-printer-2.18.18/tools/autodetect_printers 2009-07-09 14:15:51.000000000 +0200 @@ -36,7 +36,9 @@ # CUPS supports even remote queue setup but this is not supported by YaST. # Therefore explicitely the cupsd on localhost is asked for autodetected printer information. echo 'Testing if cupsd on localhost is accessible...' >>$PROGRESS -if ! $LPSTAT -h localhost -r &>/dev/null +# Since CUPS 1.4 'lpstat -r' results true even when scheduler is not running. +# Therefore we must now grep in its output: +if $LPSTAT -h localhost -r | grep -q 'scheduler is not running' then echo "Cannot access cupsd on localhost" 1>&2 exit 2 fi 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.18.17/tools/create_printer_ppd_database new/yast2-printer-2.18.18/tools/create_printer_ppd_database --- old/yast2-printer-2.18.17/tools/create_printer_ppd_database 2009-04-30 15:35:38.000000000 +0200 +++ new/yast2-printer-2.18.18/tools/create_printer_ppd_database 2009-07-09 14:16:20.000000000 +0200 @@ -36,7 +36,9 @@ # CUPS supports even remote queue setup but this is not supported by YaST. # Therefore explicitely the cupsd on localhost is asked for printer driver information. echo 'Testing if cupsd on localhost is accessible...' >>$PROGRESS -if ! $LPSTAT -h localhost -r &>/dev/null +# Since CUPS 1.4 'lpstat -r' results true even when scheduler is not running. +# Therefore we must now grep in its output: +if $LPSTAT -h localhost -r | grep -q 'scheduler is not running' then echo "Cannot access cupsd on localhost" 1>&2 exit 2 fi 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.18.17/tools/determine_printer_driver_options new/yast2-printer-2.18.18/tools/determine_printer_driver_options --- old/yast2-printer-2.18.17/tools/determine_printer_driver_options 2009-06-02 15:41:35.000000000 +0200 +++ new/yast2-printer-2.18.18/tools/determine_printer_driver_options 2009-07-09 14:16:45.000000000 +0200 @@ -34,7 +34,9 @@ # Only on localhost print queue settings should be changed. # CUPS supports to modify even remote queues but this is not supported by YaST. # Therefore explicitely the cupsd on localhost is asked for printer driver options. -if ! $LPSTAT -h localhost -r &>/dev/null +# Since CUPS 1.4 'lpstat -r' results true even when scheduler is not running. +# Therefore we must now grep in its output: +if $LPSTAT -h localhost -r | grep -q 'scheduler is not running' then echo "Cannot access cupsd on localhost" 1>&2 exit 2 fi 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.18.17/tools/modify_cupsd_conf new/yast2-printer-2.18.18/tools/modify_cupsd_conf --- old/yast2-printer-2.18.17/tools/modify_cupsd_conf 2009-04-30 15:35:38.000000000 +0200 +++ new/yast2-printer-2.18.18/tools/modify_cupsd_conf 2009-07-15 14:54:59.000000000 +0200 @@ -40,6 +40,9 @@ echo " (The policy-name must exist as a '<Policy policy-name>' section)" 1>&2 echo "ErrorPolicy [ stop-printer | retry-job | abort-job ]" 1>&2 echo " (if ErrorPolicy is not set, stop-printer is the CUPS default)" 1>&2 + echo "DirtyCleanInterval [ seconds ] (since CUPS 1.4)" 1>&2 + echo "e.g.: DirtyCleanInterval 30 (default 30 seconds delay until cupsd writes config files)" 1>&2 + echo " DirtyCleanInterval 0 (update config files like printers.conf almost immediately)" 1>&2 echo "For the syntax for keywords and values see 'man cupsd.conf'" 1>&2 echo "and http://www.cups.org/documentation.php/ref-cupsd-conf.html" 1>&2 echo "In case of ambiguity use the syntax which is described above." 1>&2 @@ -83,15 +86,22 @@ then # Try to substitute an existing active Browsing line (ignore case). # (If there is more than one active Browsing line it is a broken config file): sed -i -e "s/^[[:space:]]*$KEY.*/$KEY $VALUE/i" $CUPSDCONF - # There may exist no Browsing line: + # There may exist no Browsing line or the above substitute may have failed + # (therefore it tests not only for "^$KEY" but for "^$KEY $VALUE$"): if ! grep -q "^$KEY $VALUE$" $CUPSDCONF then # Append a Browsing line below the last active 'Brows' line (ignore case) # to have the new Browsing line at the matching place - # but if no 'Brows' line exists, append at the end of the file: + # but if no 'Brows' line exists, append below the first empty line + # which is usually the line after the initial comment block + # and if even no empty line exists, append at the end of the file: LAST_BROWSE_LINE_NUMBER="$( sed -n -e '/^[^#]*Brows/I=' $CUPSDCONF | tail -n 1 )" if test -n "$LAST_BROWSE_LINE_NUMBER" then sed -i -e "${LAST_BROWSE_LINE_NUMBER}a$KEY $VALUE" $CUPSDCONF - else echo -en "\n$KEY $VALUE\n\n" >>$CUPSDCONF + else FIRST_EMPTY_LINE_NUMBER="$( sed -n -e '/^[[:space:]]*$/=' $CUPSDCONF | head -n 1 )" + if test -n "$FIRST_EMPTY_LINE_NUMBER" + then sed -i -e "${FIRST_EMPTY_LINE_NUMBER}a$KEY $VALUE\n" $CUPSDCONF + else echo -en "\n$KEY $VALUE\n\n" >>$CUPSDCONF + fi fi fi fi @@ -123,11 +133,17 @@ sed -i -e '/^[[:space:]]*BrowseOrder.*/Id' $CUPSDCONF # Append the new BrowseOrder line below the last active 'Brows' line (ignore case) # to have the new BrowseOrder line at the matching place - # but if no 'Brows' line exists, append at the end of the file: + # but if no 'Brows' line exists, append below the first empty line + # which is usually the line after the initial comment block + # and if even no empty line exists, append at the end of the file: LAST_BROWSE_LINE_NUMBER="$( sed -n -e '/^[^#]*Brows/I=' $CUPSDCONF | tail -n 1 )" if test -n "$LAST_BROWSE_LINE_NUMBER" then sed -i -e "${LAST_BROWSE_LINE_NUMBER}aBrowseOrder allow,deny" $CUPSDCONF - else echo -en "\nBrowseOrder allow,deny\n\n" >>$CUPSDCONF + else FIRST_EMPTY_LINE_NUMBER="$( sed -n -e '/^[[:space:]]*$/=' $CUPSDCONF | head -n 1 )" + if test -n "$FIRST_EMPTY_LINE_NUMBER" + then sed -i -e "${FIRST_EMPTY_LINE_NUMBER}aBrowseOrder allow,deny\n" $CUPSDCONF + else echo -en "\nBrowseOrder allow,deny\n\n" >>$CUPSDCONF + fi fi # All existing active BrowseAllow lines are removed (ignore case). # Those lines can be removed because YaST supports BrowseAllow lines @@ -188,10 +204,16 @@ # Insert the mandatory 'Listen localhost' line (see http://www.cups.org/str.php?L2834 # "What is *not* supported is a configuration where only a domain socket is enabled") # to have the new Listen line where the first active Listen line was - # but if no 'Listen' line exists, append at the end of the file: + # but if no 'Listen' line exists, append below the first empty line + # which is usually the line after the initial comment block + # and if even no empty line exists, append at the end of the file: if test -n "$FIRST_LISTEN_LINE_NUMBER" then sed -i -e "${FIRST_LISTEN_LINE_NUMBER}iListen localhost:631" $CUPSDCONF - else echo -en "\nListen localhost:631\n\n" >>$CUPSDCONF + else FIRST_EMPTY_LINE_NUMBER="$( sed -n -e '/^[[:space:]]*$/=' $CUPSDCONF | head -n 1 )" + if test -n "$FIRST_EMPTY_LINE_NUMBER" + then sed -i -e "${FIRST_EMPTY_LINE_NUMBER}iListen localhost:631\n" $CUPSDCONF + else echo -en "\nListen localhost:631\n\n" >>$CUPSDCONF + fi fi # Append a Listen line for the domain socket (if such a line was there): if test -n "$LISTEN_DOMAIN_SOCKET_LINE_CONTENT" @@ -254,10 +276,16 @@ # Set 'Order allow,deny' in the root location to deny packets by default # and then allow them from certain sources via Allow entries # and finally deny from certain sources via Deny entries. - # but if no root location was there, append at the end of the file: + # If no root location was there, append it below the first empty line + # which is usually the line after the initial comment block + # and if even no empty line exists, append at the end of the file: if test -n "$ROOT_LOCATION_LINE_NUMBER" then sed -i -e "${ROOT_LOCATION_LINE_NUMBER}i<Location />\nOrder allow,deny\nAllow 127.0.0.2\n</Location>" $CUPSDCONF - else echo -en "\n<Location />\nOrder allow,deny\nAllow 127.0.0.2\n</Location>\n\n" >>$CUPSDCONF + else FIRST_EMPTY_LINE_NUMBER="$( sed -n -e '/^[[:space:]]*$/=' $CUPSDCONF | head -n 1 )" + if test -n "$FIRST_EMPTY_LINE_NUMBER" + then sed -i -e "${FIRST_EMPTY_LINE_NUMBER}a<Location />\nOrder allow,deny\nAllow 127.0.0.2\n</Location>\n" $CUPSDCONF + else echo -en "\n<Location />\nOrder allow,deny\nAllow 127.0.0.2\n</Location>\n\n" >>$CUPSDCONF + fi fi # Determine (again) where the new root location starts (exact match): ROOT_LOCATION_LINE_NUMBER="$( sed -n -e '/<Location \/>/=' $CUPSDCONF | head -n 1 )" @@ -314,13 +342,23 @@ if ! test "none" = "$VALUE" then # Append the new BrowseAddress lines below the last active 'Brows' line (ignore case) # to have the new BrowseAddress lines at the matching place - # but if no 'Brows' line exists, append at the end of the file. + # but if no 'Brows' line exists, append below the first empty line + # which is usually the line after the initial comment block + # and if even no empty line exists, append at the end of the file. # Invert the ordering of the values to get the lines # in the original ordering of the values (needed for the test below): LAST_BROWSE_LINE_NUMBER="$( sed -n -e '/^[^#]*Brows/I=' $CUPSDCONF | tail -n 1 )" + FIRST_EMPTY_LINE_NUMBER="$( sed -n -e '/^[[:space:]]*$/=' $CUPSDCONF | head -n 1 )" + APPEND_LINE_NUMBER="" + if test -n "$LAST_BROWSE_LINE_NUMBER" + then APPEND_LINE_NUMBER="$LAST_BROWSE_LINE_NUMBER" + fi + if test -n "$FIRST_EMPTY_LINE_NUMBER" + then APPEND_LINE_NUMBER="$FIRST_EMPTY_LINE_NUMBER" + fi for V in $( echo "$VALUE" | tac -s ' ' ) - do if test -n "$LAST_BROWSE_LINE_NUMBER" - then test -n "$V" && sed -i -e "${LAST_BROWSE_LINE_NUMBER}a$KEY $V" $CUPSDCONF + do if test -n "$APPEND_LINE_NUMBER" + then test -n "$V" && sed -i -e "${APPEND_LINE_NUMBER}a$KEY $V" $CUPSDCONF else test -n "$V" && echo -en "\n$KEY $V\n" >>$CUPSDCONF fi done @@ -368,16 +406,23 @@ then # Try to substitute an existing active DefaultPolicy line (ignore case). # (If there is more than one active DefaultPolicy line it is a broken config file): sed -i -e "s/^[[:space:]]*$KEY.*/$KEY $VALUE/i" $CUPSDCONF - # There may exist no DefaultPolicy line: + # There may exist no DefaultPolicy line or the above substitute may have failed + # (therefore it tests not only for "^$KEY" but for "^$KEY $VALUE$"): if ! grep -q "^$KEY $VALUE$" $CUPSDCONF then # Append a DefaultPolicy line below the last active 'Policy' line # which is usually a '</Policy>' or a 'ErrorPolicy' line (ignore case) # to have the new DefaultPolicy line at the matching place - # but if no 'Policy' line exists, append at the end of the file: + # but if no 'Policy' line exists, append below the first empty line + # which is usually the line after the initial comment block + # and if even no empty line exists, append at the end of the file: LAST_POLICY_LINE_NUMBER="$( sed -n -e '/^[^#]*Policy/I=' $CUPSDCONF | tail -n 1 )" if test -n "$LAST_POLICY_LINE_NUMBER" then sed -i -e "${LAST_POLICY_LINE_NUMBER}a$KEY $VALUE" $CUPSDCONF - else echo -en "\n$KEY $VALUE\n\n" >>$CUPSDCONF + else FIRST_EMPTY_LINE_NUMBER="$( sed -n -e '/^[[:space:]]*$/=' $CUPSDCONF | head -n 1 )" + if test -n "$FIRST_EMPTY_LINE_NUMBER" + then sed -i -e "${FIRST_EMPTY_LINE_NUMBER}a$KEY $VALUE\n" $CUPSDCONF + else echo -en "\n$KEY $VALUE\n\n" >>$CUPSDCONF + fi fi fi fi @@ -405,16 +450,23 @@ then # Try to substitute an existing active ErrorPolicy line (ignore case). # (If there is more than one active ErrorPolicy line it is a broken config file): sed -i -e "s/^[[:space:]]*$KEY.*/$KEY $VALUE/i" $CUPSDCONF - # There may exist no ErrorPolicy line: + # There may exist no ErrorPolicy line or the above substitute may have failed + # (therefore it tests not only for "^$KEY" but for "^$KEY $VALUE$"): if ! grep -q "^$KEY $VALUE$" $CUPSDCONF then # Append a ErrorPolicy line below the last active 'Policy' line # which is usually a '</Policy>' or a 'DefaultPolicy' line (ignore case) # to have the new ErrorPolicy line at the matching place - # but if no 'Policy' line exists, append at the end of the file: + # but if no 'Policy' line exists, append below the first empty line + # which is usually the line after the initial comment block + # and if even no empty line exists, append at the end of the file: LAST_POLICY_LINE_NUMBER="$( sed -n -e '/^[^#]*Policy/I=' $CUPSDCONF | tail -n 1 )" if test -n "$LAST_POLICY_LINE_NUMBER" then sed -i -e "${LAST_POLICY_LINE_NUMBER}a$KEY $VALUE" $CUPSDCONF - else echo -en "\n$KEY $VALUE\n\n" >>$CUPSDCONF + else FIRST_EMPTY_LINE_NUMBER="$( sed -n -e '/^[[:space:]]*$/=' $CUPSDCONF | head -n 1 )" + if test -n "$FIRST_EMPTY_LINE_NUMBER" + then sed -i -e "${FIRST_EMPTY_LINE_NUMBER}a$KEY $VALUE\n" $CUPSDCONF + else echo -en "\n$KEY $VALUE\n\n" >>$CUPSDCONF + fi fi fi fi @@ -436,6 +488,43 @@ fi } +# Function to deal with 'DirtyCleanInterval [ seconds ]' +DirtyCleanInterval() +{ if test -n "$VALUE" + then # Try to substitute an existing active DirtyCleanInterval line (ignore case). + # (If there is more than one active DirtyCleanInterval line it is a broken config file): + sed -i -e "s/^[[:space:]]*$KEY.*/$KEY $VALUE/i" $CUPSDCONF + # There may exist no DirtyCleanInterval line or the above substitute may have failed + # (therefore it tests not only for "^$KEY" but for "^$KEY $VALUE$"): + if ! grep -q "^$KEY $VALUE$" $CUPSDCONF + then # Append a DirtyCleanInterval line below the first empty line + # which is usually the line after the initial comment block + # but if no empty line exists, append at the end of the file: + FIRST_EMPTY_LINE_NUMBER="$( sed -n -e '/^[[:space:]]*$/=' $CUPSDCONF | head -n 1 )" + if test -n "$FIRST_EMPTY_LINE_NUMBER" + then sed -i -e "${FIRST_EMPTY_LINE_NUMBER}a$KEY $VALUE\n" $CUPSDCONF + else echo -en "\n$KEY $VALUE\n\n" >>$CUPSDCONF + fi + fi + fi + # Report the resulting setting in any case: + # The 'tr ... [:blank:]' makes sure that all active DirtyCleanInterval entries + # are found if there is more than one which is a broken config. + # Remove leading spaces (to cut the right part). + # Remove trailing spaces (needed for the test below). + RESULT="$( grep -i "^[[:space:]]*$KEY[[:space:]]" $CUPSDCONF | 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 + # or an error message because of a failed test below) on a new line: + echo 1>&2 + # Test if the result is the expected one if a value was specified: + if test -n "$VALUE" -a "$RESULT" != "$VALUE" + then echo "Failed to set '$KEY $VALUE' in $CUPSDCONF." 1>&2 + exit 5 + fi +} + case "$KEY" in Browsing) Browsing;; BrowseAllow) BrowseAllow;; @@ -445,6 +534,7 @@ Policies) Policies;; DefaultPolicy) DefaultPolicy;; ErrorPolicy) ErrorPolicy;; + DirtyCleanInterval) DirtyCleanInterval;; *) echo "Ignoring keyword '$KEY'" 1>&2 exit 4 ;; esac ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de