diff options
author | Patrick Kursawe <phosphan@gentoo.org> | 2005-11-07 07:26:22 +0000 |
---|---|---|
committer | Patrick Kursawe <phosphan@gentoo.org> | 2005-11-07 07:26:22 +0000 |
commit | 527e5130802ba5b78bc730982ed8038d7012b43c (patch) | |
tree | be1f0f6099913dd54bc6b50591f4a50779e4f887 /media-gfx/sane-backends | |
parent | adding ~ppc keyword (diff) | |
download | gentoo-2-527e5130802ba5b78bc730982ed8038d7012b43c.tar.gz gentoo-2-527e5130802ba5b78bc730982ed8038d7012b43c.tar.bz2 gentoo-2-527e5130802ba5b78bc730982ed8038d7012b43c.zip |
sm3600usb.patch was broken by keyword subsitution
(Portage version: 2.0.51.22-r2)
Diffstat (limited to 'media-gfx/sane-backends')
-rw-r--r-- | media-gfx/sane-backends/ChangeLog | 5 | ||||
-rw-r--r-- | media-gfx/sane-backends/Manifest | 2 | ||||
-rw-r--r-- | media-gfx/sane-backends/files/sm3600usb.patch | 315 |
3 files changed, 5 insertions, 317 deletions
diff --git a/media-gfx/sane-backends/ChangeLog b/media-gfx/sane-backends/ChangeLog index a53248e26150..38d95d1d8592 100644 --- a/media-gfx/sane-backends/ChangeLog +++ b/media-gfx/sane-backends/ChangeLog @@ -1,6 +1,9 @@ # ChangeLog for media-gfx/sane-backends # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-gfx/sane-backends/ChangeLog,v 1.84 2005/11/04 14:58:08 phosphan Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-gfx/sane-backends/ChangeLog,v 1.85 2005/11/07 07:26:22 phosphan Exp $ + + 07 Nov 2005; Patrick Kursawe <phosphan@gentoo.org> -files/sm3600usb.patch: + sm3600usb.patch was broken by keyword subsitution 04 Nov 2005; Patrick Kursawe <phosphan@gentoo.org> files/sm3600usb.patch: Yesterday's patch was broken diff --git a/media-gfx/sane-backends/Manifest b/media-gfx/sane-backends/Manifest index 1f7f465aa5ed..a1b23aab0ab2 100644 --- a/media-gfx/sane-backends/Manifest +++ b/media-gfx/sane-backends/Manifest @@ -26,4 +26,4 @@ MD5 d5d1e4a4c8d3839c16329c105f2580d3 files/digest-sane-backends-1.0.16-r3 151 MD5 d5d1e4a4c8d3839c16329c105f2580d3 files/digest-sane-backends-1.0.16-r4 151 MD5 0bc1f6b8682b5585c8e87a325f983ade files/lide25.patch 5565 MD5 83640d1e7caa2aa50c676d40b64866c7 files/digest-sane-backends-1.0.15 157 -MD5 0d7d02f55a848d8e6a19a3aef9e058cd files/sm3600usb.patch 8210 +MD5 77ad69b7090299a5f758c15aef0ee513 files/sm3600usb.patch 7348 diff --git a/media-gfx/sane-backends/files/sm3600usb.patch b/media-gfx/sane-backends/files/sm3600usb.patch deleted file mode 100644 index 6871e21d4ba8..000000000000 --- a/media-gfx/sane-backends/files/sm3600usb.patch +++ /dev/null @@ -1,315 +0,0 @@ -Index: sm3600.c -=================================================================== -RCS file: /cvsroot/sane/sane-backends/backend/sm3600.c,v -retrieving revision 1.13 -retrieving revision 1.14 -diff -u -r1.13 -r1.14 ---- backend/sm3600.c 3 Jul 2005 13:35:48 -0000 1.13 -+++ backend/sm3600.c 16 Aug 2005 19:50:34 -0000 1.14 -@@ -55,24 +55,25 @@ - - ====================================================================== */ - --#include "sane/config.h" -+#include "../include/sane/config.h" - #include <stdlib.h> - #include <string.h> - #include <errno.h> - --#include <usb.h> -- --#define BUILD 5 -+#define BUILD 6 - - #ifndef BACKEND_NAME - #define BACKEND_NAME sm3600 - #endif - --#include "sane/sane.h" --#include "sane/sanei.h" --#include "sane/sanei_backend.h" --#include "sane/sanei_config.h" --#include "sane/saneopts.h" -+#include "../include/sane/sane.h" -+#include "../include/sane/sanei.h" -+#include "../include/sane/sanei_backend.h" -+#include "../include/sane/sanei_config.h" -+#include "../include/sane/saneopts.h" -+#include "../include/sane/sanei_usb.h" -+ -+#undef HAVE_LIBUSB - - /* prevent inclusion of scantool.h */ - #define SCANTOOL_H -@@ -326,7 +327,8 @@ - } - - static SANE_Status --RegisterSaneDev (struct usb_device *pdevUSB, TModel model, char *szName){ -+RegisterSaneDev (TModel model, SANE_String_Const szName) -+{ - TDevice * q; - - errno = 0; -@@ -342,7 +344,6 @@ - q->sane.model = "ScanMaker 3600"; - q->sane.type = "flatbed scanner"; - -- q->pdev=pdevUSB; - q->model=model; - - ++num_devices; -@@ -351,13 +352,37 @@ - - return SANE_STATUS_GOOD; - } -+ -+static SANE_Status -+sm_usb_attach (SANE_String_Const dev_name) -+{ -+ int fd; -+ SANE_Status err; -+ SANE_Word v, p; -+ TModel model; -+ -+ err = sanei_usb_open(dev_name, &fd); -+ if (err) -+ return err; -+ err = sanei_usb_get_vendor_product (fd, &v, &p); -+ if (err) -+ { -+ sanei_usb_close (fd); -+ return err; -+ } -+ DBG (DEBUG_JUNK, "found dev %04X/%04X, %s\n", v, p, dev_name); -+ model = GetScannerModel (v, p); -+ if (model != unknown) -+ RegisterSaneDev (model, dev_name); -+ -+ sanei_usb_close(fd); -+ return SANE_STATUS_GOOD; -+} - - SANE_Status - sane_init (SANE_Int *version_code, SANE_Auth_Callback authCB) - { -- struct usb_bus *pbus; -- struct usb_device *pdev; -- int iBus; -+ int i; - - DBG_INIT(); - -@@ -372,38 +397,11 @@ - } - - pdevFirst=NULL; -- -- usb_init(); -- usb_find_busses(); -- if (!usb_busses) -- return SANE_STATUS_IO_ERROR; -- -- usb_find_devices(); -- -- iBus=0; -- DBG(DEBUG_INFO,"starting bus scan\n"); -- for (pbus = usb_busses; pbus; pbus = pbus->next) -- { -- int iDev=0; -- iBus++; -- /* 0.1.3b no longer has a "busnum" member */ -- DBG(DEBUG_JUNK,"scanning bus %s\n", pbus->dirname); -- for (pdev=pbus->devices; pdev; pdev = pdev->next) -- { -- TModel model; -- iDev++; -- DBG(DEBUG_JUNK,"found dev %04X/%04X\n", -- pdev->descriptor.idVendor, -- pdev->descriptor.idProduct); -- model=GetScannerModel(pdev->descriptor.idVendor, -- pdev->descriptor.idProduct); -- if (model!=unknown) -- { -- char ach[100]; -- sprintf(ach,"%d/%d",iBus,iDev); -- RegisterSaneDev(pdev,model,ach); -- } -- } -+ -+ sanei_usb_init(); -+ for (i = 0; aScanners[i].idProduct; i++) -+ { -+ sanei_usb_find_devices(SCANNER_VENDOR, aScanners[i].idProduct, sm_usb_attach); - } - return SANE_STATUS_GOOD; - } -@@ -464,8 +462,11 @@ - if (devicename[0]) /* selected */ - { - for (pdev=pdevFirst; pdev; pdev=pdev->pNext) -+{ -+DBG(DEBUG_VERBOSE,"%s<>%s\n",devicename, pdev->sane.name); - if (!strcmp(devicename,pdev->sane.name)) - break; -+} - /* no dynamic post-registration */ - } - else -@@ -482,14 +483,11 @@ - pinstFirst=this; - this->model=pdev->model; /* memorize model */ - /* open and prepare USB scanner handle */ -- this->hScanner=usb_open(pdev->pdev); -- if (!this->hScanner) -- return SetError(this,SANE_STATUS_IO_ERROR, "cannot open scanner device"); -- rc=SANE_STATUS_GOOD; -- if (usb_claim_interface(this->hScanner, 0)) -- return SetError(this,SANE_STATUS_IO_ERROR, "cannot claim IF"); -- if (usb_set_configuration(this->hScanner, 1)) -- return SetError(this,SANE_STATUS_IO_ERROR, "cannot set USB config 1"); -+ -+ if (sanei_usb_open (devicename, &this->hScanner) != SANE_STATUS_GOOD) -+ return SetError (this, SANE_STATUS_IO_ERROR, "cannot open scanner device"); -+ -+ rc = SANE_STATUS_GOOD; - - this->quality=fast; - return InitOptions(this); -@@ -505,8 +503,9 @@ - { - if (this->state.bScanning) - EndScan(this); -- usb_close(this->hScanner); -- this->hScanner=NULL; -+ -+ sanei_usb_close(this->hScanner); -+ this->hScanner=-1; - } - ResetCalibration(this); /* release calibration data */ - /* unlink active device entry */ -Index: sm3600.h -=================================================================== -RCS file: /cvsroot/sane/sane-backends/backend/sm3600.h,v -retrieving revision 1.10 -retrieving revision 1.11 -diff -u -r1.10 -r1.11 ---- backend/sm3600.h 30 Apr 2004 21:02:04 -0000 1.10 -+++ backend/sm3600.h 16 Aug 2005 19:50:34 -0000 1.11 -@@ -190,7 +190,7 @@ - TQuality quality; - TMode mode; - TModel model; -- usb_dev_handle *hScanner; -+ int hScanner; - FILE *fhLog; - FILE *fhScan; - int ichPageBuffer; /* write position in full page buffer */ -Index: sm3600-scanusb.c -=================================================================== -RCS file: /cvsroot/sane/sane-backends/backend/sm3600-scanusb.c,v -retrieving revision 1.11 -retrieving revision 1.12 -diff -u -r1.11 -r1.12 ---- backend/sm3600-scanusb.c 15 Apr 2004 21:06:58 -0000 1.11 -+++ backend/sm3600-scanusb.c 16 Aug 2005 19:50:34 -0000 1.12 -@@ -43,7 +43,7 @@ - - Userspace scan tool for the Microtek 3600 scanner - --$Id: sm3600-scanusb.c,v 1.11 2004/04/15 21:06:58 eichholz-guest Exp $ -+$Id: sm3600-scanusb.c,v 1.12 2005/08/16 19:50:34 hmg-guest Exp $ - - (C) Marian Eichholz 2001 - -@@ -68,14 +68,20 @@ - int cchBuffer, - int cJiffiesTimeout) - { -- return usb_control_msg(this->hScanner, -+ SANE_Status err; -+ -+ cJiffiesTimeout = cJiffiesTimeout; -+ -+ err = sanei_usb_control_msg (this->hScanner, - nReqType, - nRequest, - nValue, - nIndex, -- pBuffer, - cchBuffer, -- cJiffiesTimeout); -+ pBuffer); -+ if (err) -+ return err; -+ return cchBuffer; - } - - /* ********************************************************************** -@@ -90,11 +96,18 @@ - int cchMax, - int cJiffiesTimeout) - { -- return usb_bulk_read(this->hScanner, -- nEndPoint, -- pBuffer, -- cchMax, -- cJiffiesTimeout); -+ int err; -+ size_t sz = cchMax; -+ -+ nEndPoint = nEndPoint; -+ cJiffiesTimeout = cJiffiesTimeout; -+ -+ err = sanei_usb_read_bulk(this->hScanner, -+ pBuffer, -+ &sz); -+ if (err) -+ return err; -+ return sz; - } - - /* ********************************************************************** -@@ -310,7 +323,9 @@ - { - rc=SetError(this,SANE_STATUS_IO_ERROR, - "bulk read of %d bytes failed: %s", -- cchChunk,usb_strerror()); -+ cchChunk, -+ "I/O error" -+ ); - continue; - } - } -@@ -371,7 +386,9 @@ - else - rc=SetError(this,SANE_STATUS_IO_ERROR, - "bulk read of %d bytes failed: %s", -- cchChunk,usb_strerror()); -+ cchChunk, -+ "I/O error" -+ ); - } - dprintf(DEBUG_COMM,"writing %d bytes\n",cchRead); - -Index: sm3600-scanutil.c -=================================================================== -RCS file: /cvsroot/sane/sane-backends/backend/sm3600-scanutil.c,v -retrieving revision 1.11 -retrieving revision 1.12 -diff -u -r1.11 -r1.12 ---- backend/sm3600-scanutil.c 15 Apr 2004 21:06:58 -0000 1.11 -+++ backend/sm3600-scanutil.c 16 Aug 2005 19:50:34 -0000 1.12 -@@ -43,10 +43,11 @@ - - Userspace scan tool for the Microtek 3600 scanner - --$Id: sm3600-scanutil.c,v 1.11 2004/04/15 21:06:58 eichholz-guest Exp $ -+$Id: sm3600-scanutil.c,v 1.12 2005/08/16 19:50:34 hmg-guest Exp $ - - ====================================================================== */ - -+#include <unistd.h> - #include "sm3600-scantool.h" - - /* ********************************************************************** |