From 7942a4e1d2c7f9c821cae968af1b156019372d2a Mon Sep 17 00:00:00 2001 From: sobomax Date: Wed, 19 Sep 2001 08:06:48 +0000 Subject: Various fixes and improvements: - fix harmless compiler's warnings (unused variables and missed prototype); - before refusing to delete package because "there are packages installed that require this package" check that packages in question is actually installed; - add new `-r' option to pkg_delete(8), which instructs it to delete not only packages specified at command line, but all packages that depend on specified packages as well. MFC after: 2 weeks --- usr.sbin/pkg_install/delete/main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'usr.sbin/pkg_install/delete/main.c') diff --git a/usr.sbin/pkg_install/delete/main.c b/usr.sbin/pkg_install/delete/main.c index 2dba240..5538838e 100644 --- a/usr.sbin/pkg_install/delete/main.c +++ b/usr.sbin/pkg_install/delete/main.c @@ -30,12 +30,13 @@ static const char rcsid[] = #include "lib.h" #include "delete.h" -static char Options[] = "adDfGhinp:vx"; +static char Options[] = "adDfGhinp:rvx"; char *Prefix = NULL; Boolean CleanDirs = FALSE; Boolean Interactive = FALSE; Boolean NoDeInstall = FALSE; +Boolean Recursive = FALSE; match_t MatchType = MATCH_GLOB; static void usage __P((void)); @@ -93,6 +94,10 @@ main(int argc, char **argv) Interactive = TRUE; break; + case 'r': + Recursive = TRUE; + break; + case 'h': case '?': default: @@ -148,7 +153,7 @@ static void usage() { fprintf(stderr, "%s\n%s\n", - "usage: pkg_delete [-dDfGinvx] [-p prefix] pkg-name ...", + "usage: pkg_delete [-dDfGinrvx] [-p prefix] pkg-name ...", " pkg_delete -a [flags]"); exit(1); } -- cgit v1.1