diff options
author | midipix <writeonce@midipix.org> | 2018-12-23 01:53:01 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2018-12-24 10:51:57 -0500 |
commit | 1d71100d9fd994d2b76c1c67d558c7dd20375d8b (patch) | |
tree | 2247c4cd0d7eff62af416d739fcc33e65e165c1b /sysinfo | |
parent | 00ade6a445779622d5a89c8720def7a7ce217ebe (diff) | |
download | bfirm-1d71100d9fd994d2b76c1c67d558c7dd20375d8b.tar.bz2 bfirm-1d71100d9fd994d2b76c1c67d558c7dd20375d8b.tar.xz |
build system: version.sh: set -eu, remove no-longer-needed exit statements.
Diffstat (limited to 'sysinfo')
-rwxr-xr-x | sysinfo/version.sh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sysinfo/version.sh b/sysinfo/version.sh index 1c1467a..1a73794 100755 --- a/sysinfo/version.sh +++ b/sysinfo/version.sh @@ -1,5 +1,7 @@ #!/bin/sh +set -eu + usage() { cat << EOF >&2 @@ -49,13 +51,13 @@ if [ -z "$srcdir" ] || [ -z "$output" ] || [ -z "$prefix" ]; then usage fi -cd "$srcdir" || exit 2 +cd "$srcdir" gitver=$(git rev-parse --verify HEAD 2>/dev/null) || gitver="unknown" macro=$(echo "$prefix"_GIT_VERSION | tr '[:lower:]' '[:upper:]') -cd "$workdir" || exit 2 -mkdir -p $(dirname "$output") || exit 2 +cd "$workdir" +mkdir -p $(dirname "$output") printf "#define $macro\t\"$gitver\"\n" > "$output" # all done |