ref: refs/heads/master
commit 2bcd164a61705c388f15ef1e4a5f16ee44a6a1ba
Author: Michael Schroeder
Date: Wed Jul 8 18:10:00 2009 +0200
- add repo_free_repodata to remove a repodata from a repo
---
src/repo.c | 10 ++++++++++
src/repo.h | 1 +
2 files changed, 11 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);
diff --git a/src/repo.h b/src/repo.h
index 5a8c015..d61e5c9 100644
--- a/src/repo.h
+++ b/src/repo.h
@@ -174,6 +174,7 @@ typedef struct _KeyValue {
Repodata *repo_add_repodata(Repo *repo, int localpool);
Repodata *repo_last_repodata(Repo *repo);
+void repo_free_repodata(Repo *repo, Repodata *data);
void repo_search(Repo *repo, Id p, Id key, const char *match, int flags, int (*callback)(void *cbdata, Solvable *s, Repodata *data, Repokey *key, KeyValue *kv), void *cbdata);
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org