version 1.3, 2005/05/17 08:16:03 |
version 1.4, 2005/05/19 15:31:35 |
|
|
{ |
{ |
FILE *fp; |
FILE *fp; |
int j, l; |
int j, l; |
|
char *wdir, cwd[MAXPATHLEN]; |
char buf[256], cdpath[MAXPATHLEN], dpath[MAXPATHLEN]; |
char buf[256], cdpath[MAXPATHLEN], dpath[MAXPATHLEN]; |
char updcmd[MAXPATHLEN]; /* XXX find a better size; malloc()?? */ |
char updcmd[MAXPATHLEN]; /* XXX find a better size; malloc()?? */ |
struct stat st; |
struct stat st; |
|
|
} |
} |
|
|
if (root->cr_method != CVS_METHOD_LOCAL) { |
if (root->cr_method != CVS_METHOD_LOCAL) { |
|
/* XXX kept for compat reason of `cvs update' output */ |
|
/* save current working directory for further use */ |
|
if ((wdir = getcwd(cwd, sizeof(cwd))) == NULL) |
|
cvs_log(LP_ERRNO, "cannot get current dir"); |
|
|
/* change dir before running the `cvs update' command */ |
/* change dir before running the `cvs update' command */ |
if (chdir(dpath) == -1) |
if (chdir(dpath) == -1) { |
|
cvs_log(LP_ERRNO, "cannot change to dir `%s'", |
|
dpath); |
return (-1); |
return (-1); |
|
} |
|
|
/* construct `cvs update' command */ |
/* construct `cvs update' command */ |
l = snprintf(updcmd, sizeof(updcmd), "%s %s %s update", |
l = snprintf(updcmd, sizeof(updcmd), "%s %s %s update", |
|
|
|
|
printf("You have [%d] altered file%s in this " |
printf("You have [%d] altered file%s in this " |
"repository.\n", j, j > 1 ? "s" : ""); |
"repository.\n", j, j > 1 ? "s" : ""); |
|
|
printf("Are you sure you want to release " |
printf("Are you sure you want to release " |
"%sdirectory `%s': ", |
"%sdirectory `%s': ", |
dflag ? "(and delete) " : "", dpath); |
dflag ? "(and delete) " : "", dpath); |
|
|
return (-1); |
return (-1); |
} |
} |
|
|
|
/* change back to original working dir */ |
|
if (chdir(wdir) == -1) { |
|
cvs_log(LP_ERRNO, "cannot change to original " |
|
"working dir `%s'", wdir); |
|
return (-1); |
|
} |
|
|
if (dflag == 1) { |
if (dflag == 1) { |
if (unlink(dpath) == -1) { |
if (cvs_remove_dir(dpath) != CVS_EX_OK) { |
cvs_log(LP_ERRNO, |
cvs_log(LP_ERRNO, |
"deletion of directory %s failed", |
"deletion of directory `%s' failed", |
dpath); |
dpath); |
return (-1); |
return (-1); |
} |
} |