Skip to content

Commit

Permalink
Merge pull request #72 from YoeDistro/kraj/master
Browse files Browse the repository at this point in the history
envsetup.sh: Widen logic for BUILDHOST_DISTRO to consider more distros
  • Loading branch information
cbrake authored Dec 3, 2018
2 parents c568bd4 + 00da40e commit 9483ec1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion envsetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,16 @@ if [ -f local.sh ]; then
echo "reading local settings"
. ./local.sh
fi
BUILDHOST_DISTRO=$(egrep -h '^ID=' /etc/*-release | sed 's#^ID=##')

if [ -e /etc/os-release ]; then
BUILDHOST_DISTRO=$(egrep -h '^ID=' /etc/os-release | sed 's#^ID=##')
elif [ -e /etc/redhat-release ]; then
BUILDHOST_DISTRO=$(cat /etc/redhat-release | sed 's/ .*//')
elif [ -e /etc/slackware-release ]; then
BUILDHOST_DISTRO=$(cat /etc/slackware-release | sed 's/ .*//')
elif type lsb_release >/dev/null 2>&1; then
BUILDHOST_DISTRO=$(lsb_release -a | egrep -h 'ID:' | sed 's#.*ID:\s##')
fi

if [ "${0##*/}" = "dash" ]; then
echo "dash shell is not supported"
Expand Down

0 comments on commit 9483ec1

Please sign in to comment.