version 1.97, 2008/02/03 15:57:25 |
version 1.98, 2008/02/03 17:20:14 |
|
|
{ "", -1, NULL, 0 } |
{ "", -1, NULL, 0 } |
}; |
}; |
|
|
static void client_check_directory(char *); |
static void client_check_directory(char *, char *); |
static char *client_get_supported_responses(void); |
static char *client_get_supported_responses(void); |
static char *lastdir = NULL; |
static char *lastdir = NULL; |
static int end_of_response = 0; |
static int end_of_response = 0; |
|
|
} |
} |
|
|
static void |
static void |
client_check_directory(char *data) |
client_check_directory(char *data, char *repository) |
{ |
{ |
CVSENTRIES *entlist; |
CVSENTRIES *entlist; |
char entry[CVS_ENT_MAXLINELEN], *parent, *base; |
char entry[CVS_ENT_MAXLINELEN], *parent, *base, *p; |
|
|
STRIP_SLASH(data); |
STRIP_SLASH(data); |
|
|
|
/* first directory we get is our module root */ |
|
if (module_repo_root == NULL) { |
|
p = repository + strlen(current_cvsroot->cr_dir) + 1; |
|
module_repo_root = xstrdup(p); |
|
p = strrchr(module_repo_root, '/'); |
|
if (p != NULL) |
|
*p = '\0'; |
|
} |
|
|
cvs_mkpath(data, NULL); |
cvs_mkpath(data, NULL); |
|
|
if (cvs_cmdop == CVS_OP_EXPORT) |
if (cvs_cmdop == CVS_OP_EXPORT) |
|
|
struct timeval tv[2]; |
struct timeval tv[2]; |
char repo[MAXPATHLEN], entry[CVS_ENT_MAXLINELEN]; |
char repo[MAXPATHLEN], entry[CVS_ENT_MAXLINELEN]; |
char timebuf[CVS_TIME_BUFSZ], revbuf[CVS_REV_BUFSZ]; |
char timebuf[CVS_TIME_BUFSZ], revbuf[CVS_REV_BUFSZ]; |
char *en, *mode, *len, *fpath, *rpath, *wdir; |
char *en, *mode, *len, *rpath; |
char sticky[CVS_ENT_MAXLINELEN]; |
char sticky[CVS_ENT_MAXLINELEN], fpath[MAXPATHLEN]; |
|
|
if (data == NULL) |
if (data == NULL) |
fatal("Missing argument for Updated"); |
fatal("Missing argument for Updated"); |
|
|
client_check_directory(data); |
|
|
|
rpath = cvs_remote_input(); |
rpath = cvs_remote_input(); |
en = cvs_remote_input(); |
en = cvs_remote_input(); |
mode = cvs_remote_input(); |
mode = cvs_remote_input(); |
len = cvs_remote_input(); |
len = cvs_remote_input(); |
|
|
|
client_check_directory(data, rpath); |
cvs_get_repository_path(".", repo, MAXPATHLEN); |
cvs_get_repository_path(".", repo, MAXPATHLEN); |
|
|
STRIP_SLASH(repo); |
STRIP_SLASH(repo); |
|
|
if (strlen(repo) + 1 > strlen(rpath)) |
if (strlen(repo) + 1 > strlen(rpath)) |
fatal("received a repository path that is too short"); |
fatal("received a repository path that is too short"); |
|
|
fpath = rpath + strlen(repo) + 1; |
(void)xsnprintf(fpath, sizeof(fpath), "%s/%s", data, |
if ((wdir = dirname(fpath)) == NULL) |
strrchr(rpath, '/')); |
fatal("cvs_client_updated: dirname: %s", strerror(errno)); |
|
|
|
flen = strtonum(len, 0, INT_MAX, &errstr); |
flen = strtonum(len, 0, INT_MAX, &errstr); |
if (errstr != NULL) |
if (errstr != NULL) |
|
|
cvs_ent_free(e); |
cvs_ent_free(e); |
|
|
if (cvs_cmdop != CVS_OP_EXPORT) { |
if (cvs_cmdop != CVS_OP_EXPORT) { |
ent = cvs_ent_open(wdir); |
ent = cvs_ent_open(data); |
cvs_ent_add(ent, entry); |
cvs_ent_add(ent, entry); |
cvs_ent_close(ent, ENT_SYNC); |
cvs_ent_close(ent, ENT_SYNC); |
} |
} |
|
|
if (data == NULL) |
if (data == NULL) |
fatal("Missing argument for Merged"); |
fatal("Missing argument for Merged"); |
|
|
client_check_directory(data); |
|
|
|
rpath = cvs_remote_input(); |
rpath = cvs_remote_input(); |
entry = cvs_remote_input(); |
entry = cvs_remote_input(); |
mode = cvs_remote_input(); |
mode = cvs_remote_input(); |
len = cvs_remote_input(); |
len = cvs_remote_input(); |
|
|
|
client_check_directory(data, rpath); |
|
|
repo = xmalloc(MAXPATHLEN); |
repo = xmalloc(MAXPATHLEN); |
cvs_get_repository_path(".", repo, MAXPATHLEN); |
cvs_get_repository_path(".", repo, MAXPATHLEN); |
|
|
|
|
STRIP_SLASH(data); |
STRIP_SLASH(data); |
|
|
dir = cvs_remote_input(); |
dir = cvs_remote_input(); |
xfree(dir); |
|
tag = cvs_remote_input(); |
tag = cvs_remote_input(); |
|
|
if (cvs_cmdop == CVS_OP_EXPORT) |
if (cvs_cmdop == CVS_OP_EXPORT) |
goto out; |
goto out; |
|
|
client_check_directory(data); |
client_check_directory(data, dir); |
|
|
(void)xsnprintf(tagpath, MAXPATHLEN, "%s/%s", data, CVS_PATH_TAG); |
(void)xsnprintf(tagpath, MAXPATHLEN, "%s/%s", data, CVS_PATH_TAG); |
|
|
|
|
(void)fclose(fp); |
(void)fclose(fp); |
out: |
out: |
xfree(tag); |
xfree(tag); |
|
xfree(dir); |
} |
} |
|
|
void |
void |
|
|
STRIP_SLASH(data); |
STRIP_SLASH(data); |
|
|
dir = cvs_remote_input(); |
dir = cvs_remote_input(); |
xfree(dir); |
|
|
|
if (cvs_cmdop == CVS_OP_EXPORT) |
if (cvs_cmdop == CVS_OP_EXPORT) { |
|
xfree(dir); |
return; |
return; |
|
} |
|
|
client_check_directory(data); |
client_check_directory(data, dir); |
|
|
(void)xsnprintf(tagpath, MAXPATHLEN, "%s/%s", data, CVS_PATH_TAG); |
(void)xsnprintf(tagpath, MAXPATHLEN, "%s/%s", data, CVS_PATH_TAG); |
(void)unlink(tagpath); |
(void)unlink(tagpath); |
|
|
|
xfree(dir); |
} |
} |
|
|
|
|