Make the "-f" switch to pkg_delete(1) into a counter. Require two "-f"
switches to delete a package that has been preserved. Document this change.
This commit is contained in:
parent
e61a0cb520
commit
706a03ef9c
|
@ -1,11 +1,11 @@
|
|||
/* $NetBSD: main.c,v 1.25 2003/06/05 13:15:44 agc Exp $ */
|
||||
/* $NetBSD: main.c,v 1.26 2003/06/12 13:50:38 agc Exp $ */
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char *rcsid = "from FreeBSD Id: main.c,v 1.11 1997/10/08 07:46:48 charnier Exp";
|
||||
#else
|
||||
__RCSID("$NetBSD: main.c,v 1.25 2003/06/05 13:15:44 agc Exp $");
|
||||
__RCSID("$NetBSD: main.c,v 1.26 2003/06/12 13:50:38 agc Exp $");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -72,7 +72,7 @@ main(int argc, char **argv)
|
|||
break;
|
||||
|
||||
case 'f':
|
||||
Force = TRUE;
|
||||
Force += 1;
|
||||
break;
|
||||
|
||||
case 'F':
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
/* $NetBSD: perform.c,v 1.40 2003/01/10 11:55:45 agc Exp $ */
|
||||
/* $NetBSD: perform.c,v 1.41 2003/06/12 13:50:38 agc Exp $ */
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static const char *rcsid = "from FreeBSD Id: perform.c,v 1.15 1997/10/13 15:03:52 jkh Exp";
|
||||
#else
|
||||
__RCSID("$NetBSD: perform.c,v 1.40 2003/01/10 11:55:45 agc Exp $");
|
||||
__RCSID("$NetBSD: perform.c,v 1.41 2003/06/12 13:50:38 agc Exp $");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -233,7 +233,7 @@ require_delete(char *home, int tryall)
|
|||
Prefix ? "-p" : "",
|
||||
Prefix ? Prefix : "",
|
||||
Verbose ? "-v" : "",
|
||||
Force ? "-f" : "",
|
||||
(Force > 1) ? "-f -f" : (Force == 1) ? "-f" : "",
|
||||
NoDeInstall ? "-D" : "",
|
||||
CleanDirs ? "-d" : "",
|
||||
Fake ? "-n" : "",
|
||||
|
@ -550,7 +550,7 @@ pkg_do(char *pkg)
|
|||
}
|
||||
if (fexists(PRESERVE_FNAME)) {
|
||||
printf("Package `%s' is marked as not for deletion\n", pkg);
|
||||
if (!Force) {
|
||||
if (Force <= 1) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.\" $NetBSD: pkg_delete.1,v 1.27 2003/01/10 11:55:46 agc Exp $
|
||||
.\" $NetBSD: pkg_delete.1,v 1.28 2003/06/12 13:50:38 agc Exp $
|
||||
.\"
|
||||
.\" FreeBSD install - a package for the installation and maintenance
|
||||
.\" of non-core utilities.
|
||||
|
@ -151,7 +151,7 @@ option is given).
|
|||
If a package has been marked as a
|
||||
.Cm preserved
|
||||
package, it will not be able to be deleted
|
||||
(unless the
|
||||
(unless more than one occurrences of the
|
||||
.Fl f
|
||||
option is given).
|
||||
.Pp
|
||||
|
|
Loading…
Reference in New Issue