From 9bde24520215737f8706e911fcc7283f04185b66 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 6 Aug 2017 20:42:34 -0500 Subject: Check for .git before setting GITHASH. The GITHASH problem was building a tarball version under an existing git repo, where git describe found ../../../../.git so only call git if we have a .git directory in the source. --- scripts/make.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make.sh b/scripts/make.sh index 4893e22f..77e0e060 100755 --- a/scripts/make.sh +++ b/scripts/make.sh @@ -67,7 +67,7 @@ fi # Extract a list of toys/*/*.c files to compile from the data in $KCONFIG_CONFIG # (First command names, then filenames with relevant {NEW,OLD}TOY() macro.) -[ -z "$GITHASH" ] && GITHASH="$(git describe --tags --abbrev=12 2>/dev/null)" +[ -d ".git" ] && GITHASH="$(git describe --tags --abbrev=12 2>/dev/null)" [ ! -z "$GITHASH" ] && GITHASH="-DTOYBOX_VERSION=\"$GITHASH\"" TOYFILES="$($SED -n 's/^CONFIG_\([^=]*\)=.*/\1/p' "$KCONFIG_CONFIG" | xargs | tr ' [A-Z]' '|[a-z]')" TOYFILES="$(egrep -l "TOY[(]($TOYFILES)[ ,]" toys/*/*.c)" -- cgit v1.2.3