Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Set 'yes' from config file before parsing command line: this better models the heirarchy of which setting overrides which and simplifies the logic
Matthew Seaman committed 13 years ago
commit dfb2b35365b6ec56df0d2277ba52d2086e250686
parent 0b11b79
1 file changed +3 -4
modified pkg/delete.c
@@ -56,7 +56,7 @@ exec_delete(int argc, char **argv)
	int ch;
	int flags = PKG_LOAD_BASIC;
	bool force = false;
-
	bool yes = false;
+
	bool yes;
	bool dry_run = false;
	int retcode = EX_SOFTWARE;
	int recursive = 0;
@@ -64,6 +64,8 @@ exec_delete(int argc, char **argv)
	const char *origin;
	nbactions = nbdone = 0;

+
	pkg_config_bool(PKG_CONFIG_ASSUME_ALWAYS_YES, &yes);
+

	while ((ch = getopt(argc, argv, "afgnqRXxy")) != -1) {
		switch (ch) {
		case 'a':
@@ -157,9 +159,6 @@ exec_delete(int argc, char **argv)
	if (!quiet || dry_run) {
		print_jobs_summary(jobs, PKG_JOBS_DEINSTALL,
		    "The following %d packages will be deinstalled:\n\n", nbactions);
-

-
		if (!yes)
-
			pkg_config_bool(PKG_CONFIG_ASSUME_ALWAYS_YES, &yes);
		if (!yes && !dry_run)
			yes = query_yesno(
		            "\nProceed with deinstalling packages [y/N]: ");