=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/remove.c,v retrieving revision 1.2 retrieving revision 1.3 diff -c -r1.2 -r1.3 *** src/usr.bin/cvs/remove.c 2005/01/31 16:49:28 1.2 --- src/usr.bin/cvs/remove.c 2005/03/09 15:24:36 1.3 *************** *** 1,4 **** ! /* $OpenBSD: remove.c,v 1.2 2005/01/31 16:49:28 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * Copyright (c) 2004 Xavier Santolaria --- 1,4 ---- ! /* $OpenBSD: remove.c,v 1.3 2005/03/09 15:24:36 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * Copyright (c) 2004 Xavier Santolaria *************** *** 46,51 **** --- 46,52 ---- int cvs_remove_file (CVSFILE *, void *); + int force_remove = 0; /* -f option */ /* * cvs_remove() *************** *** 62,67 **** --- 63,69 ---- while ((ch = getopt(argc, argv, "flR")) != -1) { switch (ch) { case 'f': + force_remove = 1; break; case 'l': break; *************** *** 151,156 **** --- 153,167 ---- if (ent != NULL) ret = cvs_sendentry(root, ent); } else { + /* if -f option is used, physically remove the file */ + if (force_remove == 1) { + if((unlink(fpath) == -1) && (errno != ENOENT)) { + cvs_log(LP_ERRNO, "failed to unlink `%s'", + fpath); + return (-1); + } + } + cvs_log(LP_INFO, "scheduling file `%s' for removal", CVS_FILE_NAME(cf)); cvs_log(LP_INFO,