deriving version numbers and codenames of (stable,testing,unstable,experimental,oldstable)

I need a script that (1) connects to debian.org and (2) prints out
version number and codename that TODAY corresponds to each of
the labels {stable,testing,unstable,experimental,oldstable}.
Like this:

stable etch 4.0
oldstable sarge 3.0
testing porrige 124.567

This must be easy thing, can't find where this info is on debian.org.

Thanks
Yakov

0

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: deriving version numbers and codenames of (stable,testing,un

You can rely on Release files:

For instance, you can save the following as suites.sh:

#!/bin/sh

SUITES="stable testing oldstable unstable experimental"

if [ ! -z "$*" ] ; then
SUITES="$*"
fi

for i in $SUITES
do
wget -q -O - ftp://ftp.debian.org/debian/dists/$i/Release | \
grep '^Suite:\|^Codename:\|^Version:'
done

# End of suites.sh

Running sh suites.sh will output:

Suite: stable
Version: 4.0r0
Codename: etch
Suite: testing
Codename: lenny
Suite: oldstable
Version: 3.1r6
Codename: sarge
Suite: unstable
Codename: sid
Suite: experimental
Codename: experimental

You should note however that:
* only stable and oldstable have version numbers;
* unstable always has codename sid;
* experimental always has codename experimental.
So this script is only really useful for stable, testing and oldstable.

You can give suite names as arguments of suites.sh:

$ sh suites.sh testing oldstable
Suite: testing
Codename: lenny
Suite: oldstable
Version: 3.1r6
Codename: sarge

Syndicate content