Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
autoremove: Add --no-scripts same as install and delete
Tobias Kortkamp committed 5 years ago
commit dc35acba1821570db07142d23aed60e8dca49e36
parent 62302ab
2 files changed +11 -5
modified docs/pkg-autoremove.8
@@ -14,7 +14,7 @@
.\"
.\"     @(#)pkg.8
.\"
-
.Dd May 25, 2014
+
.Dd May 3, 2021
.Dt PKG-AUTOREMOVE 8
.Os
.Sh NAME
@@ -22,10 +22,10 @@
.Nd removes orphan packages
.Sh SYNOPSIS
.Nm
-
.Op Fl nqy
+
.Op Fl Dnqy
.Pp
.Nm
-
.Op Cm --{dry-run,quiet,yes}
+
.Op Cm --{dry-run,no-scripts,quiet,yes}
.Sh DESCRIPTION
.Nm
is used for removing orphan packages, which were installed
@@ -38,6 +38,8 @@ The following options are supported by
Dry-run mode.
The list of changes to packages is always printed, but
no changes are actually made.
+
.It Fl D , Cm --no-scripts
+
If a deinstallation script exists for a given package, do not execute it.
.It Fl q , Cm --quiet
Force quiet output.
.It Fl y , Cm --yes
modified src/autoremove.c
@@ -39,7 +39,7 @@
void
usage_autoremove(void)
{
-
	fprintf(stderr, "Usage: pkg autoremove [-ynq]\n\n");
+
	fprintf(stderr, "Usage: pkg autoremove [-Dynq]\n\n");
	fprintf(stderr, "For more information see 'pkg help autoremove'.\n");
}

@@ -57,18 +57,22 @@ exec_autoremove(int argc, char **argv)

	struct option longopts[] = {
		{ "dry-run",	no_argument,	NULL,	'n' },
+
		{ "no-scripts",	no_argument,	NULL,	'D' },
		{ "quiet",	no_argument,	NULL,	'q' },
		{ "yes",	no_argument,	NULL,	'y' },
		{ NULL,		0,		NULL,	0   },
	};

-
	while ((ch = getopt_long(argc, argv, "+nqy", longopts, NULL)) != -1) {
+
	while ((ch = getopt_long(argc, argv, "+Dnqy", longopts, NULL)) != -1) {
		switch (ch) {
		case 'n':
			f |= PKG_FLAG_DRY_RUN;
			dry_run = true;
			lock_type = PKGDB_LOCK_READONLY;
			break;
+
		case 'D':
+
			f |= PKG_FLAG_NOSCRIPT;
+
			break;
		case 'q':
			quiet = true;
			break;