[sane-devel] Scanbd and /etc/sane.d

Wilhelm wilhelm.meier at fh-kl.de
Mon Dec 10 14:02:26 UTC 2012


Hallo Louis,

Am 05.12.2012 18:25, schrieb Louis Lagendijk:
> hello dear Sane developers
> I am in the process of packaging scanbd for Fedora. One thing that
> bothers me is the fact that I need to copy all <scanner>.conf files as
> scanbd relies on the user using the net backend, while scanbd acts as a
> saned proxy. But scanbd/saned requires a dll.conf that specifies the
> used backends while the user dll.conf only uses the net backend. An
> right now we can only have different dll.conf's inb different
> directories as pointed out by SANE_CONFIG_DIR.
>
> Alternative 1)
> ==============
> It would be nice if the calling binary could specify a dll.conf to be
> used. The user not specifying anything would get the normal dll.conf,
> while a binary like saned or scanbd would see its own dll.conf (e.g.
> saned-dll.conf). Would it be acceptable to modify dll.c to set the conf
> filename (and not SANE_CONFIG_DIR) to load the required dll.conf? I am
> thinking of adding a SANE_DLL_PREFIX environment var that gets prepended
> to the dll.conf string  (and dll.aliases) if defined. This way we do
> ensure that we do not break compatibility. E.g. if SANE_DLL_PREFIX is
> set to saned, we would load saned-dll.conf.
>
> My saned-dll could then specify all backends, while dll.conf would only
> have the net backend.
>
> Alternative 2)
> ==============
> As above, but:
> I consider changing / overwriting the default distributions dll.conf
> undesirable. We could even prepend a user to dll.conf (user-dlll.conf)
> even when no  if the new env. var SANE_DLL_PREFIX is not defined and use
> that (if the file exists) but fallback to dll.conf if that does not
> exist.
> In this case I could leave the default dll.conf intact, but add a
> user-dll.conf that contains only the net backend from the scanbd package
> in addition to the sane-dll.conf (or whatever). This avoids having a
> file ownership issue with the standard dll.conf.


I can imagine to more alternatives:

3) use env-var SANE_CONFIG_FILE for getting the filename of the real 
dll.conf in the SANE_CONFIG_DIR

4) add a function to the programming interface to set the name / dir for 
the config-file (sane_init)

-- 
Wilhelm




More information about the sane-devel mailing list