From 445e2ee4d169b33cf5f46aab20905c9d130dc3d1 Mon Sep 17 00:00:00 2001 From: TimePath Date: Mon, 14 Mar 2016 19:34:43 +1100 Subject: [PATCH] Move scripts to qcsrc/tools --- qcsrc/Makefile | 6 +++--- qcsrc/common/monsters/monster/mage.qc | 2 +- qcsrc/common/mutators/mutator/itemstime.qc | 2 +- qcsrc/{ => tools}/autocvarize-update.sh | 0 qcsrc/{ => tools}/autocvarize.pl | 0 qcsrc/{test => tools}/compilationunits.sh | 0 qcsrc/{test => tools}/headerstyle.sh | 0 qcsrc/{ => tools}/qcc.sh | 0 qcsrc/{ => tools}/uncrusticracy.sh | 0 qcsrc/{ => tools}/uncrustify.sh | 0 qcsrc/tools/whitespace.sh | 19 +++++++++++++++++++ qcsrc/whitespace.sh | 8 -------- 12 files changed, 24 insertions(+), 13 deletions(-) rename qcsrc/{ => tools}/autocvarize-update.sh (100%) rename qcsrc/{ => tools}/autocvarize.pl (100%) rename qcsrc/{test => tools}/compilationunits.sh (100%) rename qcsrc/{test => tools}/headerstyle.sh (100%) rename qcsrc/{ => tools}/qcc.sh (100%) rename qcsrc/{ => tools}/uncrusticracy.sh (100%) rename qcsrc/{ => tools}/uncrustify.sh (100%) create mode 100755 qcsrc/tools/whitespace.sh delete mode 100755 qcsrc/whitespace.sh diff --git a/qcsrc/Makefile b/qcsrc/Makefile index f6cdc7c20..e149f001e 100644 --- a/qcsrc/Makefile +++ b/qcsrc/Makefile @@ -99,15 +99,15 @@ export QCCFLAGS $(PROGS_OUT)/csprogs.dat: client/progs.inc $(QCCVERSIONFILE) | $(WORKDIR) @ echo make[1]: Entering directory \`$(CURDIR)/client\' - @ ./qcc.sh client $@ $< + @ ./tools/qcc.sh client $@ $< -include $(WORKDIR)/client.d $(PROGS_OUT)/progs.dat: server/progs.inc $(QCCVERSIONFILE) | $(WORKDIR) @ echo make[1]: Entering directory \`$(CURDIR)/server\' - @ ./qcc.sh server $@ $< + @ ./tools/qcc.sh server $@ $< -include $(WORKDIR)/server.d $(PROGS_OUT)/menu.dat: menu/progs.inc $(QCCVERSIONFILE) | $(WORKDIR) @ echo make[1]: Entering directory \`$(CURDIR)/menu\' - @ ./qcc.sh menu $@ $< + @ ./tools/qcc.sh menu $@ $< -include $(WORKDIR)/menu.d diff --git a/qcsrc/common/monsters/monster/mage.qc b/qcsrc/common/monsters/monster/mage.qc index c71e8c911..0bf1a835e 100644 --- a/qcsrc/common/monsters/monster/mage.qc +++ b/qcsrc/common/monsters/monster/mage.qc @@ -326,7 +326,7 @@ void M_Mage_Attack_Teleport(entity this, entity targ) Send_Effect(EFFECT_SPAWN_NEUTRAL, this.origin, '0 0 0', 1); Send_Effect(EFFECT_SPAWN_NEUTRAL, newpos, '0 0 0', 1); - + setorigin(this, newpos); vector a = vectoangles(targ.origin - this.origin); diff --git a/qcsrc/common/mutators/mutator/itemstime.qc b/qcsrc/common/mutators/mutator/itemstime.qc index 408bd6fc8..f3612554d 100644 --- a/qcsrc/common/mutators/mutator/itemstime.qc +++ b/qcsrc/common/mutators/mutator/itemstime.qc @@ -366,7 +366,7 @@ void HUD_ItemsTime() FOREACH(Items, Item_ItemsTime_Allow(it) && ItemsTime_time[it.m_id] != -1, LAMBDA( id = it.m_id; icon = it.m_icon; - + :iteration float item_time = ItemsTime_time[id]; if (item_time < -1) diff --git a/qcsrc/autocvarize-update.sh b/qcsrc/tools/autocvarize-update.sh similarity index 100% rename from qcsrc/autocvarize-update.sh rename to qcsrc/tools/autocvarize-update.sh diff --git a/qcsrc/autocvarize.pl b/qcsrc/tools/autocvarize.pl similarity index 100% rename from qcsrc/autocvarize.pl rename to qcsrc/tools/autocvarize.pl diff --git a/qcsrc/test/compilationunits.sh b/qcsrc/tools/compilationunits.sh similarity index 100% rename from qcsrc/test/compilationunits.sh rename to qcsrc/tools/compilationunits.sh diff --git a/qcsrc/test/headerstyle.sh b/qcsrc/tools/headerstyle.sh similarity index 100% rename from qcsrc/test/headerstyle.sh rename to qcsrc/tools/headerstyle.sh diff --git a/qcsrc/qcc.sh b/qcsrc/tools/qcc.sh similarity index 100% rename from qcsrc/qcc.sh rename to qcsrc/tools/qcc.sh diff --git a/qcsrc/uncrusticracy.sh b/qcsrc/tools/uncrusticracy.sh similarity index 100% rename from qcsrc/uncrusticracy.sh rename to qcsrc/tools/uncrusticracy.sh diff --git a/qcsrc/uncrustify.sh b/qcsrc/tools/uncrustify.sh similarity index 100% rename from qcsrc/uncrustify.sh rename to qcsrc/tools/uncrustify.sh diff --git a/qcsrc/tools/whitespace.sh b/qcsrc/tools/whitespace.sh new file mode 100755 index 000000000..566233741 --- /dev/null +++ b/qcsrc/tools/whitespace.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -eu +cd "$(dirname "$0")" +cd .. + +function check() { + declare -l base="${1}" + find "$base" -type f -print0 | sort -z | xargs -0 sed -i \ + `# strip trailing spaces` \ + -e 's/[[:space:]]*$//' \ + `# line feed at EOF for #include to work properly` \ + -e '$a\' +} + +check lib +check common +check client +check server +check menu diff --git a/qcsrc/whitespace.sh b/qcsrc/whitespace.sh deleted file mode 100755 index ba16fd79e..000000000 --- a/qcsrc/whitespace.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -cd ${0%[\\/]*} -find . -name .git -prune -o -type f -print0 | \ - xargs -0 sed -i \ - `# strip trailing spaces` \ - -e 's/[[:space:]]*$//' \ - `# line feed at EOF for #include to work properly` \ - -e '$a\' -- 2.39.2