[Oval-devel] Small current-status report

Javier Fernández-Sanguino Peña jfs at computer.org
Tue Jul 17 16:23:56 UTC 2007


On Tue, Jul 17, 2007 at 08:51:16PM +0500, Pavel Vinogradov wrote:
>   2007/7/17, Javier Fernández-Sanguino Peña <jfs at computer.org>:
> > Use lsb-release for this. However, you cannot use its package version but,
> > rather, have to parse the contents of the execution of 'lsb_release'. That or
> > read the contents of /etc/debian_version to determine the version you're in.
>   I try lsb_release on three machines with Debian, there result:

lsb_release is only available if the 'lsb-release' package is installed. It's
not part of the core distribution so you might not get consistent results.

> 
> > Notice that for non-released versions the contents of /etc/debian_version
> > are
> > useless. In this situations you should just check the package version.
>   In this case we need logic:
> debian_release = \d.\d -> check packages from appropriate section in data
> file.  else check packages from section with maximum number.

I think you could use a mixed dpkg and testfile check with the following
logic (which probably needs to be defined as an XML OVAL definition just like
it's done for RedHat or Solaris):

- Debian 3.1 ('sarge') release is installed if
    base-files DPKG version is >3.0 and <4.0
    AND
    /etc/debian_version matches ^3.1

- Debian 4.0 ('etch') release is installed if
    base-files DPKG version is >= 4.0 and <4.1
    AND
    /etc/debian_version matches ^4.0

- Debian testing or unstable release is installed if
    /etc/debian_version matches ^.*\/sid

Notice the AND, that is done to prevent matching Debian-derived distributions
which might have the same base-files package version but contain something
else in /etc/debian_version

Could you please generate the OVAL definitions for that and send them to the
list?

Regards

Javier



More information about the Oval-devel mailing list