Skip to content

Conversation

@iamjla
Copy link

@iamjla iamjla commented Apr 8, 2022

As mentioned in some issues #262 #270 #271
The debian codename resolving is somewhat broken.
This is a stable fix which works down to debian squeeze.

It may also work for ubuntu but this is only the debian integration.

Signed-off-by: Justin Landmann <justin.landmann@plusserver.com>
dist_version="jessie"
;;
esac
dist_version="$(sed -n 's/^VERSION_CODENAME=//p' < /etc/os-release )"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could take the same approach as get_distribution();

docker-install/install.sh

Lines 163 to 172 in 0225270

get_distribution() {
lsb_dist=""
# Every system that we officially support has /etc/os-release
if [ -r /etc/os-release ]; then
lsb_dist="$(. /etc/os-release && echo "$ID")"
fi
# Returning an empty string here should be alright since the
# case statements don't act unless you provide an actual value
echo "$lsb_dist"
}

if [ -r /etc/os-release ]; then
	lsb_dist="$(. /etc/os-release && echo "$VERSION_CODENAME")"
fi

However, I'm not sure how reliable codename is here, taking sid into account (on Debian); not sure if raspbian also uses sid, but if so, then it's likely that the codename doesn't always match the version.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct. Sid does not set the VERSION_CODENAME in /etc/os-release.
raspbian uses the codename of the next release "bookworm" or "testing" instead of sid.
However these versions are not present at download.docker.com which would let the script fail at that point. (or is there a testing/unstable repo?)

I would mimic the "lsb_dist=" style with the debian dist_version. lsb_dist would be for getting the os type while dist_version would get the debian/raspbian codename as ubuntu still behaves drifferent.

Suggested change
dist_version="$(sed -n 's/^VERSION_CODENAME=//p' < /etc/os-release )"
dist_version="$(. /etc/os-release && echo "$VERSION_CODENAME")"

Would that be alright?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants