diff options
author | Rob Landley <rob@landley.net> | 2017-08-06 20:42:34 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2017-08-06 20:42:34 -0500 |
commit | 9bde24520215737f8706e911fcc7283f04185b66 (patch) | |
tree | a02f3fcb4d9d5d6b6cc48027971d845ed836c645 | |
parent | ec306e9244ffb5b6dfc82c0ef8a10be52d0e21e8 (diff) | |
download | toybox-9bde24520215737f8706e911fcc7283f04185b66.tar.gz |
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.
-rwxr-xr-x | scripts/make.sh | 2 |
1 files changed, 1 insertions, 1 deletions
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)" |