[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?



[Javier Fernández-Sanguino Peña]
> Bastille uses it to distinguish releases. There seems to be others:

Using /etc/debian_version is not a good idea.  I know this because I
tried to let popularity-contest collect its content to see what
version of Debian were in use.  Here is the list of values from
2004-05-13:

  Release: Debian                             1
  Release: testing/unstable                3670
  Release: sid                                1
  Release: stable/testing                     3
  Release: unstable                           8
  Release: testing/sarge                      1
  Release: Testing/Kriller                    1
  Release: unknown                         1323
  Release: 3.0-bunk-1                         1
  Release: "Woody                             1
  Release: special                            1
  Release: sarge                              3
  Release: woody                              1
  Release: 3.1                                2
  Release: 3.0                               53
  Release: unstable/experimental              1
  Release: debian-sid-i386                    1
  Release: 2.2                                1
  Release: unstable/testing                   1
  Release: testing                            2
  Release: Sarge                              1
  Release:                                    3

As you can see, the values varies widely.  Based on this, we decided
it was useless, and stopped collecting the value.

When that is said, I believe it is a good idea to split the Debian
version into its own package like RedHat do it, to make sure the
version can be updated without updating all the other files in
base-files.  This would make it possible to fix the version in testing
without having to fix the version of all the other files in the
base-files package in /etc/.

The redhat-release package contain these files, and it is updated for
every minor release of redhat, making it easy to track the patch level
on redhat machines:

  pre@tux ~ $ rpm -qf /etc/redhat-release
  redhat-release-5Client-5.0.0.9
  pre@tux ~ $ rpm -ql redhat-release
  /etc/issue
  /etc/issue.net
  /etc/pki/rpm-gpg
  /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
  /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-test
  /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-auxiliary
  /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta
  /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-former
  /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
  /etc/redhat-release
  /etc/yum.repos.d/rhel-debuginfo.repo
  /usr/share/doc/redhat-release-5Client
  /usr/share/doc/redhat-release-5Client/EULA
  /usr/share/doc/redhat-release-5Client/GPL
  /usr/share/doc/redhat-release-5Client/autorun-template
  /usr/share/eula/eula.de_DE
  /usr/share/eula/eula.en_US
  /usr/share/eula/eula.es_ES
  /usr/share/eula/eula.fr_FR
  /usr/share/eula/eula.it_IT
  /usr/share/eula/eula.ja_JP
  /usr/share/eula/eula.ko_KR
  /usr/share/eula/eula.pt_BR
  /usr/share/eula/eula.ru_RU
  /usr/share/eula/eula.zh_CN
  /usr/share/firstboot/modules/eula.py
  /usr/share/firstboot/modules/eula.pyc
  /usr/share/firstboot/modules/eula.pyo

Happy hacking,
-- 
Petter Reinholdtsen



Reply to: