Web lists-archives.com

Re: Debian testing - release number

I am rightly accused of relying too heavily on /etc/debian_version to
detect my running release. But it seems clear
to me that the "right", canonical way to detect this is to query the
installed package base to extract a version/release
number from a package name and/or version. So surely there is an
"approved" tool for doing that. Hopefully OTHER THAN
apt, aptitude, synaptic or apt-get; ideally simpler and easier to
script than that.
So what is that tool?
On Thu, Jul 5, 2018 at 1:08 PM Greg Wooledge <wooledg@xxxxxxxxxxx> wrote:
> On Thu, Jul 05, 2018 at 12:57:34PM -0500, David Wright wrote:
> > On Thu 05 Jul 2018 at 12:42:36 (-0400), Greg Wooledge wrote:
> > > On Thu, Jul 05, 2018 at 11:06:22AM -0500, David Wright wrote:
> > > > But if you're a sysadmin who has a script that wants/needs a version
> > > > *number* for any reason, then /etc/debian_version is the safest file
> > > > to modify.
> > >
> > > I strongly disagree.  The safest file to modify would be the broken
> > > shell script that needs a "release number".
> >
> > Would you explain what is unsafe about it and why /etc/debian_version
> > is a configuration file, or offer a sensible alternative.
> Your hypothetical case describes a shell script that is supposed to
> detect what version of Debian it's running on, for whatever reason.
> If this script doesn't know how to handle the string "testing/unstable"
> then it's doing a really crappy job of "supporting" Debian systems.