version 1.51, 2005/09/05 19:29:42 |
version 1.52, 2005/09/15 17:01:10 |
|
|
* Returns 0 on success, or -1 on failure. |
* Returns 0 on success, or -1 on failure. |
*/ |
*/ |
int |
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; |
size_t l; |
char path[MAXPATHLEN]; |
char path[MAXPATHLEN]; |
|
|
CVSENTRIES *ef; |
CVSENTRIES *ef; |
struct stat st; |
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)); |
l = cvs_path_cat(dpath, CVS_PATH_CVSDIR, path, sizeof(path)); |
if (l >= sizeof(path)) |
if (l >= sizeof(path)) |
return (-1); |
return (-1); |
|
|
(void)fclose(fp); |
(void)fclose(fp); |
} |
} |
|
|
|
/* create CVS/Tag file (if needed) */ |
|
(void)cvs_write_tagfile(tag, date, nb); |
|
|
return (0); |
return (0); |
} |
} |
|
|
|
|
if (l >= sizeof(rpath)) |
if (l >= sizeof(rpath)) |
goto done; |
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"); |
cvs_log(LP_ERR, "failed to create adm files"); |
goto done; |
goto done; |
} |
} |