summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/util.c
diff options
context:
space:
mode:
authorXavier Santolaria <xsa@cvs.openbsd.org>2005-09-15 17:01:11 +0000
committerXavier Santolaria <xsa@cvs.openbsd.org>2005-09-15 17:01:11 +0000
commit9a7decdb09c8a0a11df7822828b6c0a8d04479b9 (patch)
tree08faac020cd33049514757d647e33e7ab06f3072 /usr.bin/cvs/util.c
parentb591ca81646ecf1c39b2e12329b864596f3e67a3 (diff)
check in cvs_mkadmin() wether we need to create or not the
CVS/Tag file. Sync the rest of the code accordingly; OK joris@.
Diffstat (limited to 'usr.bin/cvs/util.c')
-rw-r--r--usr.bin/cvs/util.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/usr.bin/cvs/util.c b/usr.bin/cvs/util.c
index 0136acafeb8..bbc92f803e7 100644
--- a/usr.bin/cvs/util.c
+++ b/usr.bin/cvs/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.51 2005/09/05 19:29:42 xsa Exp $ */
+/* $OpenBSD: util.c,v 1.52 2005/09/15 17:01:10 xsa Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -419,7 +419,8 @@ cvs_freeargv(char **argv, int argc)
* Returns 0 on success, or -1 on failure.
*/
int
-cvs_mkadmin(const char *dpath, const char *rootpath, const char *repopath)
+cvs_mkadmin(const char *dpath, const char *rootpath, const char *repopath,
+ char *tag, char *date, int nb)
{
size_t l;
char path[MAXPATHLEN];
@@ -427,6 +428,9 @@ cvs_mkadmin(const char *dpath, const char *rootpath, const char *repopath)
CVSENTRIES *ef;
struct stat st;
+ cvs_log(LP_TRACE, "cvs_mkadmin(%s, %s, %s, %s, %s, %d)",
+ dpath, rootpath, repopath, tag ? tag : "", date ? date : "", nb);
+
l = cvs_path_cat(dpath, CVS_PATH_CVSDIR, path, sizeof(path));
if (l >= sizeof(path))
return (-1);
@@ -471,6 +475,9 @@ cvs_mkadmin(const char *dpath, const char *rootpath, const char *repopath)
(void)fclose(fp);
}
+ /* create CVS/Tag file (if needed) */
+ (void)cvs_write_tagfile(tag, date, nb);
+
return (0);
}
@@ -674,7 +681,7 @@ cvs_create_dir(const char *path, int create_adm, char *root, char *repo)
if (l >= sizeof(rpath))
goto done;
- if (cvs_mkadmin(d, root, rpath) < 0) {
+ if (cvs_mkadmin(d, root, rpath, NULL, NULL, 0) < 0) {
cvs_log(LP_ERR, "failed to create adm files");
goto done;
}