Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
upgrade: when pkg self restart do not warn about the env vars.
Baptiste Daroussin committed 8 months ago
commit 01f2851e14bc12688ffa8d0aaf908b18abe9ebf4
parent 120e613
1 file changed +7 -3
modified src/main.c
@@ -361,8 +361,10 @@ export_arg_option (char *arg)
		*eqp = '\0';

		if ((opt = getenv (arg)) != NULL) {
-
			warnx("option %s is defined in the environment to '%s' but command line "
-
					"option redefines it", arg, opt);
+
			if (!STREQ(opt, "PKG_RESTARTED")) {
+
				warnx("option %s is defined in the environment to '%s' but command line "
+
				    "option redefines it", arg, opt);
+
			}
			setenv(arg, eqp + 1, 1);
		}
		else {
@@ -392,8 +394,10 @@ start_process_worker(char *const *save_argv)

		if (child_pid == 0) {
			/* Load the new Pkg image */
-
			if (ret == EX_NEEDRESTART)
+
			if (ret == EX_NEEDRESTART) {
+
				setenv("PKG_RESTARTED", "1", 0);
				execvp(getprogname(), save_argv);
+
			}
			return;
		} else {
			if (child_pid == -1)