Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
issue #403 -- show the filename being analysed in 'shared library not found' error messages as an aide to debugging.
Matthew Seaman committed 13 years ago
commit fde0529a54c5198328b809a7929605df5d5af7ec
parent b91acea
1 file changed +9 -11
modified libpkg/pkg_elf.c
@@ -76,8 +76,6 @@ filter_system_shlibs(const char *name, char *path, size_t pathlen)
	 * conform to the correct pattern.  Only warn on error --
	 * shlibs may belong to a different package. */

-

-

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

@@ -89,14 +87,14 @@ filter_system_shlibs(const char *name, char *path, size_t pathlen)
/* ARGSUSED */
static int
do_nothing(__unused void *actdata, __unused struct pkg *pkg,
-
	   __unused const char *name)
+
	   __unused const char *fpath, __unused const char *name)
{
	return (EPKG_OK);
}

/* ARGSUSED */
static int
-
add_shlibs_to_pkg(__unused void *actdata, struct pkg *pkg, const char *name)
+
add_shlibs_to_pkg(__unused void *actdata, struct pkg *pkg, const char *fpath, const char *name)
{
	switch(filter_system_shlibs(name, NULL, 0)) {
	case EPKG_OK:		/* A non-system library */
@@ -105,14 +103,14 @@ add_shlibs_to_pkg(__unused void *actdata, struct pkg *pkg, const char *name)
	case EPKG_END:		/* A system library */
		return (EPKG_OK);
	default:
-
		warnx("(%s-%s) shared library %s not found", pkg_name(pkg),
-
		      pkg_version(pkg), name);
+
		warnx("(%s-%s) %s - shared library %s not found",
+
		      pkg_name(pkg), pkg_version(pkg), fpath, name);
		return (EPKG_FATAL);
	}
}

static int
-
test_depends(void *actdata, struct pkg *pkg, const char *name)
+
test_depends(void *actdata, struct pkg *pkg, const char *fpath, const char *name)
{
	struct pkgdb *db = actdata;
	struct pkg_dep *dep = NULL;
@@ -134,8 +132,8 @@ test_depends(void *actdata, struct pkg *pkg, const char *name)
	case EPKG_END:		/* A system library */
		return (EPKG_OK);
	default:
-
		warnx("(%s-%s) shared library %s not found", pkg_name(pkg),
-
		      pkg_version(pkg), name);
+
		warnx("(%s-%s) %s - shared library %s not found",
+
		      pkg_name(pkg), pkg_version(pkg), fpath, name);
		return (EPKG_FATAL);
	}

@@ -217,7 +215,7 @@ warn_about_name_format(struct pkg *pkg, const char *fpath, const char *shlib)

static int
analyse_elf(struct pkg *pkg, const char *fpath, 
-
    int (action)(void *, struct pkg *, const char *), void *actdata)
+
    int (action)(void *, struct pkg *, const char *, const char *), void *actdata)
{
	Elf *e = NULL;
	GElf_Ehdr elfhdr;
@@ -370,7 +368,7 @@ analyse_elf(struct pkg *pkg, const char *fpath,
		if (developer)
			warn_about_name_format(pkg, fpath, shlib);

-
		action(actdata, pkg, shlib);
+
		action(actdata, pkg, fpath, shlib);
	}

cleanup: