File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -44,15 +44,21 @@ for dir in "${dirs[@]}"; do
44
44
exit 1
45
45
fi
46
46
# Let's try really hard to find the release name of the distribution
47
- distro_release=" $( source /etc/os-release; printf ${VERSION_CODENAME} ) "
48
- if [ -z " ${distro_release} " -a -n " $( grep ' VERSION_ID="14.04"' /etc/os-release) " ]; then
49
- distro_release=' trusty'
50
- fi
51
- if [ -z " ${distro_release} " ]; then
52
- distro_release=" $( perl -n -e ' /VERSION=".* \((.*)\)"/ && print $1' /etc/os-release) "
53
- fi
47
+ # Prefer something that sorts well over time
48
+ distro_release=" $( source /etc/os-release; [ ! -z ${ID} ] && [ ! -z ${VERSION_ID} ] && echo -n ${ID}${VERSION_ID} ) " # this will look like 'debian12' or 'ubuntu22.04'
54
49
if [ -z " ${distro_release} " ]; then
55
- distro_release=" $( perl -n -e ' /PRETTY_NAME="Debian GNU\/Linux (.*)\/sid"/ && print $1' /etc/os-release) "
50
+ # we should only end up here on Debian Testing
51
+ distro=" $( source /etc/os-release; echo -n ${ID} ) "
52
+ if [ ! -z " ${distro} " ]; then
53
+ releasename=" $( perl -n -e ' /PRETTY_NAME="Debian GNU\/Linux (.*)\/sid"/ && print $1' /etc/os-release) "
54
+ if [ ! -z " ${releasename} " ]; then
55
+ apt-get -y --no-install-recommends install distro-info-data
56
+ releasenum=" $( grep ${releasename} /usr/share/distro-info/debian.csv | cut -f1 -d,) "
57
+ if [ ! -z " ${releasenum} " ]; then
58
+ distro_release=" ${distro}${releasenum} "
59
+ fi
60
+ fi
61
+ fi
56
62
fi
57
63
if [ -z " ${distro_release} " ]; then
58
64
echo ' Unable to determine distribution codename!'
You can’t perform that action at this time.
0 commit comments