summaryrefslogtreecommitdiff
path: root/sysinfo
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-12-23 01:53:01 -0500
committermidipix <writeonce@midipix.org>2018-12-23 04:42:16 -0500
commit9c70b6479ce4f6d6d69026002293ee28532f0fb1 (patch)
treedbce0e181a3de2fd5c70b8a086fa68b4b2cb282a /sysinfo
parent833eb54f6c9bb6102fb1ccd233370edf47f9befd (diff)
downloadsbpython3-9c70b6479ce4f6d6d69026002293ee28532f0fb1.tar.bz2
sbpython3-9c70b6479ce4f6d6d69026002293ee28532f0fb1.tar.xz
build system: version.sh: set -eu, remove no-longer-needed exit statements.
Diffstat (limited to 'sysinfo')
-rwxr-xr-xsysinfo/version.sh8
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