summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2006-07-09 01:47:21 +0000
committerJoris Vink <joris@cvs.openbsd.org>2006-07-09 01:47:21 +0000
commit23d9e8e5405c501fceeb054f285d5968d1ba9114 (patch)
tree7beb49d05e4be7058e8c81034cde4372ec248370
parent9dc45c2d9db81ea578f057332e2b179f27cc8e66 (diff)
more straightforward trace (-t) output, too much is just too noisy.
-rw-r--r--usr.bin/cvs/client.c17
-rw-r--r--usr.bin/cvs/entries.c8
-rw-r--r--usr.bin/cvs/remote.c11
-rw-r--r--usr.bin/cvs/server.c26
-rw-r--r--usr.bin/cvs/util.c22
5 files changed, 24 insertions, 60 deletions
diff --git a/usr.bin/cvs/client.c b/usr.bin/cvs/client.c
index 9e09f74be79..baf3f4cda74 100644
--- a/usr.bin/cvs/client.c
+++ b/usr.bin/cvs/client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: client.c,v 1.11 2006/07/08 01:02:03 joris Exp $ */
+/* $OpenBSD: client.c,v 1.12 2006/07/09 01:47:20 joris Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -265,6 +265,7 @@ cvs_client_send_request(char *fmt, ...)
if (s != NULL)
*s = ' ';
+ cvs_log(LP_TRACE, "%s", data);
cvs_remote_output(data);
xfree(data);
}
@@ -304,8 +305,6 @@ cvs_client_senddir(const char *dir)
{
char *repo;
- cvs_log(LP_TRACE, "cvs_client_senddir(%s)", dir);
-
if (lastdir != NULL && !strcmp(dir, lastdir))
return;
@@ -332,8 +331,6 @@ cvs_client_sendfile(struct cvs_file *cf)
return;
cvs_client_senddir(cf->file_wd);
-
- cvs_log(LP_TRACE, "cvs_client_sendfile(%s)", cf->file_path);
cvs_remote_classify_file(cf);
if (cf->file_type == CVS_DIR)
@@ -409,14 +406,12 @@ cvs_client_send_files(char **argv, int argc)
void
cvs_client_ok(char *data)
{
- cvs_log(LP_TRACE, "cvs_client_ok()");
end_of_response = 1;
}
void
cvs_client_error(char *data)
{
- cvs_log(LP_TRACE, "cvs_client_error()");
end_of_response = 1;
}
@@ -470,8 +465,6 @@ cvs_client_checkedin(char *data)
struct cvs_ent *ent, *newent;
char *dir, *entry, rev[16], timebuf[64], sticky[16];
- cvs_log(LP_TRACE, "cvs_client_checkedin(%s)", data);
-
dir = cvs_remote_input();
entry = cvs_remote_input();
xfree(dir);
@@ -523,8 +516,6 @@ cvs_client_updated(char *data)
char timebuf[32], *repo, *rpath, *entry, *mode;
char revbuf[32], *len, *fpath, *wdir;
- cvs_log(LP_TRACE, "cvs_client_updated(%s)", data);
-
client_check_directory(data);
rpath = cvs_remote_input();
@@ -602,13 +593,11 @@ cvs_client_updated(char *data)
void
cvs_client_merged(char *data)
{
- cvs_log(LP_TRACE, "cvs_client_merged(%s)", data);
}
void
cvs_client_removed(char *data)
{
- cvs_log(LP_TRACE, "cvs_client_removed(%s)", data);
}
void
@@ -616,8 +605,6 @@ cvs_client_remove_entry(char *data)
{
char *dir;
- cvs_log(LP_TRACE, "cvs_client_remove_entry(%s)", data);
-
dir = cvs_remote_input();
xfree(dir);
}
diff --git a/usr.bin/cvs/entries.c b/usr.bin/cvs/entries.c
index 9b4a863b6e9..f51b96695d8 100644
--- a/usr.bin/cvs/entries.c
+++ b/usr.bin/cvs/entries.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: entries.c,v 1.60 2006/06/14 15:35:17 joris Exp $ */
+/* $OpenBSD: entries.c,v 1.61 2006/07/09 01:47:20 joris Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -252,7 +252,8 @@ cvs_ent_add(CVSENTRIES *ep, const char *line)
cvs_ent_free(ent);
- cvs_log(LP_TRACE, "cvs_ent_add(%s, %s)", ep->cef_path, line);
+ if (cvs_server_active == 0)
+ cvs_log(LP_TRACE, "cvs_ent_add(%s, %s)", ep->cef_path, line);
if ((fp = fopen(ep->cef_lpath, "a")) == NULL)
fatal("cvs_ent_add: failed to open '%s'", ep->cef_lpath);
@@ -274,7 +275,8 @@ cvs_ent_remove(CVSENTRIES *ep, const char *name)
FILE *fp;
struct cvs_ent_line *l;
- cvs_log(LP_TRACE, "cvs_ent_remove(%s, %s)", ep->cef_path, name);
+ if (cvs_server_active == 0)
+ cvs_log(LP_TRACE, "cvs_ent_remove(%s, %s)", ep->cef_path, name);
l = ent_get_line(ep, name);
if (l == NULL)
diff --git a/usr.bin/cvs/remote.c b/usr.bin/cvs/remote.c
index 8d39288e9eb..4b1943fcc83 100644
--- a/usr.bin/cvs/remote.c
+++ b/usr.bin/cvs/remote.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: remote.c,v 1.2 2006/07/08 00:34:20 joris Exp $ */
+/* $OpenBSD: remote.c,v 1.3 2006/07/09 01:47:20 joris Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -58,9 +58,6 @@ cvs_remote_output(const char *data)
else
out = current_cvsroot->cr_srvin;
- if (cvs_server_active == 0)
- cvs_log(LP_TRACE, "cvs_remote_output(%s)", data);
-
fputs(data, out);
fputs("\n", out);
}
@@ -116,8 +113,6 @@ cvs_remote_receive_file(size_t len)
else
in = current_cvsroot->cr_srvout;
- cvs_log(LP_TRACE, "cvs_remote_receive_file(%ld)", len);
-
data = xmalloc(len);
ret = fread(data, sizeof(char), len, in);
if (ret != len)
@@ -144,8 +139,6 @@ cvs_remote_send_file(const char *path)
else
out = current_cvsroot->cr_srvin;
- cvs_log(LP_TRACE, "cvs_remote_send_file(%s)", path);
-
if ((fd = open(path, O_RDONLY)) == -1)
fatal("cvs_remote_send_file: %s: %s", path, strerror(errno));
@@ -178,8 +171,6 @@ cvs_remote_classify_file(struct cvs_file *cf)
struct stat st;
CVSENTRIES *entlist;
- cvs_log(LP_TRACE, "cvs_remote_classify_file(%s)", cf->file_path);
-
entlist = cvs_ent_open(cf->file_wd);
cf->file_ent = cvs_ent_get(entlist, cf->file_name);
cvs_ent_close(entlist, ENT_NOSYNC);
diff --git a/usr.bin/cvs/server.c b/usr.bin/cvs/server.c
index b4ce702a00e..4c209842314 100644
--- a/usr.bin/cvs/server.c
+++ b/usr.bin/cvs/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.29 2006/07/07 17:37:17 joris Exp $ */
+/* $OpenBSD: server.c,v 1.30 2006/07/09 01:47:20 joris Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -145,6 +145,7 @@ cvs_server_send_response(char *fmt, ...)
if (s != NULL)
*s = ' ';
+ cvs_log(LP_TRACE, "%s", data);
cvs_remote_output(data);
xfree(data);
}
@@ -226,8 +227,6 @@ cvs_server_globalopt(char *data)
if (!strcmp(data, "-V"))
verbosity = 2;
-
- cvs_log(LP_TRACE, "cvs_server_globalopt(%s)", data);
}
void
@@ -237,8 +236,6 @@ cvs_server_directory(char *data)
CVSENTRIES *entlist;
char *dir, *repo, *parent, *entry, *dirn;
- cvs_log(LP_TRACE, "cvs_server_directory(%s)", data);
-
dir = cvs_remote_input();
if (strlen(dir) < strlen(current_cvsroot->cr_dir) + 1)
fatal("cvs_server_directory: bad Directory request");
@@ -276,8 +273,6 @@ cvs_server_entry(char *data)
{
CVSENTRIES *entlist;
- cvs_log(LP_TRACE, "cvs_server_entry(%s)", data);
-
entlist = cvs_ent_open(server_currentdir);
cvs_ent_add(entlist, data);
cvs_ent_close(entlist, ENT_SYNC);
@@ -293,8 +288,6 @@ cvs_server_modified(char *data)
const char *errstr;
char *mode, *len, *fpath;
- cvs_log(LP_TRACE, "cvs_server_modified(%s)", data);
-
mode = cvs_remote_input();
len = cvs_remote_input();
@@ -330,7 +323,6 @@ cvs_server_modified(char *data)
void
cvs_server_useunchanged(char *data)
{
- cvs_log(LP_TRACE, "cvs_server_useunchanged()");
}
void
@@ -342,8 +334,6 @@ cvs_server_unchanged(char *data)
struct cvs_ent *ent;
struct timeval tv[2];
- cvs_log(LP_TRACE, "cvs_server_unchanged(%s)", data);
-
fpath = xmalloc(MAXPATHLEN);
l = snprintf(fpath, MAXPATHLEN, "%s/%s", server_currentdir, data);
if (l == -1 || l >= MAXPATHLEN)
@@ -375,13 +365,11 @@ cvs_server_unchanged(char *data)
void
cvs_server_questionable(char *data)
{
- cvs_log(LP_TRACE, "cvs_server_questionable(%s)", data);
}
void
cvs_server_argument(char *data)
{
- cvs_log(LP_TRACE, "cvs_server_argument(%s)", data);
if (server_argc > CVS_CMD_MAXARG)
fatal("cvs_server_argument: too many arguments sent");
@@ -392,8 +380,6 @@ cvs_server_argument(char *data)
void
cvs_server_commit(char *data)
{
- cvs_log(LP_TRACE, "cvs_server_commit()");
-
if (chdir(server_currentdir) == -1)
fatal("cvs_server_commit: %s", strerror(errno));
@@ -405,8 +391,6 @@ cvs_server_commit(char *data)
void
cvs_server_diff(char *data)
{
- cvs_log(LP_TRACE, "cvs_server_diff()");
-
if (chdir(server_currentdir) == -1)
fatal("cvs_server_diff: %s", strerror(errno));
@@ -418,8 +402,6 @@ cvs_server_diff(char *data)
void
cvs_server_status(char *data)
{
- cvs_log(LP_TRACE, "cvs_server_status()");
-
if (chdir(server_currentdir) == -1)
fatal("cvs_server_status: %s", strerror(errno));
@@ -431,8 +413,6 @@ cvs_server_status(char *data)
void
cvs_server_log(char *data)
{
- cvs_log(LP_TRACE, "cvs_server_log()");
-
if (chdir(server_currentdir) == -1)
fatal("cvs_server_log: %s", strerror(errno));
@@ -444,8 +424,6 @@ cvs_server_log(char *data)
void
cvs_server_update(char *data)
{
- cvs_log(LP_TRACE, "cvs_server_update()");
-
if (chdir(server_currentdir) == -1)
fatal("cvs_server_update: %s", strerror(errno));
diff --git a/usr.bin/cvs/util.c b/usr.bin/cvs/util.c
index e87ce46dfbe..5e44155688a 100644
--- a/usr.bin/cvs/util.c
+++ b/usr.bin/cvs/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.89 2006/07/07 17:37:17 joris Exp $ */
+/* $OpenBSD: util.c,v 1.90 2006/07/09 01:47:20 joris Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* Copyright (c) 2005, 2006 Joris Vink <joris@openbsd.org>
@@ -417,7 +417,8 @@ cvs_chdir(const char *path, int rm)
int
cvs_rename(const char *from, const char *to)
{
- cvs_log(LP_TRACE, "cvs_rename(%s,%s)", from, to);
+ if (cvs_server_active == 0)
+ cvs_log(LP_TRACE, "cvs_rename(%s,%s)", from, to);
if (cvs_noexec == 1)
return (0);
@@ -438,7 +439,8 @@ cvs_rename(const char *from, const char *to)
int
cvs_unlink(const char *path)
{
- cvs_log(LP_TRACE, "cvs_unlink(%s)", path);
+ if (cvs_server_active == 0)
+ cvs_log(LP_TRACE, "cvs_unlink(%s)", path);
if (cvs_noexec == 1)
return (0);
@@ -466,7 +468,8 @@ cvs_rmdir(const char *path)
struct dirent *ent;
char fpath[MAXPATHLEN];
- cvs_log(LP_TRACE, "cvs_rmdir(%s)", path);
+ if (cvs_server_active == 0)
+ cvs_log(LP_TRACE, "cvs_rmdir(%s)", path);
if (cvs_noexec == 1)
return (0);
@@ -626,9 +629,10 @@ cvs_mkadmin(const char *path, const char *root, const char *repo,
struct stat st;
char buf[MAXPATHLEN];
- cvs_log(LP_TRACE, "cvs_mkadmin(%s, %s, %s, %s, %s, %d)",
- path, root, repo, (tag != NULL) ? tag : "",
- (date != NULL) ? date : "", nb);
+ if (cvs_server_active == 0)
+ cvs_log(LP_TRACE, "cvs_mkadmin(%s, %s, %s, %s, %s, %d)",
+ path, root, repo, (tag != NULL) ? tag : "",
+ (date != NULL) ? date : "", nb);
len = cvs_path_cat(path, CVS_PATH_CVSDIR, buf, sizeof(buf));
if (len >= sizeof(buf))
@@ -681,7 +685,9 @@ cvs_mkpath(const char *path)
dir = xstrdup(path);
STRIP_SLASH(dir);
- cvs_log(LP_TRACE, "cvs_mkpath(%s)", dir);
+
+ if (cvs_server_active == 0)
+ cvs_log(LP_TRACE, "cvs_mkpath(%s)", dir);
repo[0] = '\0';
rpath[0] = '\0';