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 62dd05e67199765b494e018c6f580bcf5cd2dce0
parent 2c1f471
1 file changed +3 -3
modified pkg/install.c
@@ -59,7 +59,7 @@ exec_install(int argc, char **argv)
	const char *reponame = NULL;
	int retcode = EX_SOFTWARE;
	int ch;
-
	bool yes = false;
+
	bool yes;
	bool auto_update = true;
	bool recursive = false;
	bool automatic = false;
@@ -69,6 +69,8 @@ exec_install(int argc, char **argv)
	bool dry_run = false;
	nbactions = nbdone = 0;

+
	pkg_config_bool(PKG_CONFIG_ASSUME_ALWAYS_YES, &yes);
+

	while ((ch = getopt(argc, argv, "AfgLnqRr:Xxy")) != -1) {
		switch (ch) {
		case 'A':
@@ -158,8 +160,6 @@ exec_install(int argc, char **argv)
		    "The following %d packages will be installed:\n\n",
		    nbactions);

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