Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix the case by skipping pkg itself if -f is not set and -a is
Brad Davis committed 7 years ago
commit 9962e5e666a79710e655e197c6236ab00e90eeb5
parent 899a0b5
1 file changed +7 -3
modified libpkg/pkg_jobs.c
@@ -2019,9 +2019,13 @@ pkg_jobs_execute(struct pkg_jobs *j)
			    (strcmp(p->name, "pkg") == 0 ||
			    strcmp(p->name, "pkg-devel") == 0) &&
			    (flags & PKG_DELETE_FORCE) == 0) {
-
				pkg_emit_error("Cannot delete pkg itself without force flag");
-
				retcode = EPKG_FATAL;
-
				goto cleanup;
+
				if (j->patterns->match == MATCH_ALL) {
+
					continue;
+
				} else {
+
					pkg_emit_error("Cannot delete pkg itself without force flag");
+
					retcode = EPKG_FATAL;
+
					goto cleanup;
+
				}
			}
			/*
			 * Assume that in upgrade we can remove packages with rdeps as