Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Take two: honor behavior specified in the man page
Sean Chittenden committed 11 years ago
commit 6e15ae296c4e92a517459a7428247b3e13eba2e7
parent 59b7a07
2 files changed +6 -4
modified libpkg/pkg_config.c
@@ -744,7 +744,6 @@ pkg_ini(const char *path, const char *reposdir, pkg_init_flags flags)
{
	struct ucl_parser *p = NULL;
	size_t i;
-
	int debug_level_cli, debug_level_ini;
	const char *val = NULL;
	const char *buf, *walk, *value, *key, *k;
	const char *evkey = NULL;
@@ -1019,9 +1018,7 @@ pkg_ini(const char *path, const char *reposdir, pkg_init_flags flags)
	if (evpipe != NULL)
		connect_evpipe(evpipe);

-
	debug_level_cli = debug_level;
-
	debug_level_ini = pkg_object_int(pkg_config_get("DEBUG_LEVEL"));
-
	debug_level = MAX(debug_level_cli, debug_level_ini);
+
	debug_level = pkg_object_int(pkg_config_get("DEBUG_LEVEL"));
	developer_mode = pkg_object_bool(pkg_config_get("DEVELOPER_MODE"));

	it = NULL;
modified src/main.c
@@ -652,6 +652,8 @@ main(int argc, char **argv)
	argc -= optind;
	argv += optind;

+
	debug_level = debug;
+

	if (version == 1)
		show_version_info(version);

@@ -705,6 +707,9 @@ main(int argc, char **argv)
	if (pkg_ini(conffile, reposdir, init_flags) != EPKG_OK)
		errx(EX_SOFTWARE, "Cannot parse configuration file!");

+
	if (debug > 0)
+
		debug_level = debug;
+

	if (atexit(&pkg_shutdown) != 0)
		errx(EX_SOFTWARE, "register pkg_shutdown() to run at exit");