Added -progsrc commandline switch to specify progs.src files of different names. Cleaned up xonotic export script, fixed check-doc on linux systems by disabling mandoc check.

This commit is contained in:
Dale Weiler 2013-09-12 17:06:20 -04:00
parent 5bb245a33a
commit 94e477e466
5 changed files with 16 additions and 5 deletions

8
main.c
View file

@ -234,6 +234,10 @@ static bool options_parse(int argc, char **argv) {
OPTS_OPTION_U16(OPTION_MEMDUMPCOLS) = (uint16_t)strtol(memdumpcols, NULL, 10);
continue;
}
if (options_long_gcc("progsrc", &argc, &argv, &argarg)) {
OPTS_OPTION_STR(OPTION_PROGSRC) = argarg;
continue;
}
/* show defaults (like pathscale) */
if (!strcmp(argv[0]+1, "show-defaults")) {
@ -670,9 +674,9 @@ int main(int argc, char **argv) {
progs_src = true;
src = fs_file_open("progs.src", "rb");
src = fs_file_open(OPTS_OPTION_STR(OPTION_PROGSRC), "rb");
if (!src) {
con_err("failed to open `progs.src` for reading\n");
con_err("failed to open `%s` for reading\n", OPTS_OPTION_STR(OPTION_PROGSRC));
retval = 1;
goto cleanup;
}

View file

@ -42,4 +42,10 @@ check_opt FLAGS f
check_opt WARNS W
check_opt OPTIMIZATIONS O
for i in doc/*.1; do mandoc -Tlint -Wall "$i"; done
# TODO: linux version
if [ "$(uname -s)" != "Linux" ]; then
for i in doc/*.1;
do
mandoc -Tlint -Wall "$i";
done
fi

View file

@ -26,7 +26,6 @@ else
fi
echo -n "removing redundant files ... "
# remove redundant stuff
rm -f autocvarize.pl
rm -f autocvarize-update.sh
rm -f collect-precache.sh
@ -48,7 +47,7 @@ ls server/w_*.qc | cat >> menu.src
echo "complete"
echo -n "creating zip archive ... "
zip -r ../xonotic.zip * > /dev/null
zip -r -9 ../xonotic.zip * > /dev/null
echo "complete"
popd > /dev/null

1
opts.c
View file

@ -60,6 +60,7 @@ opts_cmd_t opts; /* command line options */
static void opts_setdefault(void) {
memset(&opts, 0, sizeof(opts_cmd_t));
OPTS_OPTION_BOOL(OPTION_CORRECTION) = true;
OPTS_OPTION_STR(OPTION_PROGSRC) = "progs.src";
/* warnings */
opts_set(opts.warn, WARN_UNUSED_VARIABLE, true);

View file

@ -129,6 +129,7 @@
GMQCC_DEFINE_FLAG(ADD_INFO)
GMQCC_DEFINE_FLAG(CORRECTION)
GMQCC_DEFINE_FLAG(STATISTICS)
GMQCC_DEFINE_FLAG(PROGSRC)
#endif
/* some cleanup so we don't have to */