summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2016-10-27 14:57:23 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2016-10-27 14:57:23 +0900
commit26ea6e32000a3e6ea392ccc6f8c9d2f51aabd2e4 (patch)
tree822c0e96e5192dcd23d9e440ec9bf09b963dcbfc
parentbe2d42493b7600c4bdff046181f1519a3d44b13c (diff)
downloadlibsolv-26ea6e32000a3e6ea392ccc6f8c9d2f51aabd2e4.tar.gz
libsolv-26ea6e32000a3e6ea392ccc6f8c9d2f51aabd2e4.tar.bz2
libsolv-26ea6e32000a3e6ea392ccc6f8c9d2f51aabd2e4.zip
Imported Upstream version 0.6.18upstream/0.6.18
Change-Id: I592f8068e36a01effad5f86c7f5063b4d0bcd213 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
-rw-r--r--VERSION.cmake2
-rw-r--r--bindings/solv.i25
-rw-r--r--package/libsolv.changes7
-rw-r--r--src/rules.c29
4 files changed, 59 insertions, 4 deletions
diff --git a/VERSION.cmake b/VERSION.cmake
index 1523c2a..466c0d4 100644
--- a/VERSION.cmake
+++ b/VERSION.cmake
@@ -49,5 +49,5 @@ SET(LIBSOLVEXT_SOVERSION "0")
SET(LIBSOLV_MAJOR "0")
SET(LIBSOLV_MINOR "6")
-SET(LIBSOLV_PATCH "17")
+SET(LIBSOLV_PATCH "18")
diff --git a/bindings/solv.i b/bindings/solv.i
index 823deda..4c098b3 100644
--- a/bindings/solv.i
+++ b/bindings/solv.i
@@ -2189,6 +2189,11 @@ rb_eval_string(
bool __ne__(Repo *repo) {
return $self != repo;
}
+#if defined(SWIGPYTHON)
+ int __hash__() {
+ return $self->repoid;
+ }
+#endif
#if defined(SWIGPERL) || defined(SWIGTCL)
%rename("str") __str__;
#endif
@@ -2708,6 +2713,11 @@ rb_eval_string(
bool __ne__(Dep *s) {
return !Dep___eq__($self, s);
}
+#if defined(SWIGPYTHON)
+ int __hash__() {
+ return $self->id;
+ }
+#endif
#if defined(SWIGPERL) || defined(SWIGTCL)
%rename("str") __str__;
#endif
@@ -2955,6 +2965,11 @@ rb_eval_string(
bool __ne__(XSolvable *s) {
return !XSolvable___eq__($self, s);
}
+#if defined(SWIGPYTHON)
+ int __hash__() {
+ return $self->id;
+ }
+#endif
#if defined(SWIGPERL) || defined(SWIGTCL)
%rename("str") __str__;
#endif
@@ -3629,6 +3644,11 @@ rb_eval_string(
bool __ne__(XRule *xr) {
return !XRule___eq__($self, xr);
}
+#if defined(SWIGPYTHON)
+ int __hash__() {
+ return $self->id;
+ }
+#endif
#if defined(SWIGPERL) || defined(SWIGTCL)
%rename("repr") __repr__;
#endif
@@ -3754,6 +3774,11 @@ rb_eval_string(
bool __ne__(XRepodata *xr) {
return !XRepodata___eq__($self, xr);
}
+#if defined(SWIGPYTHON)
+ int __hash__() {
+ return $self->id;
+ }
+#endif
#if defined(SWIGPERL) || defined(SWIGTCL)
%rename("repr") __repr__;
#endif
diff --git a/package/libsolv.changes b/package/libsolv.changes
index b1d41ee..1754808 100644
--- a/package/libsolv.changes
+++ b/package/libsolv.changes
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Fri Jan 29 14:17:26 CET 2016 - mls@suse.de
+
+- fix rule generation for linked packages [bnc#961738]
+- add hash method in bindings for some classes
+- bump version to 0.6.18
+
+-------------------------------------------------------------------
Tue Dec 22 11:49:02 CET 2015 - mls@suse.de
- fix update handling of multiversion packages [bnc#957606]
diff --git a/src/rules.c b/src/rules.c
index 6f35720..4cd53d3 100644
--- a/src/rules.c
+++ b/src/rules.c
@@ -417,6 +417,19 @@ addpkgrule(Solver *solv, Id p, Id p2, Id d, int type, Id dep)
#ifdef ENABLE_LINKED_PKGS
+static int
+addlinks_cmp(const void *ap, const void *bp, void *dp)
+{
+ Pool *pool = dp;
+ Id a = *(Id *)ap;
+ Id b = *(Id *)bp;
+ Solvable *sa = pool->solvables + a;
+ Solvable *sb = pool->solvables + b;
+ if (sa->name != sb->name)
+ return sa->name - sb->name;
+ return sa - sb;
+}
+
static void
addlinks(Solver *solv, Solvable *s, Id req, Queue *qr, Id prv, Queue *qp, Map *m, Queue *workq)
{
@@ -424,6 +437,8 @@ addlinks(Solver *solv, Solvable *s, Id req, Queue *qr, Id prv, Queue *qp, Map *m
int i;
if (!qr->count)
return;
+ if (qp->count > 1)
+ solv_sort(qp->elements, qp->count, sizeof(Id), addlinks_cmp, pool);
#if 0
printf("ADDLINKS %s\n -> %s\n", pool_solvable2str(pool, s), pool_dep2str(pool, req));
for (i = 0; i < qr->count; i++)
@@ -439,9 +454,17 @@ addlinks(Solver *solv, Solvable *s, Id req, Queue *qr, Id prv, Queue *qp, Map *m
addpkgrule(solv, -(s - pool->solvables), 0, pool_queuetowhatprovides(pool, qr), SOLVER_RULE_PKG_REQUIRES, req);
if (qp->count > 1)
{
- Id d = pool_queuetowhatprovides(pool, qp);
- for (i = 0; i < qr->count; i++)
- addpkgrule(solv, -qr->elements[i], 0, d, SOLVER_RULE_PKG_REQUIRES, prv);
+ int j;
+ for (i = j = 0; i < qp->count; i = j)
+ {
+ Id d = pool->solvables[qp->elements[i]].name;
+ for (j = i + 1; j < qp->count; j++)
+ if (d != pool->solvables[qp->elements[j]].name)
+ break;
+ d = pool_ids2whatprovides(pool, qp->elements + i, j - i);
+ for (i = 0; i < qr->count; i++)
+ addpkgrule(solv, -qr->elements[i], 0, d, SOLVER_RULE_PKG_REQUIRES, prv);
+ }
}
else if (qp->count)
{