summaryrefslogtreecommitdiff
path: root/src/transaction.c
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2009-07-14 18:34:49 +0200
committerMichael Schroeder <mls@suse.de>2009-07-14 18:34:49 +0200
commit560f20469f373bc8779587b8692b9949f38fc4bb (patch)
tree3b5df04a4f706bd10261bcdb620dc2ae597cf20e /src/transaction.c
parent99ceec3e3b62689b8de08dcb2a38924687845268 (diff)
downloadlibsolv-560f20469f373bc8779587b8692b9949f38fc4bb.tar.gz
libsolv-560f20469f373bc8779587b8692b9949f38fc4bb.tar.bz2
libsolv-560f20469f373bc8779587b8692b9949f38fc4bb.zip
- add new flags for the load functions:
REPO_LOCALPOOL - create local pool REPO_EXTEND_SOLVABLES - extend existing solvables instead of creating new ones REPO_USE_LOADING - replace repodata in state loading - add repo_add_solv_flags to make repo_add_solv use flags - make repo_add_solv obey the flags instead of using defaults if this is a subload - change loadcallback definition to return a boolean, the callback is now responsible for the loading - change repo_write so that the keyfilter can select which repodata to use (hack) - change pool_addfileprovides to load the complete filelist if needed - add SEARCH_COMPLETE_FILELIST flag to searches - add transaction_create_installedmap/transaction_calc_installsizechange
Diffstat (limited to 'src/transaction.c')
-rw-r--r--src/transaction.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/transaction.c b/src/transaction.c
index 7d67a55..914e94b 100644
--- a/src/transaction.c
+++ b/src/transaction.c
@@ -705,6 +705,53 @@ transaction_installedresult(Transaction *trans, Queue *installedq)
return cutoff;
}
+static void
+transaction_create_installedmap(Transaction *trans, Map *installedmap)
+{
+ Pool *pool = trans->pool;
+ Repo *installed = pool->installed;
+ Solvable *s;
+ Id p;
+ int i;
+
+ map_init(installedmap, pool->nsolvables);
+ for (i = 0; i < trans->steps.count; i++)
+ {
+ p = trans->steps.elements[i];
+ s = pool->solvables + p;
+ if (!installed || s->repo != installed)
+ MAPSET(installedmap, p);
+ }
+ if (installed)
+ {
+ FOR_REPO_SOLVABLES(installed, p, s)
+ if (!MAPTST(&trans->transactsmap, p))
+ MAPSET(installedmap, p);
+ }
+}
+
+int
+transaction_calc_installsizechange(Transaction *trans)
+{
+ Map installedmap;
+ int change;
+
+ transaction_create_installedmap(trans, &installedmap);
+ change = pool_calc_installsizechange(trans->pool, &installedmap);
+ map_free(&installedmap);
+ return change;
+}
+
+void
+transaction_calc_duchanges(Transaction *trans, DUChanges *mps, int nmps)
+{
+ Map installedmap;
+
+ transaction_create_installedmap(trans, &installedmap);
+ pool_calc_duchanges(trans->pool, &installedmap, mps, nmps);
+ map_free(&installedmap);
+}
+
struct _TransactionElement {
Id p; /* solvable id */
Id edges; /* pointer into edges data */