[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 Fri, Jun 01, 2007 at 12:55:57AM +0200, Santiago Vila wrote:
> I wonder why do we need a file to tell the user about the contents of
> his /etc/apt/sources.list file. Have you read "How do I know which
> distribution I'm running?" in base-files FAQ? The answer is still
> valid for *any* file which is part of an installed package.

We are not telling the user, we are telling *programs* what environment they
are in. Reading /etc/apt/sources.list is useless. Let me give you some use

- a sysadmin running 'woody', upgraded to 'sarge' by changing his
  /etc/apt/sources.list to point to 'stable'. But has not upgraded the system
  after etch was released
    /etc/debian_version   -> CORRECT   info
    /etc/apt/sources.list -> INCORRECT info

- a sysadmin running 'sarge' modifies his /etc/apt/sources.list to point to
  'etch', but never upgrades the system. 
    /etc/debian_version   -> CORRECT   info
    /etc/apt/sources.list -> INCORRECT info
- a sysadmin installed 'etch' using d-i, and upgraded it after December 11th 
  but has not upgraded it before April 10th.
    /etc/debian_version   -> INCORRECT info (4.0 when it is testing)
    /etc/apt/sources.list -> CORRECT info
- a sysadmin installs 'lenny' using d-i, April 9th. But never upgraded
  before that.
    /etc/debian_version   -> INCORRECT info (4.0 when it is testing)
    /etc/apt/sources.list -> CORRECT info ('testing')
Sources.list does not indicate the release the system is running but,
actually, the release the system would be running *if* it was up-to-date and

Moreso, it's completely useless for (some) systems that have been installed from
CD-ROM and do not point to the security mirrors.

It is useful *in*addition* to /etc/debian_version to make a guess and try to
tell apart testing vs. unstable. 

> I really don't understand what you guys want to achieve that might be both
> necessary and really useful (as opposed to just "being a nice thing").

We are trying to simplify the problem some applications might have (not
necessarily those shipped in Debian proper, maybe even for applications that
are for other vendors) in order to determine which system they are in and
take proper action. The problem that was originally stated at the start of
the thread.

The best approach we can provide ('use lsb_release') is prone to errors if
used in the timeframe of a release and, even for some other situations.

In any case, you said [1] there was some (programmatic) way to determine
which Debian release (or even 'non-release') an application is running one
which does not depend on /etc/debian_release. I would be happy to know which
one that is (so that it can be implemented in lsb_release).



[1] Message-ID: <None.LNX.4.64.0705310031500.11781@cantor.unex.es>

Attachment: signature.asc
Description: Digital signature

Reply to: