distro script: Handle cases where a distribution's version string is empty

This commit is contained in:
Nils Steinger
2015-09-23 00:04:06 +02:00
parent 2f1b83bbae
commit c53b5ecdeb

View File

@@ -59,7 +59,13 @@ elif [ "${OS}" = "Linux" ] ; then
fi
# OSSTR="${OS} ${DIST} ${REV}(${PSEUDONAME} ${KERNEL} ${MACH})"
OSSTR="${DIST} ${REV}"
if [ -n "${REV}" ]
then
OSSTR="${DIST} ${REV}"
else
OSSTR="${DIST}"
fi
elif [ "${OS}" = "Darwin" ] ; then
if [ -f /usr/bin/sw_vers ] ; then
OSSTR=`/usr/bin/sw_vers|grep -v Build|sed 's/^.*:.//'| tr "\n" ' '`