Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
pkg_obj: reduce the number of call to getenv(3)
Baptiste Daroussin committed 1 year ago
commit 136b196b2a12dfdc29e411b9968b59676f41042e
parent a4b8871
1 file changed +6 -1
modified libpkg/pkg_manifest.c
@@ -693,8 +693,13 @@ pkg_set_deps_from_object(struct pkg *pkg, const ucl_object_t *obj)
	const char *version = NULL;
	const char *key, *okey;
	bool noversion = false;
+
	static bool noversion_env_check = false;
+

+
	if (!noversion_env_check) {
+
		noversion = (getenv("PKG_NO_VERSION_FOR_DEPS") != NULL);
+
		noversion_env_check = true;
+
	}

-
	noversion = (getenv("PKG_NO_VERSION_FOR_DEPS") != NULL);
	okey = ucl_object_key(obj);
	if (okey == NULL)
		return (EPKG_FATAL);