Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Remove the shlib options as the is now always used
Baptiste Daroussin committed 13 years ago
commit 0e873c61d4486b41f105e424f5497ea8d1560c79
parent bb91c6b
4 files changed +9 -60
modified libpkg/pkg.h.in
@@ -319,7 +319,6 @@ typedef enum _pkg_config_key {
	PKG_CONFIG_REPOS,
	PKG_CONFIG_PLIST_KEYWORDS_DIR,
	PKG_CONFIG_SYSLOG,
-
	PKG_CONFIG_SHLIBS,
	PKG_CONFIG_AUTODEPS,
	PKG_CONFIG_ABI,
	PKG_CONFIG_DEVELOPER_MODE,
modified libpkg/pkg_config.c
@@ -138,12 +138,6 @@ static struct config_entry c[] = {
		"YES",
		"Log pkg(8) operations via syslog(3)",
	},
-
	[PKG_CONFIG_SHLIBS] = {
-
		PKG_CONFIG_BOOL,
-
		"SHLIBS",
-
		"NO",
-
		"Allow to track shared libraries with elf files",
-
	},
	[PKG_CONFIG_AUTODEPS] = {
		PKG_CONFIG_BOOL,
		"AUTODEPS",
modified libpkg/pkg_elf.c
@@ -81,17 +81,6 @@ filter_system_shlibs(const char *name, char *path, size_t pathlen)
	return (EPKG_OK);
} 

-
/* Callback functions to process the shlib data */
-

-
/* ARGSUSED */
-
static int
-
do_nothing(__unused void *actdata, __unused struct pkg *pkg,
-
	   __unused const char *fpath, __unused const char *name,
-
	   __unused bool is_shlib)
-
{
-
	return (EPKG_OK);
-
}
-

/* ARGSUSED */
static int
add_shlibs_to_pkg(__unused void *actdata, struct pkg *pkg, const char *fpath,
@@ -127,12 +116,9 @@ test_depends(void *actdata, struct pkg *pkg, const char *fpath,
	bool deplocked;
	char pathbuf[MAXPATHLEN];
	bool found;
-
	bool shlibs = false;

	assert(db != NULL);

-
	pkg_config_bool(PKG_CONFIG_SHLIBS, &shlibs);
-

	switch(filter_system_shlibs(name, pathbuf, sizeof(pathbuf))) {
	case EPKG_OK:		/* A non-system library */
		break;
@@ -149,8 +135,7 @@ test_depends(void *actdata, struct pkg *pkg, const char *fpath,
		return (EPKG_FATAL);
	}

-
	if (shlibs)
-
		pkg_addshlib_required(pkg, name);
+
	pkg_addshlib_required(pkg, name);

	if ((it = pkgdb_query_which(db, pathbuf, false)) == NULL)
		return (EPKG_OK);
@@ -249,13 +234,9 @@ analyse_elf(struct pkg *pkg, const char *fpath,
	const char *osname;
	const char *shlib;

-
	bool shlibs = false;
-
	bool autodeps = false;
	bool developer = false;
	bool is_shlib = false;

-
	pkg_config_bool(PKG_CONFIG_AUTODEPS, &autodeps);
-
	pkg_config_bool(PKG_CONFIG_SHLIBS, &shlibs);
	pkg_config_bool(PKG_CONFIG_DEVELOPER_MODE, &developer);

	int fd;
@@ -285,11 +266,6 @@ analyse_elf(struct pkg *pkg, const char *fpath,
	if (developer)
		pkg->flags |= PKG_CONTAINS_ELF_OBJECTS;

-
	if (!autodeps && !shlibs) {
-
	   ret = EPKG_OK;
-
	   goto cleanup;
-
	}
-

	if (gelf_getehdr(e, &elfhdr) == NULL) {
		ret = EPKG_FATAL;
		pkg_emit_error("getehdr() failed: %s.", elf_errmsg(-1));
@@ -372,8 +348,7 @@ analyse_elf(struct pkg *pkg, const char *fpath,
			   *provided* by the package. Record this if
			   appropriate */

-
			if (shlibs)
-
				pkg_addshlib_provided(pkg, basename(fpath));
+
			pkg_addshlib_provided(pkg, basename(fpath));
		}

		if (dyn->d_tag != DT_RPATH && dyn->d_tag != DT_RUNPATH)
@@ -446,35 +421,26 @@ pkg_analyse_files(struct pkgdb *db, struct pkg *pkg)
	struct pkg_file *file = NULL;
	int ret = EPKG_OK;
	const char *fpath;
-
	bool shlibs = false;
	bool autodeps = false;
	bool developer = false;
	int (*action)(void *, struct pkg *, const char *, const char *, bool);

-
	pkg_config_bool(PKG_CONFIG_SHLIBS, &shlibs);
	pkg_config_bool(PKG_CONFIG_AUTODEPS, &autodeps);
	pkg_config_bool(PKG_CONFIG_DEVELOPER_MODE, &developer);

-
	if (!autodeps && !shlibs && !developer)
-
		return (EPKG_OK);
-

	if (elf_version(EV_CURRENT) == EV_NONE)
		return (EPKG_FATAL);

	if (autodeps)
		action = test_depends;
-
	else if (shlibs)
-
		action = add_shlibs_to_pkg;
	else
-
		action = do_nothing;
+
		action = add_shlibs_to_pkg;

-
	if (autodeps || shlibs) {
-
		shlib_list_init();
+
	shlib_list_init();

-
		ret = shlib_list_from_elf_hints(_PATH_ELF_HINTS);
-
		if (ret != EPKG_OK)
-
			goto cleanup;
-
	}
+
	ret = shlib_list_from_elf_hints(_PATH_ELF_HINTS);
+
	if (ret != EPKG_OK)
+
		goto cleanup;

	/* Assume no architecture dependence, for contradiction */
	if (developer)
@@ -495,8 +461,7 @@ pkg_analyse_files(struct pkgdb *db, struct pkg *pkg)
	ret = EPKG_OK;

cleanup:
-
	if (autodeps || shlibs)
-
		shlib_list_free();
+
	shlib_list_free();

	return (ret);
}
@@ -505,15 +470,9 @@ int
pkg_register_shlibs(struct pkg *pkg)
{
	struct pkg_file        *file = NULL;
-
	bool			shlibs;
-

-
	pkg_config_bool(PKG_CONFIG_SHLIBS, &shlibs);

	pkg_list_free(pkg, PKG_SHLIBS_REQUIRED);

-
	if (!shlibs)
-
		return (EPKG_OK);
-

	if (elf_version(EV_CURRENT) == EV_NONE)
		return (EPKG_FATAL);

modified pkg/pkg.conf.5
@@ -15,7 +15,7 @@
.\"     @(#)pkg.1
.\" $FreeBSD$
.\"
-
.Dd February 25, 2013
+
.Dd April 09, 2013
.Dt PKG.CONF 5
.Os
.Sh NAME
@@ -117,9 +117,6 @@ for this option is
.It Cm SYSLOG: boolean
This option is enabled by default, log all the
installation/deinstallation/upgrade operation via syslog(3)
-
.It Cm SHLIBS: boolean
-
Analyse elf and track all shared libraries needed by the packages.
-
default: off
.It Cm AUTODEPS: boolean
Analyse the elf to add dependencies (shared libraries) that may have been
forgotten by the maintainer.