From: David Carlier Date: Mon, 4 Dec 2017 15:30:32 +0000 (+0000) Subject: On BSD systems, base sed is different than GNU's and does not work X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=78e76ca05b4e16d735ba34b4b730fb961361e694;p=xonotic%2Fxonotic-data.pk3dir.git On BSD systems, base sed is different than GNU's and does not work with those flags thus allowing to choose the package version. --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9e6a7b6cd..d2b9cdcee 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,6 @@ before_script: - ln -s $PWD data/xonotic-data.pk3dir + - export SED=sed - git clone --depth=1 --branch=master https://gitlab.com/xonotic/gmqcc.git gmqcc - cd gmqcc && make -j $(nproc) && export QCC="$PWD/gmqcc" diff --git a/cmake/qcc.sh b/cmake/qcc.sh index b7c77fd56..6dc963029 100755 --- a/cmake/qcc.sh +++ b/cmake/qcc.sh @@ -1,9 +1,10 @@ #!/usr/bin/env bash CPP=${CPP:-cpp} QCC=${QCC:-$PWD/../../gmqcc/gmqcc${CMAKE_EXECUTABLE_SUFFIX}} +SED=${SED} case $1 in compile) - ${CPP} ${@:3} | sed 's/^#\(line\)\? \([[:digit:]]\+\) "\(.*\)".*/\n#pragma file(\3)\n#pragma line(\2)/g' > $2 + ${CPP} ${@:3} | ${SED} 's/^#\(line\)\? \([[:digit:]]\+\) "\(.*\)".*/\n#pragma file(\3)\n#pragma line(\2)/g' > $2 ;; link) ${QCC} \ diff --git a/qcsrc/tools/qcc.sh b/qcsrc/tools/qcc.sh index 15cbfc4aa..0ea54cddf 100755 --- a/qcsrc/tools/qcc.sh +++ b/qcsrc/tools/qcc.sh @@ -8,6 +8,7 @@ QCC=${QCC} QCCIDENT="-DGMQCC" QCCDEFS=${QCCDEFS} QCCFLAGS=${QCCFLAGS} +SED=${SED} function qpp() { IN=$1 @@ -32,7 +33,7 @@ function qpp() { err=$? set -e if [ ${err} -ne 0 ]; then return ${err}; fi - sed 's/^#\(line\)\? \([[:digit:]]\+\) "\(.*\)".*/\n#pragma file(\3)\n#pragma line(\2)/g' "${WORKDIR}/${MODE}.txt" + ${SED} 's/^#\(line\)\? \([[:digit:]]\+\) "\(.*\)".*/\n#pragma file(\3)\n#pragma line(\2)/g' "${WORKDIR}/${MODE}.txt" } function qcc() {