[sane-backends] fix avision device initialization (#706877)
Nils Philippsen
nphilipp at fedoraproject.org
Tue Apr 17 09:48:04 UTC 2012
commit 55feaaff592b0d24b7ed4b752f0f5eaff39d7bcc
Author: Nils Philippsen <nils at redhat.com>
Date: Tue Apr 17 11:47:42 2012 +0200
fix avision device initialization (#706877)
sane-backends-1.0.22-avision-init-devices.patch | 91 +++++++++++++++++++++++
sane-backends.spec | 6 ++
2 files changed, 97 insertions(+), 0 deletions(-)
---
diff --git a/sane-backends-1.0.22-avision-init-devices.patch b/sane-backends-1.0.22-avision-init-devices.patch
new file mode 100644
index 0000000..d6617f1
--- /dev/null
+++ b/sane-backends-1.0.22-avision-init-devices.patch
@@ -0,0 +1,91 @@
+From c688c041b21f955e420e0f1fb7807253d4f4035c Mon Sep 17 00:00:00 2001
+From: Nils Philippsen <nils at redhat.com>
+Date: Tue, 17 Apr 2012 11:42:54 +0200
+Subject: [PATCH] patch: avision-init-devices
+
+Squashed commit of the following:
+
+commit ff9cb7dad86822147bc51a5cef9688603cbbcfa4
+Author: Mike Kelly <mike at piratehaven.org>
+Date: Wed Mar 21 21:03:00 2012 -0700
+
+ Added sane_reload_devices() to sane_init().
+
+ Adding sane_reload_devices() to sane_init() required sane_init() to be moved
+ below the sane_reload_devices() declaration. This restores the original
+ functionality present before I split the sane_reload_devices() code out of
+ sane_init() so that it could be called from sane_get_devices().
+ (cherry picked from commit 33bb529c5f8ca013fb499addc14c7fb229203ea8)
+---
+ backend/avision.c | 48 +++++++++++++++++++++++++-----------------------
+ 1 file changed, 25 insertions(+), 23 deletions(-)
+
+diff --git a/backend/avision.c b/backend/avision.c
+index 3398e08..8c066d7 100644
+--- a/backend/avision.c
++++ b/backend/avision.c
+@@ -7526,29 +7526,6 @@ attach_one_usb (const char* dev)
+ attach (dev, AV_USB, 0);
+ return SANE_STATUS_GOOD;
+ }
+-
+-SANE_Status
+-sane_init (SANE_Int* version_code, SANE_Auth_Callback authorize)
+-{
+- authorize = authorize; /* silence gcc */
+-
+- DBG_INIT();
+-
+-#ifdef AVISION_STATIC_DEBUG_LEVEL
+- DBG_LEVEL = AVISION_STATIC_DEBUG_LEVEL;
+-#endif
+-
+- DBG (3, "sane_init:(Version: %i.%i Build: %i)\n",
+- SANE_CURRENT_MAJOR, V_MINOR, BACKEND_BUILD);
+-
+- /* must come first */
+- sanei_thread_init ();
+-
+- if (version_code)
+- *version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, BACKEND_BUILD);
+-
+- return SANE_STATUS_GOOD;
+-}
+
+ static SANE_Status
+ sane_reload_devices (void)
+@@ -7722,6 +7699,31 @@ sane_reload_devices (void)
+ return SANE_STATUS_GOOD;
+ }
+
++SANE_Status
++sane_init (SANE_Int* version_code, SANE_Auth_Callback authorize)
++{
++ authorize = authorize; /* silence gcc */
++
++ DBG_INIT();
++
++#ifdef AVISION_STATIC_DEBUG_LEVEL
++ DBG_LEVEL = AVISION_STATIC_DEBUG_LEVEL;
++#endif
++
++ DBG (3, "sane_init:(Version: %i.%i Build: %i)\n",
++ SANE_CURRENT_MAJOR, V_MINOR, BACKEND_BUILD);
++
++ /* must come first */
++ sanei_thread_init ();
++
++ if (version_code)
++ *version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, BACKEND_BUILD);
++
++ sane_reload_devices ();
++
++ return SANE_STATUS_GOOD;
++}
++
+ void
+ sane_exit (void)
+ {
+--
+1.7.10
+
diff --git a/sane-backends.spec b/sane-backends.spec
index 6420c69..7ec2f42 100644
--- a/sane-backends.spec
+++ b/sane-backends.spec
@@ -38,6 +38,8 @@ Patch8: sane-backends-1.0.22-epson-stylus-sx125.patch
Patch9: sane-backends-1.0.22-av220-gray-modes.patch
# backported from upstream: cef28b4d46a0faa4d4acb60d815ac9a49036ba85
Patch10: sane-backends-1.0.22-Lexmark-X1100.patch
+# backported from upstream: 33bb529c5f8ca013fb499addc14c7fb229203ea8
+Patch11: sane-backends-1.0.22-avision-init-devices.patch
URL: http://www.sane-project.org
BuildRequires: tetex-latex
@@ -128,6 +130,7 @@ This package contains backend drivers to access digital cameras through SANE.
%patch8 -p1 -b .epson-stylus-sx125
%patch9 -p1 -b .av220-gray-modes
%patch10 -p1 -b .Lexmark-X1100
+%patch11 -p1 -b .avision-init-devices
%build
# use PIC/PIE because SANE-enabled software is likely to deal with data coming
@@ -203,6 +206,9 @@ install -m 0644 tools/sane-backends.pc %{buildroot}%{_libdir}/pkgconfig/
%{_libdir}/sane/*gphoto2.so.*
%changelog
+* Tue Apr 17 2012 Nils Philippsen <nils at redhat.com> - 1.0.22-10
+- fix avision device initialization (#706877)
+
* Tue Jan 10 2012 Nils Philippsen <nils at redhat.com> - 1.0.22-9
- rebuild for gcc 4.7
More information about the scm-commits
mailing list