~ chicken-core (chicken-5) 5639ad58ce7d30a87970e561e782d13e088a1064


commit 5639ad58ce7d30a87970e561e782d13e088a1064
Author:     Benutzer <Joerg.Wittenberger@softeyes.net>
AuthorDate: Sat Jun 13 14:14:01 2015 +0200
Commit:     Mario Domenech Goulart <mario.goulart@gmail.com>
CommitDate: Sat Jun 13 11:28:38 2015 -0300

    Modify identify.sh to make custom builds easier.
    
    Signed-off-by: Peter Bex <peter@more-magic.net>
    Signed-off-by: Mario Domenech Goulart <mario.goulart@gmail.com>

diff --git a/identify.sh b/identify.sh
index ac9d0529..5781991e 100755
--- a/identify.sh
+++ b/identify.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/sh -e
 #
 # identify.sh - check for .git directory and obtain checked out revision and branch
 #
@@ -21,20 +21,23 @@ 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})\""
+else
+    branchname=${branchname:-"custom"}
+    tag=${tag:-"#define C_BUILD_TAG \"compiled ${buildtime} on ${host} (${usys})\""}
+fi
 
-    case "${branchname}" in
-	"") branchname="";;
-        "(no branch)") branchname="";;
-	"master") branchname="";;
-	"release") branchname="";;
-    esac
-    if test "x${rev0}" \!= "x${rev}"; then
-	echo ${rev} >buildid
-    fi
-    if test "x${branchname0}" \!= "x${branchname}"; then
-	echo ${branchname} >buildbranch
-    fi
-    if test "x${tag0}" \!= "x${tag}"; then
-	echo ${tag} >buildtag.h
-    fi
+case "${branchname}" in
+    "") branchname="";;
+    "(no branch)") branchname="";;
+    "master") branchname="";;
+    "release") branchname="";;
+esac
+if test "x${rev0}" \!= "x${rev}"; then
+    echo ${rev} >buildid
+fi
+if test "x${branchname0}" \!= "x${branchname}"; then
+    echo ${branchname} >buildbranch
+fi
+if test "x${tag0}" \!= "x${tag}"; then
+    echo ${tag} >buildtag.h
 fi
Trap