From 8146f6f1c6bbd7bf642cb263ca1658234fb7e48a Mon Sep 17 00:00:00 2001 From: Nagy Gabor Date: Sun, 17 Aug 2008 18:32:39 +0200 Subject: New public alpm_pkg_get_db function This function returns with the origin database of a package. Signed-off-by: Nagy Gabor Signed-off-by: Dan McGee --- lib/libalpm/package.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/libalpm/package.c') diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index eaef688d..13020041 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -423,6 +423,15 @@ alpm_list_t SYMEXPORT *alpm_pkg_get_backup(pmpkg_t *pkg) return pkg->backup; } +pmdb_t SYMEXPORT *alpm_pkg_get_db(pmpkg_t *pkg) +{ + /* Sanity checks */ + ASSERT(pkg != NULL, return(NULL)); + ASSERT(pkg->origin == PKG_FROM_CACHE, return(NULL)); + + return(pkg->origin_data.db); +} + /** * Open a package changelog for reading. Similar to fopen in functionality, * except that the returned 'file stream' could really be from an archive -- cgit v1.2.3-24-g4f1b