>From 73307aec482bd854213342e63679bf1c630ab4b1 Mon Sep 17 00:00:00 2001 From: Benutzer Date: Sat, 13 Jun 2015 14:14:01 +0200 Subject: [PATCH] modify identify.sh to make custom builds easier --- identify.sh | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/identify.sh b/identify.sh index ac9d052..fc123dc 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,24 @@ 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:="custom"} + 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 + -- 2.1.4