make.sh: Modify update-contributors so that it will run with older version of awk
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 29 Jan 2020 10:59:21 +0000 (11:59 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 29 Jan 2020 10:59:21 +0000 (11:59 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/credits.cgi
make.sh

index 6eb7f1e..f4f22e1 100644 (file)
@@ -85,8 +85,8 @@ Ersan Yildirim,
 Stephan Feddersen,
 Joern-Ingo Weigert,
 Alexander Koch,
-Wolfgang Apolinarski,
 St├ęphane Pautrel,
+Wolfgang Apolinarski,
 Alfred Haas,
 Lars Schuhmacher,
 Rene Zingel,
diff --git a/make.sh b/make.sh
index 452284c..02043cf 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -897,9 +897,14 @@ update_contributors() {
        local contributors="$(contributors | paste -sd , - | sed -e "s/,/&\\\\n/g")"
 
        # Edit contributors into credits.cgi
-       awk -i inplace \
-               "/<!-- CONTRIBUTORS -->/{ p=1; print; printf \"${contributors}\n\"}/<!-- END -->/{ p=0 } !p" \
-               "${BASEDIR}/html/cgi-bin/credits.cgi"
+       local tmp="$(mktemp)"
+
+       awk "/<!-- CONTRIBUTORS -->/{ p=1; print; printf \"${contributors}\n\"}/<!-- END -->/{ p=0 } !p" \
+               < "${BASEDIR}/html/cgi-bin/credits.cgi" > "${tmp}"
+
+       # Copy back modified content
+       cat "${tmp}" > "${BASEDIR}/html/cgi-bin/credits.cgi"
+       unlink "${tmp}"
 
        print_status DONE
        return 0