View | Details | Raw Unified | Return to bug 18373 | Differences between
and this patch

Collapse All | Expand All

(-)main.c (-3 / +12 lines)
Lines 28-38 Link Here
28
#include "lib.h"
28
#include "lib.h"
29
#include "delete.h"
29
#include "delete.h"
30
30
31
static char Options[] = "hvDdnfp:";
31
static char Options[] = "hvDdnfp:r";
32
32
33
char	*Prefix		= NULL;
33
char	*Prefix		= NULL;
34
Boolean	NoDeInstall	= FALSE;
34
Boolean	NoDeInstall	= FALSE;
35
Boolean	CleanDirs	= FALSE;
35
Boolean	CleanDirs	= FALSE;
36
Boolean	NeedRoot	= TRUE;
36
37
37
static void usage __P((void));
38
static void usage __P((void));
38
39
Lines 58-63 Link Here
58
	    Prefix = optarg;
59
	    Prefix = optarg;
59
	    break;
60
	    break;
60
61
62
	case 'r':
63
	    NeedRoot = FALSE;
64
	    break;
65
61
	case 'D':
66
	case 'D':
62
	    NoDeInstall = TRUE;
67
	    NoDeInstall = TRUE;
63
	    break;
68
	    break;
Lines 107-114 Link Here
107
    if (pkgs == start)
112
    if (pkgs == start)
108
	warnx("missing package name(s)"), usage();
113
	warnx("missing package name(s)"), usage();
109
    *pkgs = NULL;
114
    *pkgs = NULL;
110
    if (!Fake && getuid() != 0)
115
    if (!Fake && getuid() != 0) {
111
	errx(1, "you must be root to delete packages");
116
	warnx("you must be root to delete packages%s",
117
	  NeedRoot ? "" : " (proceeding anyway)");
118
	if (NeedRoot)
119
	    return EXIT_FAILURE;
120
    }
112
    if ((error = pkg_perform(start)) != 0) {
121
    if ((error = pkg_perform(start)) != 0) {
113
	if (Verbose)
122
	if (Verbose)
114
	    warnx("%d package deletion(s) failed", error);
123
	    warnx("%d package deletion(s) failed", error);
(-)pkg_delete.1 (-1 / +8 lines)
Lines 25-31 Link Here
25
.Nd a utility for deleting previously installed software package distributions
25
.Nd a utility for deleting previously installed software package distributions
26
.Sh SYNOPSIS
26
.Sh SYNOPSIS
27
.Nm
27
.Nm
28
.Op Fl vDdnf
28
.Op Fl vDdnfr
29
.Op Fl p Ar prefix
29
.Op Fl p Ar prefix
30
.Ar pkg-name ...
30
.Ar pkg-name ...
31
.Sh DESCRIPTION
31
.Sh DESCRIPTION
Lines 95-100 Link Here
95
.It Fl f
95
.It Fl f
96
Force removal of the package, even if a dependency is recorded or the
96
Force removal of the package, even if a dependency is recorded or the
97
deinstall or require script fails.
97
deinstall or require script fails.
98
.It Fl r
99
This flag removes the restriction that
100
.Nm
101
to be run by root, which can be useful for porters if the port has
102
been installed to a directory writable by that user, and if
103
.Ev PKG_DBDIR
104
has been set to a directory writable by that user.
98
.El
105
.El
99
106
100
.Pp
107
.Pp

Return to bug 18373