summaryrefslogtreecommitdiffstats
path: root/src/wconfig.c
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1997-04-29 10:21:40 +0000
committerTheodore Tso <tytso@mit.edu>1997-04-29 10:21:40 +0000
commit74170ccf62d4d38d6b09a0540911641a901b226a (patch)
treebabbe34114c3d44a59a1609aee0dc48033bcfbc5 /src/wconfig.c
parent9a14be4b43854fbddc8e018f04a473e0fa2f51b0 (diff)
downloadkrb5-74170ccf62d4d38d6b09a0540911641a901b226a.tar.gz
krb5-74170ccf62d4d38d6b09a0540911641a901b226a.tar.xz
krb5-74170ccf62d4d38d6b09a0540911641a901b226a.zip
Makefile.in: Add MIT files to the windows zip file (if the mit
directory exists) wconfig.c (main): Add arguments to allow specification of the --mit, --nomit, --ignore=XXX options. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10077 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/wconfig.c')
-rw-r--r--src/wconfig.c56
1 files changed, 47 insertions, 9 deletions
diff --git a/src/wconfig.c b/src/wconfig.c
index 1974b863ef..0800396b22 100644
--- a/src/wconfig.c
+++ b/src/wconfig.c
@@ -40,22 +40,48 @@
#include <string.h>
static int copy_file (char *path, char *fname);
+void add_ignore_list(char *str);
+
+int mit_specific = 0;
int main(int argc, char *argv[])
{
+ char *ignore_str = "--ignore=";
+ int ignore_len;
+
+ ignore_len = strlen(ignore_str);
+ argc--; argv++;
+ while ((argc > 1) && *argv[0] == '-') {
+ if (!strcmp(*argv, "--mit")) {
+ mit_specific = 1;
+ argc--; argv++;
+ continue;
+ }
+ if (!strcmp(*argv, "--nomit")) {
+ mit_specific = 0;
+ argc--; argv++;
+ continue;
+ }
+ if (!strncmp(*argv, ignore_str, ignore_len)) {
+ add_ignore_list((*argv)+ignore_len);
+ argc--; argv++;
+ }
+ }
- if (argc == 2) /* Config directory given */
- copy_file (argv[1], "\\windows.in"); /* Send out prefix */
+ if (mit_specific)
+ add_ignore_list("MIT##");
+
+ if (argc > 0) /* Config directory given */
+ copy_file (*argv, "\\windows.in"); /* Send out prefix */
- copy_file("", "-");
+ copy_file("", "-");
- if (argc == 2) /* Config directory given */
- copy_file (argv[1], "\\win-post.in"); /* Send out postfix */
-
- return 0;
+ if (argc > 0) /* Config directory given */
+ copy_file (*argv, "\\win-post.in"); /* Send out postfix */
+ return 0;
}
-char *ignore_list[] = {
+char *ignore_list[32] = {
"DOS##",
"DOS",
#ifdef _MSDOS
@@ -64,8 +90,20 @@ char *ignore_list[] = {
#ifdef _WIN32
"WIN32##",
#endif
- 0
};
+
+/*
+ * Add a new item to the ignore list
+ */
+void add_ignore_list(char *str)
+{
+ char **cpp;
+
+ for (cpp = ignore_list; *cpp; cpp++)
+ ;
+ *cpp = str;
+}
+
/*
*