]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
add pool parameter to rpm_state_create so that we can use pool_error for error reporting
authorMichael Schroeder <mls@suse.de>
Mon, 15 Apr 2013 12:19:02 +0000 (14:19 +0200)
committerMichael Schroeder <mls@suse.de>
Mon, 15 Apr 2013 12:19:02 +0000 (14:19 +0200)
examples/solv.c
ext/repo_rpmdb.c
ext/repo_rpmdb.h
tools/findfileconflicts.c

index 5d8e31e2c14712a5e2fbd74f34b1bca7a1b9a39e..4e966cf219c682d3f1627ea764586394728a1d2d 100644 (file)
@@ -145,7 +145,7 @@ yum_substitute(Pool *pool, char *line)
              Queue q;
        
              queue_init(&q);
-             rpmstate = rpm_state_create(pool_get_rootdir(pool));
+             rpmstate = rpm_state_create(pool, pool_get_rootdir(pool));
              rpm_installedrpmdbids(rpmstate, "Providename", "redhat-release", &q);
              if (q.count)
                {
@@ -3171,7 +3171,7 @@ rerunsolver:
 
       printf("Searching for file conflicts\n");
       queue_init(&conflicts);
-      fcstate.rpmstate = rpm_state_create(rootdir);
+      fcstate.rpmstate = rpm_state_create(pool, rootdir);
       fcstate.newpkgscnt = newpkgs;
       fcstate.checkq = &checkq;
       fcstate.newpkgsfps = newpkgsfps;
index 20b3715dec493fa27f5a48a81029f16de2e1196d..fc5553762c92799a1e935abcfbb5b4816e8a660c 100644 (file)
@@ -2268,6 +2268,7 @@ rpm_query(void *rpmhandle, Id what)
 
 
 struct rpm_by_state {
+  Pool *pool; 
   RpmHead *rpmhead;
   int rpmheadsize;
 
@@ -2429,10 +2430,11 @@ freestate(struct rpm_by_state *state)
 }
 
 void *
-rpm_state_create(const char *rootdir)
+rpm_state_create(Pool *pool, const char *rootdir)
 {
   struct rpm_by_state *state;
   state = solv_calloc(1, sizeof(*state));
+  state->pool = pool;
   if (rootdir)
     state->rootdir = solv_strdup(rootdir);
   return state;
@@ -3195,6 +3197,7 @@ repo_add_rpmdb_pubkeys(Repo *repo, int flags)
     rootdir = pool_get_rootdir(pool);
 
   memset(&state, 0, sizeof(state));
+  state.pool = pool;
   if (!(state.dbenv = opendbenv(rootdir)))
     return 0;
   entries = getinstalledrpmdbids(&state, "Name", "gpg-pubkey", &nentries, 0);
index e513417d039602c926135f5a5e2c528180ba8338..117da426fa65fbc910b41cbf87033a595981f9ff 100644 (file)
@@ -32,7 +32,7 @@ extern Id repo_add_pubkey(Repo *repo, const char *key, int flags);
 #define RPM_ITERATE_FILELIST_NOGHOSTS  (1 << 3)
 
 /* create and free internal state, rootdir is the rootdir of the rpm database */
-extern void *rpm_state_create(const char *rootdir);
+extern void *rpm_state_create(Pool *pool, const char *rootdir);
 extern void *rpm_state_free(void *rpmstate);
 
 /* return all matching rpmdbids */
index cb90f5481cfd7d6f26ebeffb8d59dd0c5a3ee696..a59c097c3855a415698a531831390565e57d6ef6 100644 (file)
@@ -54,7 +54,7 @@ int main(int argc, char **argv)
   queue_init(&conflicts);
   FOR_REPO_SOLVABLES(installed, p, s)
     queue_push(&todo, p);
-  state = rpm_state_create(pool_get_rootdir(pool));
+  state = rpm_state_create(pool, pool_get_rootdir(pool));
   pool_findfileconflicts(pool, &todo, 0, &conflicts, FINDFILECONFLICTS_USE_SOLVABLEFILELIST | FINDFILECONFLICTS_CHECK_DIRALIASING | FINDFILECONFLICTS_USE_ROOTDIR, &iterate_handle, state);
   rpm_state_free(state);
   queue_free(&todo);