diff options
author | sbd <sbd@pkgsrc.org> | 2011-11-13 21:06:30 +0000 |
---|---|---|
committer | sbd <sbd@pkgsrc.org> | 2011-11-13 21:06:30 +0000 |
commit | d3a994302ba14ca5e2f4ab3ca84be2714007a166 (patch) | |
tree | d42d01097a4f8c55f9b20523873d94aff1896c2c | |
parent | 23972c817df24a5ee6d1ab5da9869aa9573d6e3a (diff) | |
download | pkgsrc-d3a994302ba14ca5e2f4ab3ca84be2714007a166.tar.gz |
Remove the usb-backend-both-usblp-and-libusb.dpatch as it is has been dropped
by it original author.
-rw-r--r-- | print/cups/Makefile | 4 | ||||
-rw-r--r-- | print/cups/distinfo | 7 | ||||
-rw-r--r-- | print/cups/patches/patch-aj | 39 | ||||
-rw-r--r-- | print/cups/patches/patch-ak | 97 | ||||
-rw-r--r-- | print/cups/patches/patch-al | 217 | ||||
-rw-r--r-- | print/cups/patches/patch-am | 127 | ||||
-rw-r--r-- | print/cups/patches/patch-ap | 17 |
7 files changed, 3 insertions, 505 deletions
diff --git a/print/cups/Makefile b/print/cups/Makefile index 59fac5f37e3..42946be74db 100644 --- a/print/cups/Makefile +++ b/print/cups/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.182 2011/11/13 20:40:48 sbd Exp $ +# $NetBSD: Makefile,v 1.183 2011/11/13 21:06:30 sbd Exp $ # # The CUPS author is very good about taking back changes into the main # CUPS distribution. The correct place to send patches or bug-fixes is: @@ -8,7 +8,7 @@ DISTNAME= cups-${DIST_VERS}-source PKGNAME= cups-${DIST_VERS:S/-/./g} BASE_VERS= 1.4.8 DIST_VERS= ${BASE_VERS} -PKGREVISION= 1 +PKGREVISION= 2 CATEGORIES= print MASTER_SITES= http://ftp.easysw.com/pub/cups/${BASE_VERS}/ \ diff --git a/print/cups/distinfo b/print/cups/distinfo index fc0c1626c34..beb6084adcd 100644 --- a/print/cups/distinfo +++ b/print/cups/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.84 2011/10/13 13:05:57 hans Exp $ +$NetBSD: distinfo,v 1.85 2011/11/13 21:06:30 sbd Exp $ SHA1 (cups-1.4.8-source.tar.bz2) = 9167f556e78e0bc075f1eb2f695d79cc1f334007 RMD160 (cups-1.4.8-source.tar.bz2) = ee80e8d0b56dc0e2edf2a9aa9a43c4b92619f741 @@ -11,13 +11,8 @@ SHA1 (patch-af) = c05f7739d65c7b81cc712cbf6008d53568601f6a SHA1 (patch-ag) = 680c1c7fb44d8153b5825252d2e297a5196ca98e SHA1 (patch-ah) = c4dae009ac5d2dec52fec609bfa38f282fb8e75c SHA1 (patch-ai) = fae5b2b5e54ea947d92c89c0bdcdd86c7e3bad12 -SHA1 (patch-aj) = 471a2738bd7bd6a00596dbeb120084ac37840b31 -SHA1 (patch-ak) = 0e8acff2df0034b741ef49093aca773174abb96b -SHA1 (patch-al) = b5dd793efed46fc950f08bfbd5fb92180ba3be77 -SHA1 (patch-am) = b2cc09ac01e45c96247558667f875fd4a95b125f SHA1 (patch-an) = 231c871e31db279e8aeafba71506f93330e0a971 SHA1 (patch-ao) = 7fe50080b9a6fd4dac186020f9351ef6000373c7 -SHA1 (patch-ap) = 70c5fa4a19ca2812818844180ca9db9cb7cfd601 SHA1 (patch-at) = aee1f0e8cbcd9e2dbcfa9af3fb675ea7ce1ce622 SHA1 (patch-au) = e4e976ccb4d7782e31f5b0e3ed175359bf95ba42 SHA1 (patch-config-scripts_cups-gssapi.m4) = a027a1c5a444c3ef39f892f2592fbbb16586087b diff --git a/print/cups/patches/patch-aj b/print/cups/patches/patch-aj deleted file mode 100644 index f911ca2d9f8..00000000000 --- a/print/cups/patches/patch-aj +++ /dev/null @@ -1,39 +0,0 @@ -$NetBSD: patch-aj,v 1.13 2010/06/05 23:09:29 sbd Exp $ - -Incorporate -usb-backend-both-usblp-and-libusb.dpatch by <till.kamppeter@gmail.com> -http://www.cups.org/str.php?L3357 - ---- backend/ieee1284.c.orig 2009-12-08 02:13:42.000000000 +0000 -+++ backend/ieee1284.c -@@ -255,6 +255,7 @@ backendGetDeviceID( - cups_option_t *values; /* Keys and values in device ID */ - const char *mfg, /* Manufacturer */ - *mdl, /* Model */ -+ *des, /* Description */ - *sern; /* Serial number */ - char temp[256], /* Temporary manufacturer string */ - *tempptr; /* Pointer into temp string */ -@@ -285,10 +286,20 @@ backendGetDeviceID( - } - else - { -- strlcpy(temp, make_model, sizeof(temp)); -+ /* -+ * No manufacturer? Use the model string or description... -+ */ -+ -+ if (mdl) -+ _ppdNormalizeMakeAndModel(mdl, temp, sizeof(temp)); -+ else if ((des = cupsGetOption("DESCRIPTION", num_values, values)) != NULL || -+ (des = cupsGetOption("DES", num_values, values)) != NULL) -+ _ppdNormalizeMakeAndModel(des, temp, sizeof(temp)); -+ else -+ strlcpy(temp, "Unknown", sizeof(temp)); - - if ((tempptr = strchr(temp, ' ')) != NULL) -- *tempptr = '\0'; -+ *tempptr = '\0'; - - mfg = temp; - } diff --git a/print/cups/patches/patch-ak b/print/cups/patches/patch-ak deleted file mode 100644 index f327e275de9..00000000000 --- a/print/cups/patches/patch-ak +++ /dev/null @@ -1,97 +0,0 @@ -$NetBSD: patch-ak,v 1.14 2010/06/09 09:01:43 sbd Exp $ - -Incorporate -usb-backend-both-usblp-and-libusb.dpatch by <till.kamppeter@gmail.com> -http://www.cups.org/str.php?L3357 - ---- backend/usb-hybrid.c.orig 2010-06-06 00:29:57.033597544 +0000 -+++ backend/usb-hybrid.c -@@ -0,0 +1,88 @@ -+/* -+ * "Id: usb-hybrid.c 8807 2009-08-31 18:45:43Z mike " -+ * -+ * USB port backend for the Common UNIX Printing System (CUPS). -+ * -+ * This file is included from "usb.c" when compiled on Linux. -+ * -+ * Copyright 2007-2008 by Apple Inc. -+ * Copyright 1997-2007 by Easy Software Products, all rights reserved. -+ * -+ * 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" -+ * "LICENSE" which should have been included with this file. If this -+ * file is missing or damaged, see the license at "http://www.cups.org/". -+ * -+ * This file is subject to the Apple OS-Developed Software exception. -+ * -+ * Contents: -+ * -+ * print_device() - Print a file to a USB device. -+ * list_devices() - List all USB devices. -+ */ -+ -+/* -+ * Include necessary headers. -+ */ -+ -+#include <sys/select.h> -+ -+/* -+ * Include the two USB implementations used under Linux ... -+ */ -+ -+#define USB_HYBRID 1 -+#include "usb-libusb.c" -+#include "usb-unix.c" -+ -+/* -+ * 'print_device()' - Print a file to a USB device. -+ */ -+ -+int /* O - Exit status */ -+print_device(const char *uri, /* I - Device URI */ -+ const char *hostname, /* I - Hostname/manufacturer */ -+ const char *resource, /* I - Resource/modelname */ -+ char *options, /* I - Device options/serial number */ -+ int print_fd, /* I - File descriptor to print */ -+ int copies, /* I - Copies to print */ -+ int argc, /* I - Number of command-line arguments (6 or 7) */ -+ char *argv[]) /* I - Command-line arguments */ -+{ -+ int result; -+ for(;;) -+ { -+ result = print_device_unix(uri, hostname, resource, options, print_fd, -+ copies, argc, argv); -+ if (result == -1) -+ { -+ result = print_device_libusb(uri, hostname, resource, options, print_fd, -+ copies, argc, argv); -+ if (result == -1) -+ sleep(5); -+ else -+ return(result); -+ } -+ else -+ return(result); -+ } -+} -+ -+/* -+ * 'list_devices()' - List all USB devices. -+ */ -+ -+void -+list_devices(void) -+{ -+ /* Try both discovery methods, each device will appear only under one -+ of them */ -+ list_devices_libusb(); -+ list_devices_unix(); -+} -+ -+ -+/* -+ * End of "Id: usb-hybrid.c 8807 2009-08-31 18:45:43Z mike ". -+ */ diff --git a/print/cups/patches/patch-al b/print/cups/patches/patch-al deleted file mode 100644 index d3612b07bab..00000000000 --- a/print/cups/patches/patch-al +++ /dev/null @@ -1,217 +0,0 @@ -$NetBSD: patch-al,v 1.8 2010/06/05 23:09:29 sbd Exp $ - -Incorporate -usb-backend-both-usblp-and-libusb.dpatch by <till.kamppeter@gmail.com> -http://www.cups.org/str.php?L3357 - ---- backend/usb-libusb.c.orig 2009-09-11 20:03:31.000000000 +0000 -+++ backend/usb-libusb.c -@@ -13,16 +13,16 @@ - * - * Contents: - * -- * list_devices() - List the available printers. -- * print_device() - Print a file to a USB device. -+ * list_devices_libusb() - List the available printers. -+ * print_device_libusb() - Print a file to a USB device. - * close_device() - Close the connection to the USB printer. - * find_device() - Find or enumerate USB printers. - * get_device_id() - Get the IEEE-1284 device ID for the printer. - * list_cb() - List USB printers for discovery. - * make_device_uri() - Create a device URI for a USB printer. -- * open_device() - Open a connection to the USB printer. -+ * open_device_libusb() - Open a connection to the USB printer. - * print_cb() - Find a USB printer for printing. -- * side_cb() - Handle side-channel requests. -+ * side_cb_libusb() - Handle side-channel requests. - */ - - /* -@@ -65,30 +65,30 @@ static int list_cb(usb_printer_t *print - static char *make_device_uri(usb_printer_t *printer, - const char *device_id, - char *uri, size_t uri_size); --static int open_device(usb_printer_t *printer, int verbose); -+static int open_device_libusb(usb_printer_t *printer, int verbose); - static int print_cb(usb_printer_t *printer, const char *device_uri, - const char *device_id, const void *data); --static ssize_t side_cb(usb_printer_t *printer, int print_fd); -+static ssize_t side_cb_libusb(usb_printer_t *printer, int print_fd); - - - /* -- * 'list_devices()' - List the available printers. -+ * 'list_devices_libusb()' - List the available printers. - */ - - void --list_devices(void) -+list_devices_libusb(void) - { -- fputs("DEBUG: list_devices\n", stderr); -+ fputs("DEBUG: list_devices_libusb\n", stderr); - find_device(list_cb, NULL); - } - - - /* -- * 'print_device()' - Print a file to a USB device. -+ * 'print_device_libusb()' - Print a file to a USB device. - */ - - int /* O - Exit status */ --print_device(const char *uri, /* I - Device URI */ -+print_device_libusb(const char *uri, /* I - Device URI */ - const char *hostname, /* I - Hostname/manufacturer */ - const char *resource, /* I - Resource/modelname */ - char *options, /* I - Device options/serial number */ -@@ -105,19 +105,23 @@ print_device(const char *uri, /* I - De - struct pollfd pfds[2]; /* Poll descriptors */ - - -- fputs("DEBUG: print_device\n", stderr); -+ fputs("DEBUG: print_device_libusb\n", stderr); - - /* - * Connect to the printer... - */ - -+#if defined(__linux) || defined(__sun) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) -+ if ((printer = find_device(print_cb, uri)) == NULL) -+ return(-1); -+#else - while ((printer = find_device(print_cb, uri)) == NULL) - { - _cupsLangPuts(stderr, - _("INFO: Waiting for printer to become available...\n")); - sleep(5); - } -- -+#endif - - /* - * If we are printing data from a print driver on stdin, ignore SIGTERM -@@ -189,7 +193,7 @@ print_device(const char *uri, /* I - De - - if (pfds[1].revents & (POLLIN | POLLHUP)) - { -- if ((bytes = side_cb(printer, print_fd)) < 0) -+ if ((bytes = side_cb_libusb(printer, print_fd)) < 0) - pfds[1].events = 0; /* Filter has gone away... */ - else - tbytes += bytes; -@@ -359,7 +363,7 @@ find_device(usb_cb_t cb, /* I - Callb - printer.iface = iface; - printer.handle = NULL; - -- if (!open_device(&printer, data != NULL)) -+ if (!open_device_libusb(&printer, data != NULL)) - { - if (!get_device_id(&printer, device_id, sizeof(device_id))) - { -@@ -583,6 +587,14 @@ make_device_uri( - mfg = tempmfg; - } - -+ if (!strncasecmp(mdl, mfg, strlen(mfg))) -+ { -+ mdl += strlen(mfg); -+ -+ while (isspace(*mdl & 255)) -+ mdl ++; -+ } -+ - /* - * Generate the device URI from the manufacturer, model, serial number, - * and interface number... -@@ -611,11 +623,11 @@ make_device_uri( - - - /* -- * 'open_device()' - Open a connection to the USB printer. -+ * 'open_device_libusb()' - Open a connection to the USB printer. - */ - - static int /* O - 0 on success, -1 on error */ --open_device(usb_printer_t *printer, /* I - Printer */ -+open_device_libusb(usb_printer_t *printer, /* I - Printer */ - int verbose) /* I - Update connecting-to-device state? */ - { - int number; /* Configuration/interface/altset numbers */ -@@ -733,16 +745,73 @@ print_cb(usb_printer_t *printer, /* I - - const char *device_id, /* I - IEEE-1284 device ID */ - const void *data) /* I - User data (make, model, S/N) */ - { -- return (!strcmp((char *)data, device_uri)); -+ char *uri = (char *)data, -+ *str1, -+ *str2, -+ buf[255], -+ requested_uri[1024]; -+ -+ /* Work on a copy of uri */ -+ strncpy(requested_uri, uri, sizeof(requested_uri)); -+ requested_uri[sizeof(requested_uri) - 1] = '\0'; -+ -+ /* -+ * libusb-discovered URIs can have an "interface" specification and this -+ * never happens for usblp-discovered URIs, so remove the "interface" -+ * specification from the URI which we are checking currently. This way a -+ * queue for a usblp-discovered printer can now be accessed via libusb -+ */ -+ if (((str1 = strstr(requested_uri, "interface=")) == NULL) && -+ ((str2 = strstr(device_uri, "interface=")) != NULL)) -+ { -+ *(str2 - 1) = '\0'; -+ } -+ -+ /* -+ * Old URI with "serial=?". Cut this part off and consider this as -+ * an URI without serial number -+ */ -+ if ((str1 = strstr(requested_uri, "serial=?")) != NULL) -+ *(str1 - 1) = '\0'; -+ -+ /* -+ * Old URI without serial number. Match it also with URIs with serial -+ * number -+ */ -+ if (((str1 = strstr(requested_uri, "serial=")) == NULL) && -+ ((str2 = strstr(device_uri, "serial=")) != NULL)) -+ *(str2 - 1) = '\0'; -+ -+ /* -+ * libusb-discovered URIs can have a "serial" specification when the -+ * usblp-discovered URI for the same printer does not have one, as -+ * with libusb we can discover serial numbers also with other methods -+ * than only via the device ID. Therefore we accept also a -+ * usblp-discovered printer without serial number as a match. This we -+ * do by removing the serial number from the queue's (libusb-discovered) -+ * URI before comparing. Also warn the user because of the incapability -+ * of the usblp-based access to distinguish printers by the serial -+ * number. -+ */ -+ if (((str1 = strstr(requested_uri, "serial=")) == NULL) && -+ ((str2 = strstr(device_uri, "serial=")) != NULL)) -+ { -+ *(str2 - 1) = '\0'; -+ if (backendGetMakeModel(device_id, buf, sizeof(buf)) == 0) -+ fprintf(stderr, "WARNING: If you have more than one %s printer connected to this machine, please make sure that the \"usblp\" kernel module is always unloaded (and blacklisted) and re-create the queues for these printers. Otherwise CUPS will not be able to distinguish them.\n", -+ buf); -+ } -+ -+ return (!strcmp(requested_uri, device_uri)); - } - - - /* -- * 'side_cb()' - Handle side-channel requests. -+ * 'side_cb_libusb()' - Handle side-channel requests. - */ - - static ssize_t /* O - Number of bytes written */ --side_cb(usb_printer_t *printer, /* I - Printer */ -+side_cb_libusb(usb_printer_t *printer, /* I - Printer */ - int print_fd) /* I - File to print */ - { - ssize_t bytes, /* Bytes read/written */ diff --git a/print/cups/patches/patch-am b/print/cups/patches/patch-am deleted file mode 100644 index 0c83df1326a..00000000000 --- a/print/cups/patches/patch-am +++ /dev/null @@ -1,127 +0,0 @@ -$NetBSD: patch-am,v 1.10 2010/06/09 09:01:43 sbd Exp $ - -Incorporate -usb-backend-both-usblp-and-libusb.dpatch by <till.kamppeter@gmail.com> -http://www.cups.org/str.php?L3357 - ---- backend/usb-unix.c.orig 2009-12-08 02:13:42.000000000 +0000 -+++ backend/usb-unix.c -@@ -26,4 +26,14 @@ - - /* -+ * If USB_HYBRID is define append "_unix" to functions. -+ */ -+#ifdef USB_HYBRID -+# define print_device print_device_unix -+# define list_devices list_devices_unix -+# define open_device open_device_unix -+# define side_cb side_cb_unix -+#endif -+ -+/* - * Include necessary headers. - */ -@@ -133,4 +143,8 @@ print_device(const char *uri, /* I - De - sleep(10); - } -+#ifdef HAVE_USB_H -+ else -+ return (-1); -+#else - else if (errno == ENXIO || errno == EIO || errno == ENOENT || - errno == ENODEV) -@@ -148,4 +162,5 @@ print_device(const char *uri, /* I - De - return (CUPS_BACKEND_FAILED); - } -+#endif - } - } -@@ -358,6 +373,8 @@ open_device(const char *uri, /* I - Dev - device_id[1024], /* Device ID string */ - make_model[1024], /* Make and model */ -- device_uri[1024]; /* Device URI string */ -- -+ device_uri[1024], /* Device URI string */ -+ requested_uri[1024], /* Device URI string */ -+ *str1, -+ *str2; - - /* -@@ -408,5 +425,53 @@ open_device(const char *uri, /* I - Dev - } - -- if (!strcmp(uri, device_uri)) -+ /* Work on a copy of uri */ -+ strncpy(requested_uri, uri, sizeof(requested_uri)); -+ requested_uri[sizeof(requested_uri) - 1] = '\0'; -+ -+ /* -+ * libusb-discovered URIs can have an "interface" specification and this -+ * never happens for usblp-discovered URIs, so remove the "interface" -+ * specification from the URI of the print queue. This way a queue for -+ * a libusb-discovered printer can now be accessed via the usblip kernel -+ * module -+ */ -+ if ((str1 = strstr(requested_uri, "interface=")) != NULL) -+ *(str1 - 1) = '\0'; -+ -+ /* -+ * Old URI with "serial=?". Cut this part off and consider this as -+ * an URI without serial number -+ */ -+ if ((str1 = strstr(requested_uri, "serial=?")) != NULL) -+ *(str1 - 1) = '\0'; -+ -+ /* -+ * Old URI without serial number. Match it also with URIs with serial -+ * number -+ */ -+ if (((str1 = strstr(requested_uri, "serial=")) == NULL) && -+ ((str2 = strstr(device_uri, "serial=")) != NULL)) -+ *(str2 - 1) = '\0'; -+ -+ /* -+ * libusb-discovered URIs can have a "serial" specification when the -+ * usblp-discovered URI for the same printer does not have one, as -+ * with libusb we can discover serial numbers also with other methods -+ * than only via the device ID. Therefore we accept also a -+ * usblp-discovered printer without serial number as a match. This we -+ * do by removing the serial number from the queue's (libusb-discovered) -+ * URI before comparing. Also warn the user because of the incapability -+ * of the usblp-based access to distinguish printers by the serial -+ * number. -+ */ -+ if (((str1 = strstr(requested_uri, "serial=")) != NULL) && -+ ((str2 = strstr(device_uri, "serial=")) == NULL)) -+ { -+ *(str1 - 1) = '\0'; -+ fprintf(stderr, "WARNING: If you have more than one %s printer connected to this machine, please unload (and blacklist) the \"usblp\" kernel module as otherwise CUPS will not be able to distinguish your printers.\n", -+ make_model); -+ } -+ -+ if (!strcmp(requested_uri, device_uri)) - { - /* -@@ -434,8 +499,12 @@ open_device(const char *uri, /* I - Dev - - if (busy) -+ { - _cupsLangPuts(stderr, - _("INFO: Printer busy; will retry in 5 seconds...\n")); - -- sleep(5); -+ sleep(5); -+ } -+ else -+ return -1; - } - } -@@ -626,4 +695,8 @@ side_cb(int print_fd, /* I - Pr - } - -+#undef print_device -+#undef list_devices -+#undef open_device -+#undef side_cb - - /* diff --git a/print/cups/patches/patch-ap b/print/cups/patches/patch-ap deleted file mode 100644 index 824dfceebd7..00000000000 --- a/print/cups/patches/patch-ap +++ /dev/null @@ -1,17 +0,0 @@ -$NetBSD: patch-ap,v 1.9 2010/06/05 23:09:29 sbd Exp $ - -Incorporate -usb-backend-both-usblp-and-libusb.dpatch by <till.kamppeter@gmail.com> -http://www.cups.org/str.php?L3357 - ---- backend/usb.c.orig 2008-06-24 01:28:36.000000000 +0000 -+++ backend/usb.c -@@ -56,7 +56,7 @@ int print_device(const char *uri, const - */ - - #ifdef HAVE_USB_H --# include "usb-libusb.c" -+# include "usb-hybrid.c" - #elif defined(__APPLE__) - # include "usb-darwin.c" - #elif defined(__linux) || defined(__sun) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) |