Introduce xbps_{pkgdb,rpool}_get_pkg_fulldeptree().

These routines return a xbps_array_t with a full sorted dependency graph
for the target pkg, by querying pkgdb or rpool.

Update xbps-query(8) to use the new libxbps API.
This commit is contained in:
Juan RP
2014-11-20 09:23:51 +01:00
parent 2c01994497
commit 1bae26606e
7 changed files with 253 additions and 153 deletions

View File

@@ -48,7 +48,7 @@
*
* This header documents the full API for the XBPS Library.
*/
#define XBPS_API_VERSION "20141117-1"
#define XBPS_API_VERSION "20141120"
#ifndef XBPS_VERSION
#define XBPS_VERSION "UNSET"
@@ -815,11 +815,25 @@ xbps_dictionary_t xbps_pkgdb_get_pkg_files(struct xbps_handle *xhp,
* @param[in] xhp The pointer to the xbps_handle struct.
* @param[in] pkg Package expression to match.
*
* @return A proplib array of strings with reverse dependencies for \a pkg.
* @return A proplib array of strings with reverse dependencies for \a pkg,
* NULL otherwise.
*/
xbps_array_t xbps_pkgdb_get_pkg_revdeps(struct xbps_handle *xhp,
const char *pkg);
/**
* Returns a proplib array of strings with a proper sorted list
* of packages of a full dependency graph for \a pkg.
*
* @param[in] xhp The pointer to the xbps_handle struct.
* @param[in] pkg Package expression to match.
*
* @return A proplib array of strings with the full dependency graph for \a pkg,
* NULL otherwise.
*/
xbps_array_t xbps_pkgdb_get_pkg_fulldeptree(struct xbps_handle *xhp,
const char *pkg);
/**
* Updates the package database (pkgdb) with new contents from the
* cached memory copy to disk.
@@ -1310,6 +1324,18 @@ xbps_dictionary_t xbps_rpool_get_virtualpkg(struct xbps_handle *xhp,
*/
xbps_array_t xbps_rpool_get_pkg_revdeps(struct xbps_handle *xhp, const char *pkg);
/**
* Returns a proplib array of strings with a proper sorted list
* of packages of a full dependency graph for \a pkg.
*
* @param[in] xhp The pointer to the xbps_handle struct.
* @param[in] pkg Package expression to match.
*
* @return A proplib array of strings with the full dependency graph for \a pkg,
* NULL otherwise.
*/
xbps_array_t xbps_rpool_get_pkg_fulldeptree(struct xbps_handle *xhp, const char *pkg);
/**
* Iterate over the the repository pool and search for a metadata plist
* file in a binary package matching `pattern'. If a package is matched

View File

@@ -149,5 +149,7 @@ char HIDDEN *xbps_archive_get_file(struct archive *, struct archive_entry *);
xbps_dictionary_t HIDDEN xbps_archive_get_dictionary(struct archive *,
struct archive_entry *);
const char HIDDEN *vpkg_user_conf(struct xbps_handle *, const char *, bool);
xbps_array_t HIDDEN xbps_get_pkg_fulldeptree(struct xbps_handle *,
const char *, bool);
#endif /* !_XBPS_API_IMPL_H_ */