mirror of
https://github.com/moparisthebest/pacman
synced 2025-03-01 01:41:52 -05:00
Add handle attribute to pmpkg_t struct
Similar to what we just did for the database; this will make it easy to always know what handle a given package originated from. Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
c47d25d74b
commit
7f98460e37
@ -415,6 +415,7 @@ static int local_db_populate(pmdb_t *db)
|
||||
pkg->origin = PKG_FROM_LOCALDB;
|
||||
pkg->origin_data.db = db;
|
||||
pkg->ops = &local_pkg_ops;
|
||||
pkg->handle = handle;
|
||||
|
||||
/* explicitly read with only 'BASE' data, accessors will handle the rest */
|
||||
if(_alpm_local_db_read(db, pkg, INFRQ_BASE) == -1) {
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "alpm_list.h"
|
||||
#include "util.h"
|
||||
#include "log.h"
|
||||
#include "handle.h"
|
||||
#include "package.h"
|
||||
#include "deps.h" /* _alpm_splitdep */
|
||||
|
||||
@ -350,6 +351,7 @@ pmpkg_t *_alpm_pkg_load_internal(const char *pkgfile, int full,
|
||||
newpkg->origin = PKG_FROM_FILE;
|
||||
newpkg->origin_data.file = strdup(pkgfile);
|
||||
newpkg->ops = get_file_pkg_ops();
|
||||
newpkg->handle = handle;
|
||||
|
||||
if(full) {
|
||||
/* "checking for conflicts" requires a sorted list, ensure that here */
|
||||
|
@ -306,8 +306,9 @@ static int sync_db_populate(pmdb_t *db)
|
||||
}
|
||||
|
||||
pkg->origin = PKG_FROM_SYNCDB;
|
||||
pkg->ops = &default_pkg_ops;
|
||||
pkg->origin_data.db = db;
|
||||
pkg->ops = &default_pkg_ops;
|
||||
pkg->handle = handle;
|
||||
|
||||
/* add to the collection */
|
||||
_alpm_log(PM_LOG_FUNCTION, "adding '%s' to package cache for db '%s'\n",
|
||||
|
@ -408,14 +408,15 @@ pmpkg_t *_alpm_pkg_dup(pmpkg_t *pkg)
|
||||
newpkg->deltas = alpm_list_copy_data(pkg->deltas, sizeof(pmdelta_t));
|
||||
|
||||
/* internal */
|
||||
newpkg->infolevel = pkg->infolevel;
|
||||
newpkg->origin = pkg->origin;
|
||||
newpkg->ops = pkg->ops;
|
||||
if(newpkg->origin == PKG_FROM_FILE) {
|
||||
newpkg->origin_data.file = strdup(pkg->origin_data.file);
|
||||
} else {
|
||||
newpkg->origin_data.db = pkg->origin_data.db;
|
||||
}
|
||||
newpkg->infolevel = pkg->infolevel;
|
||||
newpkg->ops = pkg->ops;
|
||||
newpkg->handle = handle;
|
||||
|
||||
return newpkg;
|
||||
}
|
||||
|
@ -110,6 +110,7 @@ struct __pmpkg_t {
|
||||
int scriptlet;
|
||||
|
||||
pmpkgreason_t reason;
|
||||
pmdbinfrq_t infolevel;
|
||||
pmpkgfrom_t origin;
|
||||
/* origin == PKG_FROM_FILE, use pkg->origin_data.file
|
||||
* origin == PKG_FROM_*DB, use pkg->origin_data.db */
|
||||
@ -117,7 +118,7 @@ struct __pmpkg_t {
|
||||
pmdb_t *db;
|
||||
char *file;
|
||||
} origin_data;
|
||||
pmdbinfrq_t infolevel;
|
||||
pmhandle_t *handle;
|
||||
|
||||
alpm_list_t *licenses;
|
||||
alpm_list_t *replaces;
|
||||
|
Loading…
x
Reference in New Issue
Block a user