From d20d57d2b888ce44ceff9d23f6e437c6fc76fe64 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sat, 16 Feb 2013 10:17:46 +0000 Subject: [PATCH] Don't send empty strings to `__parse_version_string`. --- bootstrap-salt.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 00e2ad4..6d81a7e 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -367,7 +367,8 @@ __gather_linux_system_info() { if [ -f /etc/lsb-release ]; then DISTRO_NAME=$(grep DISTRIB_ID /etc/lsb-release | sed -e 's/.*=//') - DISTRO_VERSION=$(__parse_version_string $(grep DISTRIB_RELEASE /etc/lsb-release | sed -e 's/.*=//')) + rv=$(grep DISTRIB_RELEASE /etc/lsb-release | sed -e 's/.*=//') + [ "${rv}x" != "x" ] && DISTRO_VERSION=$(__parse_version_string "$rv") fi if [ "x$DISTRO_NAME" != "x" ] && [ "x$DISTRO_VERSION" != "x" ]; then @@ -385,7 +386,9 @@ __gather_linux_system_info() { [ ! -f "/etc/${rsource}" ] && continue # Does not exist n=$(echo ${rsource} | sed -e 's/[_-]release$//' -e 's/[_-]version$//') - v=$( __parse_version_string "$( (grep VERSION /etc/${rsource}; cat /etc/${rsource}) | grep '[0-9]' | sed -e 'q' )" ) + rv=$( (grep VERSION /etc/${rsource}; cat /etc/${rsource}) | grep '[0-9]' | sed -e 'q' ) + [ "${rv}x" = "x" ] && continue # There's no version information. Continue to next rsource + v=$(__parse_version_string "$rv") case $(echo ${n} | tr '[:upper:]' '[:lower:]') in redhat ) if [ ".$(egrep 'CentOS' /etc/${rsource})" != . ]; then