Code sync
[external/hplip.git] / packaging / simple-scan-as-default.dpatch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## simple-scan-as-default.dpatch by  <till.kamppeter@gmail.com>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: No description.
6
7 @DPATCH@
8 diff -urNad hplip-3.10.2~/base/utils.py hplip-3.10.2/base/utils.py
9 --- hplip-3.10.2~/base/utils.py 2010-02-25 00:07:40.000000000 +0100
10 +++ hplip-3.10.2/base/utils.py  2010-03-24 09:05:57.660740026 +0100
11 @@ -450,18 +450,21 @@
12  
13          # Scan
14          self.cmd_scan = ''
15 -        path = which('xsane')
16 -
17 +        path = which('simple-scan')
18          if len(path) > 0:
19 -            self.cmd_scan = 'xsane -V %SANE_URI%'
20 +            self.cmd_scan = 'simple-scan %SANE_URI%'
21          else:
22 -            path = which('kooka')
23 +            path = which('xsane')
24              if len(path) > 0:
25 -                self.cmd_scan = 'kooka'
26 +                self.cmd_scan = 'xsane -V %SANE_URI%'
27              else:
28 -                path = which('xscanimage')
29 +                path = which('kooka')
30                  if len(path) > 0:
31 -                    self.cmd_scan = 'xscanimage'
32 +                    self.cmd_scan = 'kooka'
33 +                else:
34 +                    path = which('xscanimage')
35 +                    if len(path) > 0:
36 +                        self.cmd_scan = 'xscanimage'
37  
38          # Photo Card
39          path = which('hp-unload')
40 diff -urNad hplip-3.10.2~/ui4/ui_utils.py hplip-3.10.2/ui4/ui_utils.py
41 --- hplip-3.10.2~/ui4/ui_utils.py       2010-02-25 00:07:15.000000000 +0100
42 +++ hplip-3.10.2/ui4/ui_utils.py        2010-03-24 09:07:08.200766557 +0100
43 @@ -136,7 +136,7 @@
44  
45  
46      def loadDefaults(self):
47 -        self.cmd_scan = self.__setup(['xsane -V %SANE_URI%', 'kooka', 'xscanimage'])
48 +        self.cmd_scan = self.__setup(['simple-scan %SANE_URI%', 'xsane -V %SANE_URI%', 'kooka', 'xscanimage'])
49          self.cmd_fab = self.__setup(['hp-fab'])
50  
51