Skip to content

Commit

Permalink
Use "expr substr" instead of "substr" which appears to be more portable.
Browse files Browse the repository at this point in the history
Fixes build problem on Blue Waters.
  • Loading branch information
dthain committed Jul 25, 2016
1 parent e39beeb commit 1fb823f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions configure
Expand Up @@ -36,7 +36,7 @@ fi

# `git archive` (man gitattributes(5)) fills this in, otherwise we do it manually...
COMMIT='$Format:%H$'
if [ "$(substr "$COMMIT" 1 1)" = '$' ]; then
if [ "$(expr substr "$COMMIT" 1 1)" = '$' ]; then
if [ "$GIT" = y ]; then
COMMIT="$(git rev-parse HEAD)"
else
Expand All @@ -54,7 +54,7 @@ fi

# The date is the commit date of the commit, or now if the working tree is dirty.
DATE='$Format:%ci$'
if [ "$(substr "$DATE" 1 1)" = '$' ]; then
if [ "$(expr substr "$DATE" 1 1)" = '$' ]; then
if [ "$GIT" = y ]; then
DATE="$(git log -1 --pretty=format:%ci HEAD)"
else
Expand All @@ -72,7 +72,7 @@ elif [ -n "$CCTOOLS_BRANCH" ]; then
BRANCH="$CCTOOLS_BRANCH"
else
BRANCH='$Format:%d$'
if [ "$(substr "$BRANCH" 1 1)" = '$' ]; then
if [ "$(expr substr "$BRANCH" 1 1)" = '$' ]; then
if [ "$GIT" = y ]; then
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
else
Expand All @@ -95,7 +95,7 @@ else
fi
fi

SOURCE="${BRANCH}:$(substr "$COMMIT" 1 8)${DIRTY}"
SOURCE="${BRANCH}:$(expr substr "$COMMIT" 1 8)${DIRTY}"
VERSION="$MAJOR.$MINOR.$MICRO [${SOURCE}]"

# Bourne shell is tricky when you use backtick command substitution backslash
Expand Down

0 comments on commit 1fb823f

Please sign in to comment.