Improved pkg best matching in rpool, and support for exact pkgver matches.

- xbps_repository_pool_find_pkg in best match case, now returns the
  newest package version available in rpool.
- Added xbps_repository_pool_find_pkg_exact that returns a package
  by exact matching a pkgver.
- Removed xbps_handle_alloc(), the user is free to use memory
  allocated from heap or stack.
- Improved API documentation in preparation for 0.12.

Bumped XBPS_API_VERSION again.
This commit is contained in:
Juan RP
2012-01-17 16:17:03 +01:00
parent da5e9f841f
commit f2b05d6438
12 changed files with 332 additions and 282 deletions

View File

@ -443,7 +443,7 @@ int
main(int argc, char **argv)
{
prop_dictionary_t plistd, confd = NULL;
struct xbps_handle *xhp;
struct xbps_handle xh;
FILE *f = NULL;
char *outfile = NULL;
const char *conf_file = NULL, *rootdir = NULL;
@ -485,11 +485,9 @@ main(int argc, char **argv)
usage();
/* Initialize libxbps */
xhp = xbps_handle_alloc();
if (xhp == NULL)
die("failed to allocate resources");
xhp->rootdir = rootdir;
if ((rv = xbps_init(xhp)) != 0)
memset(&xh, 0, sizeof(xh));
xh.rootdir = rootdir;
if ((rv = xbps_init(&xh)) != 0)
die("failed to initialize libxbps: %s", strerror(rv));
/*