Code sync
[external/hplip.git] / packaging / try_libhpmud.so.0.dpatch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## try_libhpmud.so.0.dpatch by  <evgeni@debian.org>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: Try libhpmud.so.0 after libhpmud.so
6
7 @DPATCH@
8
9 diff --git a/scan/sane/marvell.c b/scan/sane/marvell.c
10 index c36caa7..465342e 100644
11 --- a/scan/sane/marvell.c
12 +++ b/scan/sane/marvell.c
13 @@ -63,8 +63,11 @@ static int bb_load(struct marvell_session *ps, const char *so)
14     /* Load hpmud manually with symbols exported. Otherwise the plugin will not find it. */ 
15     if ((ps->hpmud_handle = dlopen("libhpmud.so", RTLD_LAZY|RTLD_GLOBAL)) == NULL)
16     {
17 -      BUG("unable to load restricted library: %s\n", dlerror());
18 -      goto bugout;
19 +      if ((ps->hpmud_handle = dlopen("libhpmud.so.0", RTLD_LAZY|RTLD_GLOBAL)) == NULL)
20 +      {
21 +         BUG("unable to load restricted library: %s\n", dlerror());
22 +         goto bugout;
23 +      }
24     } 
25  
26     /* Load math library manually with symbols exported (Ubuntu 8.04). Otherwise the plugin will not find it. */ 
27 diff --git a/scan/sane/soap.c b/scan/sane/soap.c
28 index 28b83cc..698f58c 100644
29 --- a/scan/sane/soap.c
30 +++ b/scan/sane/soap.c
31 @@ -71,8 +71,11 @@ static int bb_load(struct soap_session *ps, const char *so)
32     /* Load hpmud manually with symbols exported. Otherwise the plugin will not find it. */ 
33     if ((ps->hpmud_handle = dlopen("libhpmud.so", RTLD_LAZY|RTLD_GLOBAL)) == NULL)
34     {
35 -      BUG("unable to load restricted library: %s\n", dlerror());
36 -      goto bugout;
37 +      if ((ps->hpmud_handle = dlopen("libhpmud.so.0", RTLD_LAZY|RTLD_GLOBAL)) == NULL)
38 +      {
39 +         BUG("unable to load restricted library: %s\n", dlerror());
40 +         goto bugout;
41 +      }
42     } 
43  
44     /* Load math library manually with symbols exported (Ubuntu 8.04). Otherwise the plugin will not find it. */ 
45 diff --git a/scan/sane/soapht.c b/scan/sane/soapht.c
46 index 5535245..e6039c1 100644
47 --- a/scan/sane/soapht.c
48 +++ b/scan/sane/soapht.c
49 @@ -62,10 +62,13 @@ static int bb_load(struct soap_session *ps, const char *so)
50     int stat=1;
51  
52     /* Load hpmud manually with symbols exported. Otherwise the plugin will not find it. */ 
53 -   if ((ps->hpmud_handle = dlopen("libhpmud.so.0", RTLD_LAZY|RTLD_GLOBAL)) == NULL)
54 +   if ((ps->hpmud_handle = dlopen("libhpmud.so", RTLD_LAZY|RTLD_GLOBAL)) == NULL)
55     {
56 -      BUG("unable to load restricted library: %s\n", dlerror());
57 -      goto bugout;
58 +      if ((ps->hpmud_handle = dlopen("libhpmud.so.0", RTLD_LAZY|RTLD_GLOBAL)) == NULL)
59 +      {
60 +         BUG("unable to load restricted library: %s\n", dlerror());
61 +         goto bugout;
62 +      }
63     } 
64  
65     /* Load math library manually with symbols exported (Ubuntu 8.04). Otherwise the plugin will not find it. */