Hi Evgeni,
15 years ago you asked ...
On Wed, 20 Jan 2010 14:27:04 +0100 Evgeni Golov <evg...@debian.org> wrote:
Package: dkms
Version: 2.1.1.0-2
currently, when one wants to check whether a module is installed to dkms, one
has to call
dkms status -m <module> -v <version>
and look for any output.
dkms *has* a -q option, which makes it silent, but the exit code is always 0,
regardless of the state of the module (existant or not). I'd expect a non-zero
one when the package is not installed.
dkms status can be called in many ways:
dkms status
dkms status -k <kernel> [-a <arch>]
dkms status -m <module>
dkms status -m <module> -v <version>
dkms status -m <module> -v <version> -k <kernel> [-a <arch>]
All but the last may report a list of modules/versions/kernels,
therefore a single status code is less useful.
For the last, where you query a single module/version/kernel/arch combo,
you can have 4-5 states as a result:
unknown
added
built
installed
broken
(sometimes with some additional information attached)
That's also not too helpful if it is mapped into a single status code.
Therefore I'd rather add some querying subcommands if there are some
real-world usecases for that, e.g.
dkms is_module_installed -m <module> -v <version> -k <kernel> -a <arch>
with three possible results:
0, no output - true
1, no output - false
>1, error message - wrong query - too few or too many arguments
Andreas