implementing PR

This commit is contained in:
Stephen Gaito 2020-07-22 12:29:18 +01:00
parent 5cde162633
commit 9fc875bbd1
1 changed files with 16 additions and 10 deletions

View File

@ -42,16 +42,22 @@ if [ -z "$PDF2HTMLEX_BRANCH" ]; then
fi
fi
if test -r /etc/lsb-release ; then
cat /etc/lsb-release
# source /etc/lsb-release
. /etc/lsb-release
export BUILD_DIST=$DISTRIB_CODENAME
export BUILD_OS=$DISTRIB_ID
elif test -r /etc/alpine-release ; then
cat /etc/alpine-release
export BUILD_OS=alpine
export BUILD_DIST=$(cat /etc/alpine-release)
# Following @ViliusSutkus89's suggestion in
# PR https://github.com/pdf2htmlEX/pdf2htmlEX/pull/77
# We have replaced the use of lsb-release/alpine-release
# with the freedesktop.org's os-release based system to
# obtain the distribution release information....
#
# See: https://www.freedesktop.org/software/systemd/man/os-release.html
#
if test -r /etc/os-release ; then
cat /etc/os-release
export BUILD_OS=$(grep '^ID=' /etc/os-release | cut -d'=' -f2)
export BUILD_DIST=$(grep '^VERSION_ID=' /etc/os-release | cut -d'=' -f2)
elif test -r /usr/lib/os-release ; then
cat /usr/lib/os-release
export BUILD_OS=$(grep '^ID=' /usr/lib/os-release | cut -d'=' -f2)
export BUILD_DIST=$(grep '^VERSION_ID=' /usr/lib/os-release | cut -d'=' -f2)
else
echo "FAILURE: could not determine release"
exit -1