Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
get rid of deprecated pkg_name() and pkg_version()
Baptiste Daroussin committed 12 years ago
commit 599869d5068d4ee62a128e3d062fd9737513707d
parent 7d48c56
3 files changed +8 -31
modified libpkg/pkg.c
@@ -241,28 +241,6 @@ pkg_get2(struct pkg const *const pkg, ...)
	return (ret);
}

-
const char *
-
pkg_name(struct pkg const *const pkg)
-
{
-
	assert(pkg != NULL);
-

-
	if (pkg->fields[PKG_NAME] != NULL)
-
		return (sbuf_get(pkg->fields[PKG_NAME]));
-
	else
-
		return (NULL);
-
}
-

-
const char *
-
pkg_version(struct pkg const *const pkg)
-
{
-
	assert(pkg != NULL);
-

-
	if (pkg->fields[PKG_VERSION] != NULL)
-
		return (sbuf_get(pkg->fields[PKG_VERSION]));
-
	else
-
		return (NULL);
-
}
-

static void
pkg_set_repourl(struct pkg *pkg, const char *str)
{
modified libpkg/pkg.h.in
@@ -511,13 +511,6 @@ pkg_t pkg_type(struct pkg const * const);
int pkg_get2(struct pkg const *const, ...);
#define pkg_get(pkg, ...) pkg_get2(pkg, __VA_ARGS__, -1)

-
/**
-
 * Specific getters for simple attributes.
-
 * @return NULL-terminated string.
-
 */
-
const char *pkg_name(struct pkg const *const pkg);
-
const char *pkg_version(struct pkg const *const pkg);
-

int pkg_list_count(const struct pkg *, pkg_list);

/**
modified libpkg/pkg_elf.c
@@ -86,6 +86,8 @@ static int
add_shlibs_to_pkg(__unused void *actdata, struct pkg *pkg, const char *fpath,
		  const char *name, bool is_shlib)
{
+
	const char *pkgname, *pkgversion;
+

	switch(filter_system_shlibs(name, NULL, 0)) {
	case EPKG_OK:		/* A non-system library */
		pkg_addshlib_required(pkg, name);
@@ -98,8 +100,10 @@ add_shlibs_to_pkg(__unused void *actdata, struct pkg *pkg, const char *fpath,
		if (is_shlib)
			return (EPKG_OK);

+
		pkg_get(pkg, PKG_NAME, &pkgname, PKG_VERSION, &pkgversion);
		warnx("(%s-%s) %s - shared library %s not found",
-
		      pkg_name(pkg), pkg_version(pkg), fpath, name);
+
		      pkgname, pkgversion, fpath, name);
+

		return (EPKG_FATAL);
	}
}
@@ -113,6 +117,7 @@ test_depends(void *actdata, struct pkg *pkg, const char *fpath,
	struct pkgdb_it *it = NULL;
	struct pkg *d;
	const char *deporigin, *depname, *depversion;
+
	const char *pkgname, *pkgversion;
	bool deplocked;
	char pathbuf[MAXPATHLEN];
	bool found;
@@ -130,8 +135,9 @@ test_depends(void *actdata, struct pkg *pkg, const char *fpath,
		if (is_shlib)
			return (EPKG_OK);

+
		pkg_get(pkg, PKG_NAME, &pkgname, PKG_VERSION, &pkgversion);
		warnx("(%s-%s) %s - shared library %s not found",
-
		      pkg_name(pkg), pkg_version(pkg), fpath, name);
+
		      pkgname, pkgversion, fpath, name);
		return (EPKG_FATAL);
	}