From 6b122985da19c08ea50a25226c726f2982680efb Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Wed, 11 Sep 2013 13:27:40 -0400 Subject: better checking and portability in read-dependencies and read-version --- tools/read-dependencies | 3 ++- tools/read-version | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/read-dependencies b/tools/read-dependencies index 87db5d83..3335f6a4 100755 --- a/tools/read-dependencies +++ b/tools/read-dependencies @@ -26,6 +26,7 @@ if [ ! -e "$REQUIRES" ]; then fi # Filter out comments and empty lines -DEPS=$(sed -n -e 's,#.*,,' -e '/./p' "$REQUIRES") || +DEPS=$(sed -n -e 's,#.*,,' -e '/./p' "$REQUIRES") && + [ -n "$DEPS" ] || fail "failed to read deps from '${REQUIRES}'" echo "$DEPS" | sort -d -f diff --git a/tools/read-version b/tools/read-version index c37228f8..3df0889b 100755 --- a/tools/read-version +++ b/tools/read-version @@ -25,7 +25,8 @@ if [ ! -e "$CHNG_LOG" ]; then fail "Unable to find 'ChangeLog' file located at '$CHNG_LOG'" fi -VERSION=$(sed -n '/^[0-9]\+[.][0-9]\+[.][0-9]\+:/ {s/://; p; :a;n; ba}' \ - "$CHNG_LOG") || +VERSION=$(sed -n '/^[0-9]\+[.][0-9]\+[.][0-9]\+:/ \ + {s/://; p; :a;n; ba; }' "$CHNG_LOG") && + [ -n "$VERSION" ] || fail "failed to get version from '$CHNG_LOG'" echo "$VERSION" -- cgit v1.2.3