rpms/hal-cups-utils/devel hal-cups-utils-no-compare-queue-name.patch, NONE, 1.1 hal-cups-utils.spec, 1.67, 1.68

Tim Waugh (twaugh) fedora-extras-commits at redhat.com
Fri Apr 4 16:49:41 UTC 2008


Author: twaugh

Update of /cvs/pkgs/rpms/hal-cups-utils/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv629

Modified Files:
	hal-cups-utils.spec 
Added Files:
	hal-cups-utils-no-compare-queue-name.patch 
Log Message:
* Fri Apr  4 2008 Tim Waugh <twaugh at redhat.com> 0.6.16-2
- Applied patch from upstream to use only the device URI to see if the
  printer has been configured already, and to make the queue name unique.


hal-cups-utils-no-compare-queue-name.patch:

--- NEW FILE hal-cups-utils-no-compare-queue-name.patch ---
diff -U0 hal-cups-utils-0.6.16/ChangeLog.no-compare-queue-name hal-cups-utils-0.6.16/ChangeLog
--- hal-cups-utils-0.6.16/ChangeLog.no-compare-queue-name	2008-03-25 12:30:03.000000000 +0000
+++ hal-cups-utils-0.6.16/ChangeLog	2008-04-04 17:47:05.000000000 +0100
@@ -0,0 +1,7 @@
+2008-04-04  Tim Waugh  <twaugh at redhat.com>
+
+	* systemv/hal_lpadmin (HalPrinter.add): Don't compare queue names
+	to find out if this device already has a queue configured, just
+	URIs.
+	(HalPrinter.add): Make the name unique.
+
diff -up hal-cups-utils-0.6.16/systemv/hal_lpadmin.no-compare-queue-name hal-cups-utils-0.6.16/systemv/hal_lpadmin
--- hal-cups-utils-0.6.16/systemv/hal_lpadmin.no-compare-queue-name	2008-03-25 12:30:03.000000000 +0000
+++ hal-cups-utils-0.6.16/systemv/hal_lpadmin	2008-04-04 17:47:05.000000000 +0100
@@ -213,8 +213,8 @@ class HalPrinter:
         p = None
         for name, printer in printers.iteritems():
             if printer.is_class: continue
-            if (name == self.name or
-                printer.device_uri in uris):
+            if printer.device_uri in uris:
+                printer_exists = 1
                 syslog (LOG_DEBUG,
                         "Not adding printer: %s already exists" % name)
                 printer_exists = 1
@@ -249,6 +249,15 @@ class HalPrinter:
                                 "Fax printer %s exists but is disabled, reason: %s; "
                                 "use 'cupsenable %s' to enable it" % (name, statemsg, name))
 
+        # Make the name unique.
+        if self.name in printers.keys ():
+            suffix = 2
+            while (self.name + str (suffix)) in printers.keys ():
+                suffix += 1
+                if suffix == 100:
+                    break
+            self.name += str (suffix)
+
         def wait_child (sig, stack):
             (pid, status) = os.wait ()
 


Index: hal-cups-utils.spec
===================================================================
RCS file: /cvs/pkgs/rpms/hal-cups-utils/devel/hal-cups-utils.spec,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -r1.67 -r1.68
--- hal-cups-utils.spec	25 Mar 2008 12:31:58 -0000	1.67
+++ hal-cups-utils.spec	4 Apr 2008 16:49:01 -0000	1.68
@@ -1,11 +1,12 @@
 Summary: Halified CUPS utilities 
 Name: hal-cups-utils
 Version: 0.6.16
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: GPLv2
 Group: Applications/System
 Source: %{name}-%{version}.tar.gz
 Source1: cups-config-daemon
+Patch1: hal-cups-utils-no-compare-queue-name.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: glib2-devel
 BuildRequires: dbus-devel >= 0.60
@@ -27,6 +28,7 @@
 rm -rf $RPM_BUILD_ROOT
 
 %setup -q
+%patch1 -p1 -b .no-compare-queue-name
 
 %build
 
@@ -58,6 +60,10 @@
 %{_initrddir}/cups-config-daemon
 
 %changelog
+* Fri Apr  4 2008 Tim Waugh <twaugh at redhat.com> 0.6.16-2
+- Applied patch from upstream to use only the device URI to see if the
+  printer has been configured already, and to make the queue name unique.
+
 * Tue Mar 25 2008 Tim Waugh <twaugh at redhat.com> 0.6.16-1
 - 0.6.16:
   - Some bugs concerning automatic printer enabling/disabling have been




More information about the fedora-extras-commits mailing list