Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Command line options redefines env options.
Vsevolod Stakhov committed 12 years ago
commit 065865b3c9ca6025c4bf8380007d37f0cfc3569d
parent 8228129
2 files changed +10 -6
modified pkg/main.c
@@ -550,15 +550,19 @@ static void
export_arg_option (char *arg)
{
	char *eqp;
+
	const char *opt;

	if ((eqp = strchr(arg, '=')) != NULL) {
		*eqp = '\0';

-
		if (getenv (arg) != NULL)
-
			warnx("option %s is defined in the environment so command line "
-
					"option is ignored", arg);
-
		else
+
		if ((opt = getenv (arg)) != NULL) {
+
			warnx("option %s is defined in the environment to '%s' but command line "
+
					"option redefines it", arg, opt);
+
			setenv(arg, eqp + 1, 1);
+
		}
+
		else {
			setenv(arg, eqp + 1, 0);
+
		}

		*eqp = '=';
	}
modified pkg/pkg.8
@@ -15,7 +15,7 @@
.\"     @(#)pkg.8
.\" $FreeBSD$
.\"
-
.Dd February 21, 2014
+
.Dd February 26, 2014
.Dt PKG 8
.Os
.\" ---------------------------------------------------------------------------
@@ -71,7 +71,7 @@ will override any other command line arguments.
Set configuration option for
.Nm
from the command line. Options that are set from the environment are
-
not redefined. It is permitted to specify this option multiple times. 
+
redefined. It is permitted to specify this option multiple times. 
.It Fl N
Activation status check mode.
Prevent