summaryrefslogtreecommitdiff
path: root/src/repodata.c
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2013-04-23 15:49:53 +0200
committerMichael Schroeder <mls@suse.de>2013-04-23 15:49:53 +0200
commit772a525a41907396f60f6642975a5fff193bd1c1 (patch)
treef4d515e50704e662772fa6f33693b73921eafb4c /src/repodata.c
parent7c91488051f947cbe912c0faa6fce3f161ac95d9 (diff)
downloadlibsolv-772a525a41907396f60f6642975a5fff193bd1c1.tar.gz
libsolv-772a525a41907396f60f6642975a5fff193bd1c1.tar.bz2
libsolv-772a525a41907396f60f6642975a5fff193bd1c1.zip
add repodata_translate_id to get rid of some "implement me" assertions
Diffstat (limited to 'src/repodata.c')
-rw-r--r--src/repodata.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/repodata.c b/src/repodata.c
index 2462c10..c150e6f 100644
--- a/src/repodata.c
+++ b/src/repodata.c
@@ -782,6 +782,23 @@ repodata_localize_id(Repodata *data, Id id, int create)
}
Id
+repodata_translate_id(Repodata *data, Repodata *fromdata, Id id, int create)
+{
+ if (!id || !data || !fromdata)
+ return id;
+ if (!data->localpool || !fromdata->localpool)
+ {
+ if (fromdata->localpool)
+ id = repodata_globalize_id(fromdata, id, create);
+ if (data->localpool)
+ id = repodata_localize_id(data, id, create);
+ return id;
+ }
+ /* localpool is set in both data and fromdata */
+ return stringpool_str2id(&data->spool, stringpool_id2str(&fromdata->spool, id), create);
+}
+
+Id
repodata_lookup_id_uninternalized(Repodata *data, Id solvid, Id keyname, Id voidid)
{
Id *ap;