[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Is there a way to positively, uniquely identify which Debian release a program is running on?

On Wed, May 30, 2007 at 10:12:38PM +0100, Stephen Gran wrote:
> The closest we ship is /etc/debian_version.  I use it for several
> similar tests at work, you just need to keep a mental map between the
> number and the version string.  If you can count lsb-release being
> installed, that will give you more information, or you could just look
> at the tests it performs to get an idea of how it distinguishes
> releases.

Only problem with /etc/debian_version is that you cannot distinguish testing
from sid and there's a timeframe (when base-files is updated, in which you
will confuse a 'sid' system with the next release). 

You can run 'lsb_release -a' a better estimate. Actually, it should be able
to cope derived distributions that have adapted /etc/lsb-release. The script
is provided by package lsb-release, but it's extra priority, so not bound to
be installed in most systems.

The script originally did not cope with the testing/unstable issue, see
#341231. Right now it should cope with most common cases but there might be
some weird situations in which it does not provide the correct answer. For
example: if a system's /etc/apt/sources.list is not properly configured,
if the system was installed ages ago with the 'testing' version of the
installer for the a current release (and has never been updated) or because
of weird setups (see #417145)

It also hardcodes the codename for testing, that's why bugs like #425646
popup just after a release.

I wonder if we should be shipping an /etc/lsb-release file? It was removed
from the lsb package (in 3.0-6, september 2005) but did not move over to



Attachment: signature.asc
Description: Digital signature

Reply to: