~ chicken-core (chicken-5) 726b770796e24745685fa042d571400d8f1332f1
commit 726b770796e24745685fa042d571400d8f1332f1 Author: felix <felix@call-with-current-continuation.org> AuthorDate: Tue Aug 23 13:50:14 2011 +0200 Commit: felix <felix@call-with-current-continuation.org> CommitDate: Tue Aug 23 13:50:14 2011 +0200 some changes based on suggestion by Joerg Wittenberger diff --git a/identify.sh b/identify.sh index a36afcf9..644ad35c 100644 --- a/identify.sh +++ b/identify.sh @@ -5,13 +5,16 @@ # usage: identify.sh SOURCEDIR -# make sure file exists anyway, since branchname is a special case if test \! -e "buildbranch"; then touch buildbranch fi +if test \! -e "buildid"; then + touch buildid +fi + rev0=`cat buildid || echo ""` -branchname0=`cat buildbranch || echo ""` +branchname0=`cat buildbranch` tag0=`cat buildtag.h || echo ""` buildtime=`date +%Y-%m-%d` host=`hostname` @@ -20,20 +23,24 @@ usys=`uname` if test -d "$1/.git"; then rev=`GIT_DIR="$1/.git" git rev-parse --short HEAD 2>/dev/null` branchname=`GIT_DIR="$1/.git" git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'` - tag="#define C_BUILD_TAG \"compiled ${buildtime} on ${host} (${usys})\"" - - case "${branchname}" in - "") branchname="";; - "(no branch)") branchname="";; - "master") branchname="";; - esac - if test "${rev0}" \!= "${rev}"; then - echo ${rev} >buildid - fi - if test "${branchname0}" \!= "${branchname}"; then - echo ${branchname} >buildbranch - fi - if test "${tag0}" \!= "${tag}"; then - echo ${tag} >buildtag.h - fi +fi + +tag="#define C_BUILD_TAG \"compiled ${buildtime} on ${host} (${usys})\"" + +case "${branchname}" in + "") branchname="";; + "(no branch)") branchname="";; + "master") branchname="";; +esac + +if test "${rev0}" \!= "${rev}"; then + echo ${rev} >buildid +fi + +if test "${branchname0}" \!= "${branchname}"; then + echo ${branchname} >buildbranch +fi + +if test "${tag0}" \!= "${tag}"; then + echo ${tag} >buildtag.h fiTrap