summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2012-11-06 12:16:35 +0100
committerMichael Schroeder <mls@suse.de>2012-11-06 12:16:35 +0100
commit5f153e320c6f4d7073b6a145236683bd0dc89c13 (patch)
tree4370d11be40d5c3a11f44591f4518ce27b804d94
parent5ae7585438805eb0b3896dfb62e5e75617ab3993 (diff)
downloadlibsolv-5f153e320c6f4d7073b6a145236683bd0dc89c13.tar.gz
libsolv-5f153e320c6f4d7073b6a145236683bd0dc89c13.tar.bz2
libsolv-5f153e320c6f4d7073b6a145236683bd0dc89c13.zip
rename repodata_delete to repodata_set_deleted, add repo_set_deleted and solvable_set_deleted
-rwxr-xr-xexamples/pysolv2
-rw-r--r--src/libsolv.ver6
-rw-r--r--src/repo.c56
-rw-r--r--src/repo.h1
-rw-r--r--src/repodata.c4
-rw-r--r--src/repodata.h4
-rw-r--r--src/solvable.c5
-rw-r--r--src/solvable.h1
8 files changed, 72 insertions, 7 deletions
diff --git a/examples/pysolv b/examples/pysolv
index 1400be8..ddf0b9f 100755
--- a/examples/pysolv
+++ b/examples/pysolv
@@ -931,7 +931,7 @@ if cmd == 'install' or cmd == 'erase' or cmd == 'up' or cmd == 'dup' or cmd == '
# argh, p is just the name of the package
if p in erasenamehelper:
p = erasenamehelper[p]
- print "erase", p
+ print "erase", p
runproblems = ts.run(runCallback, '')
if runproblems:
print runproblems
diff --git a/src/libsolv.ver b/src/libsolv.ver
index f0bb650..b19792f 100644
--- a/src/libsolv.ver
+++ b/src/libsolv.ver
@@ -155,6 +155,7 @@ SOLV_1.0 {
repo_matchvalue;
repo_reserve_ids;
repo_search;
+ repo_set_deleted;
repo_set_deparray;
repo_set_id;
repo_set_idarray;
@@ -173,8 +174,6 @@ SOLV_1.0 {
repodata_add_poolstr_array;
repodata_chk2str;
repodata_create_stubs;
- repodata_delete;
- repodata_delete_uninternalized;
repodata_dir2str;
repodata_disable_paging;
repodata_empty;
@@ -208,6 +207,8 @@ SOLV_1.0 {
repodata_set_checksum;
repodata_set_constant;
repodata_set_constantid;
+ repodata_set_deleted;
+ repodata_set_deleted_uninternalized;
repodata_set_id;
repodata_set_idarray;
repodata_set_location;
@@ -281,6 +282,7 @@ SOLV_1.0 {
solvable_lookup_type;
solvable_lookup_void;
solvable_selfprovidedep;
+ solvable_set_deleted;
solvable_set_deparray;
solvable_set_id;
solvable_set_idarray;
diff --git a/src/repo.c b/src/repo.c
index 594295f..ed845ef 100644
--- a/src/repo.c
+++ b/src/repo.c
@@ -1613,6 +1613,62 @@ repo_set_idarray(Repo *repo, Id p, Id keyname, Queue *q)
}
void
+repo_set_deleted(Repo *repo, Id p, Id keyname)
+{
+ Repodata *data;
+ if (p >= 0)
+ {
+ Solvable *s = repo->pool->solvables + p;
+ switch (keyname)
+ {
+ case SOLVABLE_NAME:
+ s->name = 0;
+ return;
+ case SOLVABLE_ARCH:
+ s->arch = 0;
+ return;
+ case SOLVABLE_EVR:
+ s->evr = 0;
+ return;
+ case SOLVABLE_VENDOR:
+ s->vendor = 0;
+ return;
+ case RPM_RPMDBID:
+ if (repo->rpmdbid)
+ repo->rpmdbid[p] = 0;
+ return;
+ case SOLVABLE_PROVIDES:
+ s->provides = 0;
+ return;
+ case SOLVABLE_OBSOLETES:
+ s->obsoletes = 0;
+ return;
+ case SOLVABLE_CONFLICTS:
+ s->conflicts = 0;
+ return;
+ case SOLVABLE_REQUIRES:
+ s->requires = 0;
+ return;
+ case SOLVABLE_RECOMMENDS:
+ s->recommends = 0;
+ return;
+ case SOLVABLE_SUGGESTS:
+ s->suggests = 0;
+ return;
+ case SOLVABLE_SUPPLEMENTS:
+ s->supplements = 0;
+ case SOLVABLE_ENHANCES:
+ s->enhances = 0;
+ return;
+ default:
+ break;
+ }
+ }
+ data = repo_last_repodata(repo);
+ repodata_set_deleted(data, p, keyname);
+}
+
+void
repo_internalize(Repo *repo)
{
int i;
diff --git a/src/repo.h b/src/repo.h
index d839157..90ad055 100644
--- a/src/repo.h
+++ b/src/repo.h
@@ -142,6 +142,7 @@ void repo_add_idarray(Repo *repo, Id p, Id keyname, Id id);
void repo_add_deparray(Repo *repo, Id p, Id keyname, Id dep, Id marker);
void repo_set_idarray(Repo *repo, Id p, Id keyname, Queue *q);
void repo_set_deparray(Repo *repo, Id p, Id keyname, Queue *q, Id marker);
+void repo_set_deleted(Repo *repo, Id p, Id keyname);
void repo_internalize(Repo *repo);
void repo_disable_paging(Repo *repo);
diff --git a/src/repodata.c b/src/repodata.c
index 520984c..e91fffb 100644
--- a/src/repodata.c
+++ b/src/repodata.c
@@ -2449,7 +2449,7 @@ repodata_add_flexarray(Repodata *data, Id solvid, Id keyname, Id ghandle)
}
void
-repodata_delete_uninternalized(Repodata *data, Id solvid, Id keyname)
+repodata_set_deleted_uninternalized(Repodata *data, Id solvid, Id keyname)
{
Id *pp, *ap, **app;
app = repodata_get_attrp(data, solvid);
@@ -2475,7 +2475,7 @@ repodata_delete_uninternalized(Repodata *data, Id solvid, Id keyname)
/* XXX: does not work correctly, needs fix in iterators! */
void
-repodata_delete(Repodata *data, Id solvid, Id keyname)
+repodata_set_deleted(Repodata *data, Id solvid, Id keyname)
{
Repokey key;
key.name = keyname;
diff --git a/src/repodata.h b/src/repodata.h
index fb755bc..8e9e271 100644
--- a/src/repodata.h
+++ b/src/repodata.h
@@ -262,8 +262,8 @@ void repodata_add_poolstr_array(Repodata *data, Id solvid, Id keyname, const cha
void repodata_add_fixarray(Repodata *data, Id solvid, Id keyname, Id ghandle);
void repodata_add_flexarray(Repodata *data, Id solvid, Id keyname, Id ghandle);
-void repodata_delete(Repodata *data, Id solvid, Id keyname);
-void repodata_delete_uninternalized(Repodata *data, Id solvid, Id keyname);
+void repodata_set_deleted(Repodata *data, Id solvid, Id keyname);
+void repodata_set_deleted_uninternalized(Repodata *data, Id solvid, Id keyname);
/*
merge/swap attributes from one solvable to another
diff --git a/src/solvable.c b/src/solvable.c
index 63cc9f2..2a73e0a 100644
--- a/src/solvable.c
+++ b/src/solvable.c
@@ -733,3 +733,8 @@ solvable_set_deparray(Solvable *s, Id keyname, Queue *q, Id marker)
repo_set_deparray(s->repo, s - s->repo->pool->solvables, keyname, q, marker);
}
+void
+solvable_set_deleted(Solvable *s, Id keyname)
+{
+ repo_set_deleted(s->repo, s - s->repo->pool->solvables, keyname);
+}
diff --git a/src/solvable.h b/src/solvable.h
index 955464e..3ef9fe5 100644
--- a/src/solvable.h
+++ b/src/solvable.h
@@ -70,6 +70,7 @@ void solvable_add_idarray(Solvable *s, Id keyname, Id id);
void solvable_add_deparray(Solvable *s, Id keyname, Id dep, Id marker);
void solvable_set_idarray(Solvable *s, Id keyname, Queue *q);
void solvable_set_deparray(Solvable *s, Id keyname, Queue *q, Id marker);
+void solvable_set_deleted(Solvable *s, Id keyname);
int solvable_identical(Solvable *s1, Solvable *s2);
Id solvable_selfprovidedep(Solvable *s);