From 0a1180841b46b8a94e18ba91961805efea7024ce Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 23 Dec 2018 01:53:01 -0500 Subject: build system: version.sh: set -eu, remove no-longer-needed exit statements. --- sysinfo/version.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sysinfo') 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 -- cgit v1.2.3