NavigationUser loginSpam?See spam posts on this site? If so, please don't reply to the spam! Instead, just report the URL to the webmaster. |
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 stable etch 4.0 This must be easy thing, can't find where this info is on debian.org. Thanks |
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