version 1.58, 2007/01/03 22:28:30 |
version 1.59, 2007/01/03 22:56:54 |
|
|
extern char *__progname; |
extern char *__progname; |
|
|
void cvs_remove_local(struct cvs_file *); |
void cvs_remove_local(struct cvs_file *); |
|
void cvs_remove_force(struct cvs_file *); |
|
|
static int force_remove = 0; |
static int force_remove = 0; |
static int removed = 0; |
static int removed = 0; |
|
|
|
|
cr.enterdir = NULL; |
cr.enterdir = NULL; |
cr.leavedir = NULL; |
cr.leavedir = NULL; |
|
cr.flags = flags; |
|
|
|
cr.fileproc = cvs_remove_force; |
|
if (argc > 0) |
|
cvs_file_run(argc, argv, &cr); |
|
else |
|
cvs_file_run(1, &arg, &cr); |
|
|
if (current_cvsroot->cr_method != CVS_METHOD_LOCAL) { |
if (current_cvsroot->cr_method != CVS_METHOD_LOCAL) { |
cr.fileproc = cvs_client_sendfile; |
cr.fileproc = cvs_client_sendfile; |
|
|
|
|
cr.fileproc = cvs_remove_local; |
cr.fileproc = cvs_remove_local; |
} |
} |
|
|
cr.flags = flags; |
|
|
|
if (argc > 0) |
if (argc > 0) |
cvs_file_run(argc, argv, &cr); |
cvs_file_run(argc, argv, &cr); |
else |
else |
|
|
} |
} |
|
|
void |
void |
|
cvs_remove_force(struct cvs_file *cf) |
|
{ |
|
if (cf->file_type != CVS_DIR) { |
|
if (force_remove == 1 && cvs_noexec == 0) { |
|
if (unlink(cf->file_path) == -1) |
|
fatal("cvs_remove_force: %s", strerror(errno)); |
|
(void)close(cf->fd); |
|
cf->fd = -1; |
|
} |
|
} |
|
} |
|
|
|
void |
cvs_remove_local(struct cvs_file *cf) |
cvs_remove_local(struct cvs_file *cf) |
{ |
{ |
int l; |
int l; |
|
|
cvs_log(LP_NOTICE, "nothing known about '%s'", |
cvs_log(LP_NOTICE, "nothing known about '%s'", |
cf->file_path); |
cf->file_path); |
return; |
return; |
} |
|
|
|
if (force_remove == 1 && cvs_noexec == 0) { |
|
if (unlink(cf->file_path) == -1) |
|
fatal("cvs_remove_local: %s", strerror(errno)); |
|
(void)close(cf->fd); |
|
cf->fd = -1; |
|
} |
} |
|
|
if (cf->fd != -1) { |
if (cf->fd != -1) { |