Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Add a preliminaty mechanism to allow at package creation to accept base shlibs
Baptiste Daroussin committed 10 years ago
commit 6e6d708b10d31f98ea0db87da9006ab1e48b58d6
parent bc19f52
2 files changed +16 -4
modified libpkg/pkg_config.c
@@ -390,6 +390,12 @@ static struct config_entry c[] = {
		"VALID_URL_SCHEME",
		"pkg+http,pkg+https,https,http,ftp,file,ssh",
	},
+
	{
+
		PKG_BOOL,
+
		"ALLOW_BASE_SHLIBS",
+
		"NO",
+
		"Enable base libraries analysis",
+
	},
};

static bool parsed = false;
modified libpkg/pkg_elf.c
@@ -92,10 +92,16 @@ filter_system_shlibs(const char *name, char *path, size_t pathlen)
		return (EPKG_FATAL);
	}

-
	/* match /lib, /lib32, /usr/lib and /usr/lib32 */
-
	if (strncmp(shlib_path, "/lib", 4) == 0 ||
-
	    strncmp(shlib_path, "/usr/lib", 8) == 0)
-
		return (EPKG_END); /* ignore libs from base */
+
	if (pkg_object_bool(pkg_config_get("ALLOW_BASE_SHLIBS"))) {
+
		if (strncmp(shlib_path, "/usr/lib32", 10) == 0) {
+
			return (EPKG_END);
+
		}
+
	} else {
+
		/* match /lib, /lib32, /usr/lib and /usr/lib32 */
+
		if (strncmp(shlib_path, "/lib", 4) == 0 ||
+
		    strncmp(shlib_path, "/usr/lib", 8) == 0)
+
			return (EPKG_END); /* ignore libs from base */
+
	}

	if (path != NULL)
		strncpy(path, shlib_path, pathlen);