aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorJan Beich <[email protected]>2023-10-11 18:38:34 +0000
committerGitHub <[email protected]>2023-10-11 19:38:34 +0100
commit0cf3d5b39a04dd7690dd6bda33fb4bd1194437d9 (patch)
tree58a3ebb48f645fe20f5fbdca5d9da9d2096d4ed0 /scripts
parent34455844e9ac623e68375bb007535cdf979f2a02 (diff)
downloadHyprland-0cf3d5b39a04dd7690dd6bda33fb4bd1194437d9.tar.gz
Hyprland-0cf3d5b39a04dd7690dd6bda33fb4bd1194437d9.zip
build: Unbreak Meson build on FreeBSD (#3549)
* generateVersion.sh: move cp(1) flags before arguments POSIX and BSD cp(1) don't support flags after arguments e.g., cp: -fr is not a directory * generateVersion.sh: switch to sed(1) -i for better compatibility On BSDs awk is usually The One True Awk thus doesn't support `-i inplace`. awk: unknown option -i ignored awk: can't open file {sub(/@HASH@/,"1234567890abcdef")}1 source line number 1
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/generateVersion.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/scripts/generateVersion.sh b/scripts/generateVersion.sh
index 01bf1539..c54e2ebd 100755
--- a/scripts/generateVersion.sh
+++ b/scripts/generateVersion.sh
@@ -1,14 +1,14 @@
#!/bin/sh
-cp ./src/version.h.in ./src/version.h -fr
+cp -fr ./src/version.h.in ./src/version.h
HASH=$(git rev-parse HEAD)
BRANCH=$(git rev-parse --abbrev-ref HEAD)
MESSAGE=$(git show ${GIT_COMMIT_HASH} | head -n 5 | tail -n 1 | sed -e 's/#//g' -e 's/\"//g')
-DIRTY=$(git diff-index --quiet HEAD -- || echo \"dirty\")
+DIRTY=$(git diff-index --quiet HEAD -- || echo dirty)
TAG=$(git describe --tags)
-awk -i inplace "{sub(/@HASH@/,\"${HASH}\")}1" ./src/version.h
-awk -i inplace "{sub(/@BRANCH@/,\"${BRANCH}\")}1" ./src/version.h
-awk -i inplace "{sub(/@MESSAGE@/,\"${MESSAGE}\")}1" ./src/version.h
-awk -i inplace "{sub(/@DIRTY@/,\"${DIRTY}\")}1" ./src/version.h
-awk -i inplace "{sub(/@TAG@/,\"${TAG}\")}1" ./src/version.h \ No newline at end of file
+sed -i -e "s#@HASH@#${HASH}#" ./src/version.h
+sed -i -e "s#@BRANCH@#${BRANCH}#" ./src/version.h
+sed -i -e "s#@MESSAGE@#${MESSAGE}#" ./src/version.h
+sed -i -e "s#@DIRTY@#${DIRTY}#" ./src/version.h
+sed -i -e "s#@TAG@#${TAG}#" ./src/version.h \ No newline at end of file