Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Remove AUTODEPS it is not needed anymore with the new solver
Baptiste Daroussin committed 11 years ago
commit 792a178d6d33bf711074bd858ea8c486331df1f0
parent 4f01824
6 files changed +3 -93
modified docs/pkg.conf.5
@@ -15,7 +15,7 @@
.\"     @(#)pkg.1
.\" $FreeBSD$
.\"
-
.Dd May 7, 2014
+
.Dd May 15, 2014
.Dt PKG.CONF 5
.Os
.Sh NAME
@@ -81,10 +81,6 @@ the
.Fl y
flag was specified.
Default: no.
-
.It Cm AUTODEPS: boolean
-
Analyse the elf to add dependencies (shared libraries) that may have been
-
forgotten by the maintainer.
-
Default: off
.It Cm CUDF_SOLVER: string
Experimental: tells pkg to use an external CUDF solver.
Default: not set.
modified libpkg/pkg.h.in
@@ -638,7 +638,7 @@ int pkg_provides(const struct pkg *pkg, struct pkg_provide **provide);
 * dependency list contains all applicable packages providing the
 * shared objects used by pkg.
 * Also add all the shared object into the shlibs.
-
 * It respects the SHLIBS and AUTODEPS options from configuration
+
 * It respects the SHLIBS options from configuration
 * @return An error code
 */

modified libpkg/pkg_config.c
@@ -139,12 +139,6 @@ static struct config_entry c[] = {
		"Log pkg(8) operations via syslog(3)",
	},
	{
-
		PKG_BOOL,
-
		"AUTODEPS",
-
		"YES",
-
		"Automatically append dependencies to fulfil dynamic linking requrements of binaries",
-
	},
-
	{
		PKG_STRING,
		"ABI",
		myabi,
modified libpkg/pkg_elf.c
@@ -127,76 +127,6 @@ add_shlibs_to_pkg(__unused void *actdata, struct pkg *pkg, const char *fpath,
}

static int
-
test_depends(void *actdata, struct pkg *pkg, const char *fpath,
-
	     const char *name, bool is_shlib)
-
{
-
	struct pkgdb *db = actdata;
-
	struct pkg_dep *dep = NULL;
-
	struct pkgdb_it *it = NULL;
-
	struct pkg *d;
-
	const char *deporigin, *depname, *depversion;
-
	const char *origin;
-
	const char *pkgname, *pkgversion;
-
	bool deplocked;
-
	char pathbuf[MAXPATHLEN];
-
	struct pkg_file *file = NULL;
-
	const char *filepath;
-

-
	assert(db != NULL);
-

-
	switch(filter_system_shlibs(name, pathbuf, sizeof(pathbuf))) {
-
	case EPKG_OK:		/* A non-system library */
-
		break;
-
	case EPKG_END:		/* A system library */
-
		return (EPKG_OK);
-
	default:
-
		/* Ignore link resolution errors if we're analysing a
-
		   shared library. */
-
		if (is_shlib)
-
			return (EPKG_OK);
-

-
		while (pkg_files(pkg, &file) == EPKG_OK) {
-
			filepath = pkg_file_path(file);
-
			if (strcmp(&filepath[strlen(filepath) - strlen(name)], name) == 0) {
-
				pkg_addshlib_required(pkg, name);
-
				return (EPKG_OK);
-
			}
-
		}
-
		pkg_get(pkg, PKG_NAME, &pkgname, PKG_VERSION, &pkgversion);
-
		warnx("(%s-%s) %s - shared library %s not found",
-
		      pkgname, pkgversion, fpath, name);
-
		return (EPKG_FATAL);
-
	}
-

-
	pkg_addshlib_required(pkg, name);
-

-
	if ((it = pkgdb_query_which(db, pathbuf, false)) == NULL)
-
		return (EPKG_OK);
-

-
	d = NULL;
-
	if (pkgdb_it_next(it, &d, PKG_LOAD_BASIC) == EPKG_OK) {
-
		pkg_get(d, PKG_ORIGIN,  &deporigin,
-
			   PKG_NAME,    &depname,
-
			   PKG_VERSION, &depversion,
-
			   PKG_LOCKED,  &deplocked);
-

-
		dep = pkg_dep_lookup(pkg, deporigin);
-
		pkg_get(pkg, PKG_ORIGIN, &origin);
-

-
		if (dep == NULL && strcmp(origin, deporigin) != 0) {
-
			pkg_debug(1, "Autodeps: adding unlisted depends (%s): %s-%s",
-
			    pathbuf, depname, depversion);
-
			pkg_adddep(pkg, depname, deporigin, depversion,
-
			    deplocked);
-
		}
-
		pkg_free(d);
-
	}
-

-
	pkgdb_it_free(it);
-
	return (EPKG_OK);
-
}
-

-
static int
analyse_elf(struct pkg *pkg, const char *fpath,
	int (action)(void *, struct pkg *, const char *, const char *, bool),
	void *actdata)
@@ -427,21 +357,13 @@ pkg_analyse_files(struct pkgdb *db, struct pkg *pkg, const char *stage)
	struct pkg_file *file = NULL;
	int ret = EPKG_OK;
	char fpath[MAXPATHLEN];
-
	bool autodeps = false;
	bool developer = false;
-
	int (*action)(void *, struct pkg *, const char *, const char *, bool);

-
	autodeps = pkg_object_bool(pkg_config_get("AUTODEPS"));
	developer = pkg_object_bool(pkg_config_get("DEVELOPER_MODE"));

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

-
	if (autodeps)
-
		action = test_depends;
-
	else
-
		action = add_shlibs_to_pkg;
-

	shlib_list_init();

	ret = shlib_list_from_elf_hints(_PATH_ELF_HINTS);
@@ -460,7 +382,7 @@ pkg_analyse_files(struct pkgdb *db, struct pkg *pkg, const char *stage)
		else
			strlcpy(fpath, pkg_file_path(file), sizeof(fpath));

-
		ret = analyse_elf(pkg, fpath, action, db);
+
		ret = analyse_elf(pkg, fpath, add_shlibs_to_pkg, db);
		if (developer) {
			if (ret != EPKG_OK && ret != EPKG_END)
				goto cleanup;
modified src/pkg.conf.sample
@@ -22,7 +22,6 @@
#]
#PLIST_KEYWORDS_DIR = "";
#SYSLOG = true;
-
#AUTODEPS = true;
#ABI = "freebsd:10:x86:64";     # Autogenerated
#DEVELOPER_MODE = false;
#VULNXML_SITE = "http://www.vuxml.org/freebsd/vuln.xml.bz2";
modified tests/frontend/pkg.sh
@@ -48,7 +48,6 @@ pkg_config_defaults_body()
	-o match:'^ *ASSUME_ALWAYS_YES: no$' \
	-o match:'^ *PLIST_KEYWORDS_DIR: $' \
	-o match:'^ *SYSLOG: yes$' \
-
	-o match:'^ *AUTODEPS: yes$' \
	-o match:'^ *ABI: [a-zA-Z0-9]+:[a-zA-Z0-9]+:[a-zA-Z0-9]+:[a-zA-Z0-9]+$' \
	-o match:'^ *DEVELOPER_MODE: no$' \
	-o match:'^ *PORTAUDIT_SITE: http://portaudit.FreeBSD.org/auditfile.tbz$' \