From: Nicholas Clark Date: Sat, 27 Dec 2008 21:01:02 +0000 (-0800) Subject: Tweak make_patchnum.sh to cope with /bin/sh on Solaris 9, in particular errors X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b6658357ff0e3ea0afe987ea5f36ea834a3adbcb;p=p5sagit%2Fp5-mst-13.2.git Tweak make_patchnum.sh to cope with /bin/sh on Solaris 9, in particular errors most hateful in the man page for test. --- diff --git a/make_patchnum.sh b/make_patchnum.sh index 2d83038..9a2f946 100644 --- a/make_patchnum.sh +++ b/make_patchnum.sh @@ -1,22 +1,22 @@ #!/bin/sh -. config.sh +. ./config.sh Existing=`cat .patchnum 2>/dev/null` Existing_Sha1=`cat .sha1 2>/dev/null` -if [ -e ".patch" ]; then +if test -s ".patch" ; then Current=`awk '{print $4}' .patch` Sha1=`awk '{print $3}' .patch` -elif [ -d ".git" ]; then +elif test -d ".git" ; then # we should do something better here Current=`git describe` Sha1=`git rev-parse HEAD` Changed=`git diff-index --name-only HEAD` - [ -n "$Changed" ] && Current="$Current-with-uncommitted-changes" + test -n "$Changed" && Current="$Current-with-uncommitted-changes" fi -if [ "$Existing" != "$Current" -o "$Existing_Sha1" != "$Sha1" ]; then +if test "$Existing" != "$Current" -o "$Existing_Sha1" != "$Sha1" ; then (echo "hi there\c" ; echo " ") >.echotmp if $contains c .echotmp >/dev/null 2>&1 ; then n='-n'