summaryrefslogtreecommitdiff
path: root/src/repo.c
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2009-07-08 18:10:00 +0200
committerMichael Schroeder <mls@suse.de>2009-07-08 18:10:00 +0200
commit4e77c970b9cd18fe4c696bdcfe6c4412bfddbfe4 (patch)
tree8aae2b1898e2379676b51fd15d6fb30107b33871 /src/repo.c
parent6c8acb95c16cbc59b123a36ecff563b1d9269ce2 (diff)
downloadlibsolv-4e77c970b9cd18fe4c696bdcfe6c4412bfddbfe4.tar.gz
libsolv-4e77c970b9cd18fe4c696bdcfe6c4412bfddbfe4.tar.bz2
libsolv-4e77c970b9cd18fe4c696bdcfe6c4412bfddbfe4.zip
- add repo_free_repodata to remove a repodata from a repo
Diffstat (limited to 'src/repo.c')
-rw-r--r--src/repo.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/repo.c b/src/repo.c
index 494896e..25e07ff 100644
--- a/src/repo.c
+++ b/src/repo.c
@@ -987,6 +987,16 @@ repo_last_repodata(Repo *repo)
}
void
+repo_free_repodata(Repo *repo, Repodata *data)
+{
+ int i = data - repo->repodata;
+ repodata_free(data);
+ if (i < repo->nrepodata - 1)
+ memmove(repo->repodata + i, repo->repodata + i + 1, (repo->nrepodata - 1 - i) * sizeof(Repodata));
+ repo->nrepodata--;
+}
+
+void
repo_set_id(Repo *repo, Id p, Id keyname, Id id)
{
Repodata *data = repo_last_repodata(repo);