Code sync
[external/hplip.git] / packaging / hp-check_debian.dpatch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## hp-check_debian.dpatch by  <msp@debian.org>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: Debian/ Ubuntu place hpaio in /etc/sane.d/dll.d/hplip, so lets check there too
6
7 @DPATCH@
8 diff -urNad hplip-2.8.12~/check.py hplip-2.8.12/check.py
9 --- hplip-2.8.12~/check.py      2008-12-18 07:41:18.000000000 +1100
10 +++ hplip-2.8.12/check.py       2009-01-22 14:01:40.000000000 +1100
11 @@ -693,6 +693,21 @@
12                      if 'hpaio' in line:
13                          found = True
14  
15 +               # Debian/ Ubuntu place hpaio in /etc/sane.d/dll.d/hplip, so lets check there too
16 +
17 +               if not found:
18 +                   log.info(log.bold("'hpaio' in '/etc/sane.d/dll.d/hplip'..."))
19 +                   try:
20 +                       f = file('/etc/sane.d/dll.d/hplip', 'r')
21 +                    except IOError:
22 +                       log.error("'/etc/sane.d/dll.d/hplip' not found.")
23 +                       num_errors += 1
24 +                    else:
25 +                        found = False
26 +                        for line in f:
27 +                            if 'hpaio' in line:
28 +                                found = True
29 +
30                  if found:
31                      log.info("OK, found. SANE backend 'hpaio' is properly set up.")
32                  else: