--- check.py.orig 2010-09-26 19:07:46.000000000 +0200 +++ check.py 2010-12-28 14:19:55.000000000 +0100 @@ -731,14 +731,27 @@ else: found = False for line in f: - if 'hpaio' in line: + if re.match('hpaio',line) is not None: found = True + if not found: + log.info(log.bold("'hpaio' in '/etc/sane.d/dll.d/*'...")) + if not os.path.isdir("/etc/sane.d/dll.d/"): + log.info(log.bold("/etc/sane.d/dll.d/ directory not found")) + else: + for filename in os.listdir("/etc/sane.d/dll.d/"): + log.info(log.bold("/etc/sane.d/dll.d/"+filename)) + try: + for line in open("/etc/sane.d/dll.d/"+filename).xreadlines(): + if re.match('hpaio',line) is not None: + found = True + except IOError: + continue # ignore bad filenames if found: log.info("OK, found. SANE backend 'hpaio' is properly set up.") else: num_errors += 1 - log.error("Not found. SANE backend 'hpaio' NOT properly setup (needs to be added to /etc/sane.d/dll.conf).") + log.error("Not found. SANE backend 'hpaio' NOT properly setup (needs to be added to a file in /etc/sane.d/dll.d/).") log.info() log.info(log.bold("Checking output of 'scanimage -L'..."))