From 94e477e466bb368efd2a8bee056c94a1547616e1 Mon Sep 17 00:00:00 2001 From: Dale Weiler Date: Thu, 12 Sep 2013 17:06:20 -0400 Subject: [PATCH] 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. --- main.c | 8 ++++++-- misc/check-doc.sh | 8 +++++++- misc/xonotic_export.sh | 3 +-- opts.c | 1 + opts.def | 1 + 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index 33bde55..fa245a9 100644 --- a/main.c +++ b/main.c @@ -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; } diff --git a/misc/check-doc.sh b/misc/check-doc.sh index e5ffdee..da0c4cf 100755 --- a/misc/check-doc.sh +++ b/misc/check-doc.sh @@ -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 diff --git a/misc/xonotic_export.sh b/misc/xonotic_export.sh index 775cf05..ed09a39 100755 --- a/misc/xonotic_export.sh +++ b/misc/xonotic_export.sh @@ -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 diff --git a/opts.c b/opts.c index 4f6660e..3e7e207 100644 --- a/opts.c +++ b/opts.c @@ -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); diff --git a/opts.def b/opts.def index 977272a..ee40cf5 100644 --- a/opts.def +++ b/opts.def @@ -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 */ -- 2.39.2