Package: scanbuttond
Version: 0.2.3-4
Severity: wishlist
Tags: patch

If there is no scanner attached to the system (e.g. a laptop) and 
scanbuttond is running it will inform us of it's lack of scanners
to monitor every two seconds via syslog. I have attached a patch
that adds a --quiet option to stop this behavior.

Also submitted upstream.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-rc4
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages scanbuttond depends on:
ii  libc6                        2.3.6.ds1-2 GNU C Library: Shared libraries
ii  libsane                      1.0.18-3    API library for scanners
ii  libusb-0.1-4                 2:0.1.12-2  userspace USB programming library

Versions of packages scanbuttond recommends:
ii  sane-utils                    1.0.18-3   API library for scanners -- utilit

-- no debconf information
--- scanbuttond-0.2.3/scanbuttond.c     2006-02-16 18:23:53.000000000 -0500
+++ scanbuttond-0.2.3.quiet/scanbuttond.c       2006-08-23 18:36:34.000000000 
-0400
@@ -54,6 +54,7 @@
        {"retrydelay", required_argument, NULL, 'r'},
        {"help", no_argument, NULL, 'h'},
        {"version", no_argument, NULL, 'v'},
+       {"quiet", no_argument, NULL, 'q'},
        {NULL, 0, NULL, 0}
 };
 
@@ -67,7 +68,7 @@
 int daemonize;
 int killed = 0;
 char* path;
-
+int quiet;
 
 char* scanbtnd_get_connection_name(int connection)
 {
@@ -140,6 +141,7 @@
        printf("  -r, --retrydelay=DELAY      The retry delay (ms), default: 
%ld\n", DEF_RETRY_DELAY);
        printf("  -h, --help                  Shows this screen\n");
        printf("  -v, --version               Shows the version\n");
+       printf("  -q, --quiet                 Shut up about not finding any 
scanners\n");
 }
 
 
@@ -152,8 +154,9 @@
        poll_delay = -1;
        retry_delay = -1;
        daemonize = 1;
+       quiet = 0;
 
-       while ((c = getopt_long (argc, argv, "fb:s:S:p:r:hv", long_opts, NULL)) 
!= -1) {
+       while ((c = getopt_long (argc, argv, "fb:s:S:p:r:hvq", long_opts, 
NULL)) != -1) {
                switch (c) {
                        case 'f':
                                daemonize = 0;
@@ -191,6 +194,9 @@
                                show_version();
                                exit(EXIT_SUCCESS);
                                break;
+                       case 'q':
+                               quiet = 1;
+                               break;
                }
        }
 
@@ -300,11 +306,13 @@
        while (killed == 0) {
 
                if (scanners == NULL) {
-                       syslog(LOG_DEBUG, "rescanning devices...");
+                       if (!quiet)
+                               syslog(LOG_DEBUG, "rescanning devices...");
                        backend->scanbtnd_rescan();
                        scanners = backend->scanbtnd_get_supported_devices();
                        if (scanners == NULL) {
-                               syslog(LOG_DEBUG, "no supported devices found. 
rescanning in a few seconds...");
+                               if (!quiet)
+                                       syslog(LOG_DEBUG, "no supported devices 
found. rescanning in a few seconds...");
                                usleep(retry_delay);
                                continue;
                        }

Reply via email to