diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-05-31 13:05:38 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-05-31 13:05:38 +0000 |
commit | efcf3b76b7316be51cb8233e0d8be7ce88122879 (patch) | |
tree | 22097ade16d8e870e6e3197c55afb3399f1e69d1 | |
parent | 045684ca6b1bf4feb2a1a582c4e18625ef5c9a05 (diff) |
retain -Z options to rcs commands even though they do not work (rcs
commands spawn children which do not inherit the -Z option...) but also
look in the RCSLOCALID environment variable. cvs sets this to "OpenBSD",
as read from the options file.
-rw-r--r-- | gnu/usr.bin/cvs/src/cvs.h | 1 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/src/main.c | 3 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/src/rcscmds.c | 6 | ||||
-rw-r--r-- | gnu/usr.bin/rcs/lib/rcskeys.c | 14 | ||||
-rw-r--r-- | gnu/usr.bin/rcs/lib/rcsutil.c | 15 |
5 files changed, 27 insertions, 12 deletions
diff --git a/gnu/usr.bin/cvs/src/cvs.h b/gnu/usr.bin/cvs/src/cvs.h index ac053441ec6..76b134967ad 100644 --- a/gnu/usr.bin/cvs/src/cvs.h +++ b/gnu/usr.bin/cvs/src/cvs.h @@ -416,7 +416,6 @@ extern int trace; /* Show all commands */ extern int noexec; /* Don't modify disk anywhere */ extern int readonlyfs; /* fail on all write locks; succeed all read locks */ extern int logoff; /* Don't write history entry */ -extern char *RCS_citag; /* special -Z tag for RCS */ extern char hostname[]; diff --git a/gnu/usr.bin/cvs/src/main.c b/gnu/usr.bin/cvs/src/main.c index 5808ca375cc..7265fc271ae 100644 --- a/gnu/usr.bin/cvs/src/main.c +++ b/gnu/usr.bin/cvs/src/main.c @@ -870,7 +870,8 @@ parseopts() *p = '\0'; if (!strncmp(buf, "tag=", 4)) { - RCS_citag = strdup(buf+4); + char *RCS_citag = strdup(buf+4); + setenv("RCSLOCALID", RCS_citag, 1); } else if (!strncmp(buf, "umask=", 6)) { int mode; diff --git a/gnu/usr.bin/cvs/src/rcscmds.c b/gnu/usr.bin/cvs/src/rcscmds.c index eabd1aec310..66aea57447a 100644 --- a/gnu/usr.bin/cvs/src/rcscmds.c +++ b/gnu/usr.bin/cvs/src/rcscmds.c @@ -17,8 +17,6 @@ -1 for error (and errno is set to indicate the error), positive for error (and an error message has been printed), or zero for success. */ -char *RCS_citag; - int RCS_settag(path, tag, rev) const char *path; @@ -150,8 +148,6 @@ RCS_checkout (rcsfile, workfile, tag, options, sout, flags, noerr) run_arg ("-l"); if (flags & RCS_FLAGS_FORCE) run_arg ("-f"); - if (RCS_citag) - run_arg (RCS_citag); run_arg (rcsfile); if (workfile != NULL && workfile[0] != '\0') run_arg (workfile); @@ -184,8 +180,6 @@ RCS_checkin (rcsfile, workfile, message, rev, flags, noerr) run_arg ("-q"); if (flags & RCS_FLAGS_MODTIME) run_arg ("-d"); - if (RCS_citag) - run_arg (RCS_citag); run_args ("-m%s", make_message_rcslegal (message)); if (workfile != NULL) run_arg (workfile); diff --git a/gnu/usr.bin/rcs/lib/rcskeys.c b/gnu/usr.bin/rcs/lib/rcskeys.c index e43546c765a..24a0c2f1ec8 100644 --- a/gnu/usr.bin/rcs/lib/rcskeys.c +++ b/gnu/usr.bin/rcs/lib/rcskeys.c @@ -27,6 +27,12 @@ Report problems and direct all questions to: */ /* $Log: rcskeys.c,v $ +/* Revision 1.3 1996/05/31 13:04:51 deraadt +/* retain -Z options to rcs commands even though they do not work (rcs +/* commands spawn children which do not inherit the -Z option...) but also +/* look in the RCSLOCALID environment variable. cvs sets this to "OpenBSD", +/* as read from the options file. +/* /* Revision 1.2 1996/04/19 12:40:09 mickey /* -L<string> option added to support LOCALID behaviour. /* maybe set up in RCSINIT environment variable. @@ -69,7 +75,7 @@ Report problems and direct all questions to: #include "rcsbase.h" -libId(keysId, "$Id: rcskeys.c,v 1.2 1996/04/19 12:40:09 mickey Exp $") +libId(keysId, "$Id: rcskeys.c,v 1.3 1996/05/31 13:04:51 deraadt Exp $") char local_id[keylength+1]; char const *Keyword[] = { @@ -85,10 +91,16 @@ char const *Keyword[] = { setRCSlocalId(string) char const *string; { + static int num; + if (strlen(string) > keylength) error("LocalId is too long"); strcpy(local_id, string); Keyword[LocalId] = local_id; + + if (num++) + setenv("RCSLOCALID", local_id, 1); + } enum markers diff --git a/gnu/usr.bin/rcs/lib/rcsutil.c b/gnu/usr.bin/rcs/lib/rcsutil.c index 4f55dfcfce1..cdf2ef7f738 100644 --- a/gnu/usr.bin/rcs/lib/rcsutil.c +++ b/gnu/usr.bin/rcs/lib/rcsutil.c @@ -31,8 +31,14 @@ Report problems and direct all questions to: /* * $Log: rcsutil.c,v $ - * Revision 1.1 1995/10/18 08:41:02 deraadt - * Initial revision + * Revision 1.2 1996/05/31 13:04:52 deraadt + * retain -Z options to rcs commands even though they do not work (rcs + * commands spawn children which do not inherit the -Z option...) but also + * look in the RCSLOCALID environment variable. cvs sets this to "OpenBSD", + * as read from the options file. + * + * Revision 1.1.1.1 1995/10/18 08:41:02 deraadt + * initial import of NetBSD tree * * Revision 1.5 1995/02/24 02:25:16 mycroft * RCS 5.6.7.4 @@ -167,7 +173,7 @@ Report problems and direct all questions to: #include "rcsbase.h" -libId(utilId, "$Id: rcsutil.c,v 1.1 1995/10/18 08:41:02 deraadt Exp $") +libId(utilId, "$Id: rcsutil.c,v 1.2 1996/05/31 13:04:52 deraadt Exp $") #if !has_memcmp int @@ -1066,6 +1072,9 @@ getRCSINIT(argc, argv, newargv) register char *p, *q, **pp; size_t n; + if (q = cgetenv("RCSLOCALID")) + setRCSlocalId(q); + if (!(q = cgetenv("RCSINIT"))) *newargv = argv; else { |