Skip to content

Commit

Permalink
Support Ubuntu and Debian-derived OS using ID_LIKE in /etc/os-release (
Browse files Browse the repository at this point in the history
…#343)

* Support Ubuntu and Debian-derived OS using ID_LIKE in /etc/os-release

* Revert end of case correction.
  • Loading branch information
onepunchdan committed Jul 20, 2022
1 parent 3f6087c commit ff77019
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions deb-get
Expand Up @@ -2407,6 +2407,10 @@ esac
OS_CODENAME=$(lsb_release --codename --short)
if [ -e /etc/os-release ]; then
UPSTREAM_ID="$(grep "^ID=" /etc/os-release | cut -d'=' -f2)"
UPSTREAM_ID_LIKE="$(grep "^ID_LIKE=" /etc/os-release | cut -d'=' -f2 | sed s/\"//g | cut -d' ' -f1)"
if [ ! -z "$UPSTREAM_ID_LIKE" ]; then
UPSTREAM_ID=$UPSTREAM_ID_LIKE
fi
case "${UPSTREAM_ID}" in
debian) UPSTREAM_CODENAME=$(grep DEBIAN_CODENAME /etc/os-release | cut -d'=' -f2);;
ubuntu) UPSTREAM_CODENAME=$(grep UBUNTU_CODENAME /etc/os-release | cut -d'=' -f2);;
Expand Down

0 comments on commit ff77019

Please sign in to comment.