Hello community,
here is the log from the commit of package gnome-cups-manager
checked in at Fri Apr 7 16:47:21 CEST 2006.
--------
--- GNOME/gnome-cups-manager/gnome-cups-manager.changes 2006-04-03 22:41:33.000000000 +0200
+++ gnome-cups-manager/gnome-cups-manager.changes 2006-04-06 18:53:50.000000000 +0200
@@ -1,0 +2,11 @@
+Thu Apr 6 18:48:45 CEST 2006 - fejj@suse.de
+
+- Added autodetect-usb-printers.patch - needed to work around the
+ fact that CUPS is a piece of crap and doesn't detect newly
+ plugged-in usb printers without a restart of the daemon. This
+ patch is needed so that available usb printers appear in the
+ gnome-cups-add printer list (since we are dropping hal because
+ yast2's printer wizard breaks if the user configures some
+ printers via yast2 and some via GNOME).
+
+-------------------------------------------------------------------
New:
----
autodetect-usb-printers.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ gnome-cups-manager.spec ++++++
--- /var/tmp/diff_new_pack.NYpxp8/_old 2006-04-07 16:46:58.000000000 +0200
+++ /var/tmp/diff_new_pack.NYpxp8/_new 2006-04-07 16:46:58.000000000 +0200
@@ -13,7 +13,7 @@
Name: gnome-cups-manager
BuildRequires: cups cups-devel gcc-c++ gnome-common gnutls-devel intltool krb5-devel libglade2-devel libgnomecups-devel libgnomeprintui-devel libgnomeui-devel libsmbclient libsmbclient-devel libwnck-devel mDNSResponder-devel perl-XML-Parser update-desktop-files
Version: 0.32cvs20060120
-Release: 21
+Release: 23
URL: http://www.gnome.org/
Group: System/GUI/GNOME
License: GPL
@@ -25,6 +25,7 @@
Patch1: popt-fix.patch
Patch2: only-once.patch
Patch3: smb-uri-parser-fix.patch
+Patch4: autodetect-usb-printers.patch
Autoreqprov: on
Requires: gnome-icon-theme cups-backends
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -50,6 +51,7 @@
%patch1 -p1
%patch2 -p0
%patch3 -p0
+%patch4 -p1
%build
rename no nb po/no.*
@@ -102,6 +104,14 @@
/opt/gnome/include/libgnomecups-1/libgnomecups/*
%changelog -n gnome-cups-manager
+* Thu Apr 06 2006 - fejj@suse.de
+- Added autodetect-usb-printers.patch - needed to work around the
+ fact that CUPS is a piece of crap and doesn't detect newly
+ plugged-in usb printers without a restart of the daemon. This
+ patch is needed so that available usb printers appear in the
+ gnome-cups-add printer list (since we are dropping hal because
+ yast2's printer wizard breaks if the user configures some
+ printers via yast2 and some via GNOME).
* Mon Apr 03 2006 - joeshaw@suse.de
- Fix "quarter" typo in the US letter test page. (bnc #9535)
* Thu Mar 30 2006 - fejj@suse.de
++++++ autodetect-usb-printers.patch ++++++
diff -ur gnome-cups-manager-0.32cvs20060120.orig/libgnomecups/gnome-cups-ui-connection.c gnome-cups-manager-0.32cvs20060120/libgnomecups/gnome-cups-ui-connection.c
--- gnome-cups-manager-0.32cvs20060120.orig/libgnomecups/gnome-cups-ui-connection.c 2006-04-06 12:44:23.000000000 -0400
+++ gnome-cups-manager-0.32cvs20060120/libgnomecups/gnome-cups-ui-connection.c 2006-04-06 12:45:05.000000000 -0400
@@ -38,6 +38,7 @@
#include
#include
#include
+#include
#include "snmpinter.h"
#include
@@ -316,13 +317,16 @@
}
static GSList *
-get_hal_devices (void)
+get_cups_backend_devices (const char *backend)
{
- char *argv[2], *stdout, *inptr;
+ char *argv[2], *path, *stdout, *inptr;
LocalPrinter *desc;
GSList *ret = NULL;
- argv[0] = CUPS_BACKENDS_DIR G_DIR_SEPARATOR_S "hal";
+ path = g_alloca (sizeof (CUPS_BACKENDS_DIR) + sizeof (G_DIR_SEPARATOR_S) + strlen (backend) + 1);
+ sprintf (path, "%s%s%s", CUPS_BACKENDS_DIR, G_DIR_SEPARATOR_S, backend);
+
+ argv[0] = path;
argv[1] = NULL;
if (!g_spawn_sync (NULL, argv, NULL, G_SPAWN_STDERR_TO_DEV_NULL,
@@ -331,8 +335,12 @@
inptr = stdout;
while ((desc = parse_cups_backend_device_list (&inptr))) {
- if (!strcmp (desc->uri, "hal")) {
- /* this means there are no hal printers - this is just a dummy device */
+ if (!strcmp (backend, "hal") && !strcmp (desc->uri, "hal")) {
+ /* this is just a dummy hal printer device, no more real detected printers after this */
+ local_printer_free (desc);
+ break;
+ } else if (!strcmp (backend, "usb") && !strncmp (desc->uri, "usb:/dev", 8)) {
+ /* this is just a dummy usb printer device, no more real detected printers after this */
local_printer_free (desc);
break;
}
@@ -349,13 +357,23 @@
get_local_devices (void)
{
ipp_t *request, *response;
- GHashTable *hal_devices;
+ GHashTable *device_hash;
GSList *devices, *l;
- l = devices = get_hal_devices ();
- hal_devices = g_hash_table_new (g_str_hash, g_str_equal);
+ device_hash = g_hash_table_new (g_str_hash, g_str_equal);
+
+ /* NOTE: direct querying of the CUPS backends is done because
+ * CUPS is a piece of shit and needs to be restarted after
+ * adding a usb printer otherwise the printer won't be
+ * detected. */
+
+ /* prefer the hal backend over the usb backend */
+ if (!(devices = get_cups_backend_devices ("hal")))
+ devices = get_cups_backend_devices ("usb");
+
+ l = devices;
while (l != NULL) {
- g_hash_table_insert (hal_devices, ((LocalPrinter *) l->data)->uri, l->data);
+ g_hash_table_insert (device_hash, ((LocalPrinter *) l->data)->uri, l->data);
l = l->next;
}
@@ -371,10 +389,11 @@
for (attr = response->attrs; attr != NULL; attr = attr->next) {
if (attr->name == NULL) {
if (device_class && strcmp (device_class, "network") && desc->label
- && desc->uri && !g_hash_table_lookup (hal_devices, desc->uri))
+ && desc->uri && !g_hash_table_lookup (device_hash, desc->uri)) {
devices = g_slist_prepend (devices, desc);
- else
+ } else {
local_printer_free (desc);
+ }
g_free (device_class);
device_class = NULL;
@@ -396,17 +415,18 @@
}
if (device_class && strcmp (device_class, "network") && desc->label
- && desc->uri && !g_hash_table_lookup (hal_devices, desc->uri))
+ && desc->uri && !g_hash_table_lookup (device_hash, desc->uri)) {
devices = g_slist_prepend (devices, desc);
- else
+ } else {
local_printer_free (desc);
+ }
g_free (device_class);
ippDelete (response);
}
- g_hash_table_destroy (hal_devices);
+ g_hash_table_destroy (device_hash);
return g_slist_reverse (devices);
}
@@ -1174,7 +1194,7 @@
cs->updating = FALSE;
cs->xml = glade_xml_new (GNOME_CUPS_MANAGER_DATADIR "/gnome-cups-ui-connection.glade",
- "gcups_connection_selector", GETTEXT_PACKAGE);
+ "gcups_connection_selector", GETTEXT_PACKAGE);
setup_network_connections (cs);
setup_local_connections (cs);
@@ -1468,7 +1488,7 @@
ptr = g_object_get_data (G_OBJECT (cs->xml), "local-devices");
for (; ptr != NULL ; ptr = ptr->next) {
desc = ptr->data;
- if (desc->uri != NULL && 0 == strcmp (uri, desc->uri))
+ if (desc->uri && !strcmp (uri, desc->uri))
break;
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...