]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix qcsrc genmod.sh including files twice
authorkiwixz <kiwixz@outlook.com>
Sat, 21 Jan 2023 23:24:23 +0000 (00:24 +0100)
committerkiwixz <kiwixz@outlook.com>
Mon, 6 Feb 2023 14:38:37 +0000 (15:38 +0100)
qcsrc/common/minigames/_mod.inc
qcsrc/common/minigames/_mod.qh
qcsrc/common/mutators/mutator/instagib/_mod.inc
qcsrc/common/mutators/mutator/instagib/_mod.qh
qcsrc/tools/genmod.sh

index 4171f475cd747c5c7bea37c8e026615dbbea11b1..a4cd98154e1d8d60a3cb959f43a66d51fd94045a 100644 (file)
@@ -1,7 +1,4 @@
 // generated file; do not modify
-#ifdef CSQC
-    #include <common/minigames/cl_minigames_hud.qc>
-#endif
 #include <common/minigames/minigames.qc>
 #ifdef CSQC
     #include <common/minigames/cl_minigames.qc>
@@ -9,5 +6,8 @@
 #ifdef SVQC
     #include <common/minigames/sv_minigames.qc>
 #endif
+#ifdef CSQC
+    #include <common/minigames/cl_minigames_hud.qc>
+#endif
 
 #include <common/minigames/minigame/_mod.inc>
index e0daf8f6775f01fa6c363b300b55f0c547f07987..c74ca54a164779b1b73474bb91022f9302158971 100644 (file)
@@ -1,7 +1,4 @@
 // generated file; do not modify
-#ifdef CSQC
-    #include <common/minigames/cl_minigames_hud.qh>
-#endif
 #include <common/minigames/minigames.qh>
 #ifdef CSQC
     #include <common/minigames/cl_minigames.qh>
@@ -9,5 +6,8 @@
 #ifdef SVQC
     #include <common/minigames/sv_minigames.qh>
 #endif
+#ifdef CSQC
+    #include <common/minigames/cl_minigames_hud.qh>
+#endif
 
 #include <common/minigames/minigame/_mod.qh>
index 2195111f0f269e2903f767e3badf17644e0aa27d..273779aa714645c08a122ff0a8fc0ebbcc69d58d 100644 (file)
@@ -1,5 +1,5 @@
 // generated file; do not modify
-#include <common/mutators/mutator/instagib/items.qc>
 #ifdef SVQC
     #include <common/mutators/mutator/instagib/sv_instagib.qc>
 #endif
+#include <common/mutators/mutator/instagib/items.qc>
index 7097eaf390dac022c2840f7db4d9dc6ee7028368..f799c56796f702e3dc1700f3e66fedcceb1cb5cf 100644 (file)
@@ -1,5 +1,5 @@
 // generated file; do not modify
-#include <common/mutators/mutator/instagib/items.qh>
 #ifdef SVQC
     #include <common/mutators/mutator/instagib/sv_instagib.qh>
 #endif
+#include <common/mutators/mutator/instagib/items.qh>
index a8dd08de57c838fccf84d20e5f0098938e8cd7ee..dc085018ea81c68d0ddf59f7dde978dfd42eb2b2 100755 (executable)
@@ -1,6 +1,8 @@
 #!/usr/bin/env bash
 set -eu
 
+export LC_ALL=C.UTF-8
+
 # This script creates / updates the _mod.qc / _mod.qh / _mod.inc files based on
 # the qc / qh files present in the qcsrc folder.
 
@@ -27,21 +29,16 @@ function genmod() {
     fi
     echo '// generated file; do not modify' > ${MOD}.inc
     echo '// generated file; do not modify' > ${MOD}.qh
-    for f in $(ls | sort -k 1,1 -t .); do
-          if [[ "$f" == cl_* ]]; then f="${f#cl_}"; if [[ -f "$f" ]]; then continue; fi
-        elif [[ "$f" == sv_* ]]; then f="${f#sv_}"; if [[ -f "$f" ]]; then continue; fi
-        elif [[ "$f" == ui_* ]]; then f="${f#ui_}"; if [[ -f "$f" ]]; then continue; fi
-        fi
-        if [[ "$f" == *.qc ]]; then
-            if [[ -f "$f" ]]; then echo -e "#include <${CTX}$f>" >> ${MOD}.inc; fi
-            if [[ -f "${f%.qc}.qh" ]]; then echo -e "#include <${CTX}${f%.qc}.qh>" >> ${MOD}.qh; fi
-            if [[ -f "cl_$f" ]]; then echo -e "#ifdef CSQC\n    #include <${CTX}cl_$f>\n#endif" >> ${MOD}.inc; fi
-            if [[ -f "cl_${f%.qc}.qh" ]]; then echo -e "#ifdef CSQC\n    #include <${CTX}cl_${f%.qc}.qh>\n#endif" >> ${MOD}.qh; fi
-            if [[ -f "sv_$f" ]]; then echo -e "#ifdef SVQC\n    #include <${CTX}sv_$f>\n#endif" >> ${MOD}.inc; fi
-            if [[ -f "sv_${f%.qc}.qh" ]]; then echo -e "#ifdef SVQC\n    #include <${CTX}sv_${f%.qc}.qh>\n#endif" >> ${MOD}.qh; fi
-            if [[ -f "ui_$f" ]]; then echo -e "#ifdef MENUQC\n    #include <${CTX}ui_$f>\n#endif" >> ${MOD}.inc; fi
-            if [[ -f "ui_${f%.qc}.qh" ]]; then echo -e "#ifdef MENUQC\n    #include <${CTX}ui_${f%.qc}.qh>\n#endif" >> ${MOD}.qh; fi
-        fi
+    for f in $(ls | sed -e "s/^cl_//" -e "s/^sv_//" -e "s/^ui_//" | sort -u); do
+        if [[ "$f" != *.qc ]]; then continue; fi
+        if [[ -f "$f" ]]; then echo -e "#include <${CTX}$f>" >> ${MOD}.inc; fi
+        if [[ -f "${f%.qc}.qh" ]]; then echo -e "#include <${CTX}${f%.qc}.qh>" >> ${MOD}.qh; fi
+        if [[ -f "cl_$f" ]]; then echo -e "#ifdef CSQC\n    #include <${CTX}cl_$f>\n#endif" >> ${MOD}.inc; fi
+        if [[ -f "cl_${f%.qc}.qh" ]]; then echo -e "#ifdef CSQC\n    #include <${CTX}cl_${f%.qc}.qh>\n#endif" >> ${MOD}.qh; fi
+        if [[ -f "sv_$f" ]]; then echo -e "#ifdef SVQC\n    #include <${CTX}sv_$f>\n#endif" >> ${MOD}.inc; fi
+        if [[ -f "sv_${f%.qc}.qh" ]]; then echo -e "#ifdef SVQC\n    #include <${CTX}sv_${f%.qc}.qh>\n#endif" >> ${MOD}.qh; fi
+        if [[ -f "ui_$f" ]]; then echo -e "#ifdef MENUQC\n    #include <${CTX}ui_$f>\n#endif" >> ${MOD}.inc; fi
+        if [[ -f "ui_${f%.qc}.qh" ]]; then echo -e "#ifdef MENUQC\n    #include <${CTX}ui_${f%.qc}.qh>\n#endif" >> ${MOD}.qh; fi
     done
     declare -l rec=1
     if [[ -f "_all.inc" ]]; then rec=0; fi