Update to 0.6.15

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
This commit is contained in:
Igor Gnatenko 2015-12-17 07:08:42 +01:00
parent a3b059da9a
commit be48734934
13 changed files with 8 additions and 522 deletions

1
.gitignore vendored
View File

@ -18,3 +18,4 @@
/libsolv-1f9abfb.tar.gz
/libsolv-0.6.12.tar.gz
/libsolv-0.6.14.tar.gz
/libsolv-0.6.15.tar.gz

View File

@ -1,64 +0,0 @@
From 80ddee19786b7b96d28cde1b972721dc631ee055 Mon Sep 17 00:00:00 2001
From: Michael Schroeder <mls@suse.de>
Date: Mon, 12 Oct 2015 13:43:05 +0200
Subject: [PATCH 1/4] Move allowuninstall map creation
We need to test for them when we have dup jobs
---
src/solver.c | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/src/solver.c b/src/solver.c
index c6cad6b..f371546 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -3561,6 +3561,19 @@ solver_solve(Solver *solv, Queue *job)
MAPSET(&solv->droporphanedmap, p - installed->start);
}
break;
+ case SOLVER_ALLOWUNINSTALL:
+ if (select == SOLVER_SOLVABLE_ALL || (select == SOLVER_SOLVABLE_REPO && installed && what == installed->repoid))
+ solv->allowuninstall_all = 1;
+ FOR_JOB_SELECT(p, pp, select, what)
+ {
+ s = pool->solvables + p;
+ if (s->repo != installed)
+ continue;
+ if (!solv->allowuninstallmap.size)
+ map_grow(&solv->allowuninstallmap, installed->end - installed->start);
+ MAPSET(&solv->allowuninstallmap, p - installed->start);
+ }
+ break;
default:
break;
}
@@ -3608,7 +3621,7 @@ solver_solve(Solver *solv, Queue *job)
if (how & SOLVER_FORCEBEST)
solv->bestupdatemap_all = 1;
}
- if (!solv->dupmap_all || solv->allowuninstall)
+ if (!solv->dupmap_all || solv->allowuninstall || solv->allowuninstall_all || solv->allowuninstallmap.size)
hasdupjob = 1;
break;
default:
@@ -3917,17 +3930,6 @@ solver_solve(Solver *solv, Queue *job)
break;
case SOLVER_ALLOWUNINSTALL:
POOL_DEBUG(SOLV_DEBUG_JOB, "job: allowuninstall %s\n", solver_select2str(pool, select, what));
- if (select == SOLVER_SOLVABLE_ALL || (select == SOLVER_SOLVABLE_REPO && installed && what == installed->repoid))
- solv->allowuninstall_all = 1;
- FOR_JOB_SELECT(p, pp, select, what)
- {
- s = pool->solvables + p;
- if (s->repo != installed)
- continue;
- if (!solv->allowuninstallmap.size)
- map_grow(&solv->allowuninstallmap, installed->end - installed->start);
- MAPSET(&solv->allowuninstallmap, p - installed->start);
- }
break;
default:
POOL_DEBUG(SOLV_DEBUG_JOB, "job: unknown job\n");
--
2.6.1

View File

@ -1,55 +0,0 @@
From 364c90b0d551d1b4b30a4a8de85e7652ff8ac697 Mon Sep 17 00:00:00 2001
From: Michael Schroeder <mls@suse.de>
Date: Tue, 13 Oct 2015 10:36:58 +0200
Subject: [PATCH 1/6] Simplify solver_addduprules a bit
---
src/rules.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/rules.c b/src/rules.c
index ead78d6..480e052 100644
--- a/src/rules.c
+++ b/src/rules.c
@@ -1796,6 +1796,7 @@ void
solver_addduprules(Solver *solv, Map *addedmap)
{
Pool *pool = solv->pool;
+ Repo *installed = solv->installed;
Id p, pp;
Solvable *s, *ps;
int first, i;
@@ -1818,11 +1819,11 @@ solver_addduprules(Solver *solv, Map *addedmap)
break;
if (!MAPTST(&solv->dupinvolvedmap, p))
continue;
- if (solv->installed && ps->repo == solv->installed)
+ if (installed && ps->repo == installed)
{
if (!solv->updatemap.size)
- map_grow(&solv->updatemap, solv->installed->end - solv->installed->start);
- MAPSET(&solv->updatemap, p - solv->installed->start);
+ map_grow(&solv->updatemap, installed->end - installed->start);
+ MAPSET(&solv->updatemap, p - installed->start);
if (!MAPTST(&solv->dupmap, p))
{
Id ip, ipp;
@@ -1835,12 +1836,12 @@ solver_addduprules(Solver *solv, Map *addedmap)
if (is->evr == ps->evr && solvable_identical(ps, is))
break;
}
- if (!ip && solv->dupmap_all && solv->keep_orphans)
+ if (!ip && solv->keep_orphans)
{
/* is this an orphan we should keep? */
- Rule *r = solv->rules + solv->featurerules + (p - solv->installed->start);
+ Rule *r = solv->rules + solv->featurerules + (p - installed->start);
if (!r->p)
- r = solv->rules + solv->updaterules + (p - solv->installed->start);
+ r += solv->updaterules - solv->featurerules;
if (r->p == p && !r->d)
ip = p;
}
--
2.4.3

View File

@ -1,26 +0,0 @@
From 03d4ab0de755a1d20443be70f629f9b0eb3616fa Mon Sep 17 00:00:00 2001
From: Michael Schroeder <mls@suse.de>
Date: Tue, 13 Oct 2015 13:22:14 +0200
Subject: [PATCH 2/6] Drop inline from solver_addtodupmaps
The compiler knows best...
---
src/rules.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/rules.c b/src/rules.c
index 480e052..cb45098 100644
--- a/src/rules.c
+++ b/src/rules.c
@@ -1623,7 +1623,7 @@ add_cleandeps_package(Solver *solv, Id p)
queue_pushunique(solv->cleandeps_updatepkgs, p);
}
-static inline void
+static void
solver_addtodupmaps(Solver *solv, Id p, Id how, int targeted)
{
Pool *pool = solv->pool;
--
2.4.3

View File

@ -1,42 +0,0 @@
From 36a4434559e3885f75f3e1e878f11f3b18fce920 Mon Sep 17 00:00:00 2001
From: Michael Schroeder <mls@suse.de>
Date: Mon, 12 Oct 2015 14:03:25 +0200
Subject: [PATCH 2/4] Prefer to autouninstall orphans
---
src/solver.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/solver.c b/src/solver.c
index f371546..87b6c45 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -217,13 +217,24 @@ autouninstall(Solver *solv, Id *problem)
Rule *r;
if (m && !MAPTST(m, v - solv->updaterules))
continue;
- /* check if identical to feature rule, we don't like that */
+ /* check if identical to feature rule, we don't like that (except for orphans) */
r = solv->rules + solv->featurerules + (v - solv->updaterules);
if (!r->p)
{
/* update rule == feature rule */
if (v > lastfeature)
lastfeature = v;
+ /* prefer orphaned packages in dup mode */
+ if (solv->dupmap_all && solv->keep_orphans)
+ {
+ r = solv->rules + v;
+ if (!r->d && r->p == (solv->installed->start + (v - solv->updaterules)))
+ {
+ lastfeature = v;
+ lastupdate = 0;
+ break;
+ }
+ }
continue;
}
if (v > lastupdate)
--
2.6.1

View File

@ -1,33 +0,0 @@
From d5af25c0ef8fb01e5b0d377a2d7223281991b960 Mon Sep 17 00:00:00 2001
From: Michael Schroeder <mls@suse.de>
Date: Mon, 12 Oct 2015 14:03:55 +0200
Subject: [PATCH 3/4] Check keep_orphans flag in solver_addduprules
solver_addduprules is called if allowuninstall is set
---
src/rules.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/rules.c b/src/rules.c
index b941986..ead78d6 100644
--- a/src/rules.c
+++ b/src/rules.c
@@ -1835,6 +1835,15 @@ solver_addduprules(Solver *solv, Map *addedmap)
if (is->evr == ps->evr && solvable_identical(ps, is))
break;
}
+ if (!ip && solv->dupmap_all && solv->keep_orphans)
+ {
+ /* is this an orphan we should keep? */
+ Rule *r = solv->rules + solv->featurerules + (p - solv->installed->start);
+ if (!r->p)
+ r = solv->rules + solv->updaterules + (p - solv->installed->start);
+ if (r->p == p && !r->d)
+ ip = p;
+ }
if (!ip)
solver_addrule(solv, -p, 0, 0); /* no match, sorry */
else
--
2.6.1

View File

@ -1,61 +0,0 @@
From 8daeacc77ee255e997fe8c9c5ab026435853a0e0 Mon Sep 17 00:00:00 2001
From: Michael Schroeder <mls@suse.de>
Date: Tue, 13 Oct 2015 13:24:49 +0200
Subject: [PATCH 3/6] Rename hasdupjobs to needduprules
---
src/solver.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/solver.c b/src/solver.c
index 87b6c45..c7b21d9 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -3361,7 +3361,7 @@ solver_solve(Solver *solv, Queue *job)
Solvable *s;
Rule *r;
int now, solve_start;
- int hasdupjob = 0;
+ int needduprules = 0;
int hasbestinstalljob = 0;
solve_start = solv_timems(0);
@@ -3633,7 +3633,7 @@ solver_solve(Solver *solv, Queue *job)
solv->bestupdatemap_all = 1;
}
if (!solv->dupmap_all || solv->allowuninstall || solv->allowuninstall_all || solv->allowuninstallmap.size)
- hasdupjob = 1;
+ needduprules = 1;
break;
default:
break;
@@ -3688,7 +3688,7 @@ solver_solve(Solver *solv, Queue *job)
/* create dup maps if needed. We need the maps early to create our
* update rules */
- if (hasdupjob)
+ if (needduprules)
solver_createdupmaps(solv);
/*
@@ -3979,7 +3979,7 @@ solver_solve(Solver *solv, Queue *job)
else
solv->infarchrules = solv->infarchrules_end = solv->nrules;
- if (hasdupjob)
+ if (needduprules)
solver_addduprules(solv, &addedmap);
else
solv->duprules = solv->duprules_end = solv->nrules;
@@ -3989,7 +3989,7 @@ solver_solve(Solver *solv, Queue *job)
else
solv->bestrules = solv->bestrules_end = solv->nrules;
- if (hasdupjob)
+ if (needduprules)
solver_freedupmaps(solv); /* no longer needed */
if (solv->do_yum_obsoletes)
--
2.4.3

View File

@ -1,25 +0,0 @@
From 18f93e12d10aa2a507ffa3689725e21a85a81e7f Mon Sep 17 00:00:00 2001
From: Michael Schroeder <mls@suse.de>
Date: Mon, 12 Oct 2015 14:04:54 +0200
Subject: [PATCH 4/4] Fix spelling, duh...
---
ext/testcase.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ext/testcase.c b/ext/testcase.c
index 3c40451..b9fddef 100644
--- a/ext/testcase.c
+++ b/ext/testcase.c
@@ -164,7 +164,7 @@ static struct selflags2str {
};
static const char *features[] = {
-#ifdef ENABLE_LINKED_PACKAGES
+#ifdef ENABLE_LINKED_PKGS
"linked_packages",
#endif
#ifdef ENABLE_COMPLEX_DEPS
--
2.6.1

View File

@ -1,25 +0,0 @@
From e8ffe5ad6549242908b666f352cf1f59d37c023c Mon Sep 17 00:00:00 2001
From: Michael Schroeder <mls@suse.de>
Date: Tue, 13 Oct 2015 13:28:56 +0200
Subject: [PATCH 4/6] Fix typo in comment
---
src/linkedpkg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/linkedpkg.c b/src/linkedpkg.c
index c5adc9a..7575b0d 100644
--- a/src/linkedpkg.c
+++ b/src/linkedpkg.c
@@ -21,7 +21,7 @@
*
* product:
* created from product data in the repository (which is generated from files
- * in /etc/products.d. In the future we may switch to using product()
+ * in /etc/products.d). In the future we may switch to using product()
* provides of packages.
*
* pattern:
--
2.4.3

View File

@ -1,133 +0,0 @@
From ac0801c908fb25c8d9d1384470c26d6ffc991c3d Mon Sep 17 00:00:00 2001
From: Michael Schroeder <mls@suse.de>
Date: Wed, 14 Oct 2015 11:12:53 +0200
Subject: [PATCH 5/6] Speed up choice rule generation
Reduce the amount of package filtering calls. Brings down the choice
rule creation time from 18ms to 8ms on my system.
---
src/rules.c | 68 ++++++++++++++++++++++++++++++++++++++++---------------------
1 file changed, 45 insertions(+), 23 deletions(-)
diff --git a/src/rules.c b/src/rules.c
index cb45098..97ccc6e 100644
--- a/src/rules.c
+++ b/src/rules.c
@@ -2833,32 +2833,51 @@ solver_rule2rules(Solver *solv, Id rid, Queue *q, int recursive)
/* check if the newest versions of pi still provides the dependency we're looking for */
static int
-solver_choicerulecheck(Solver *solv, Id pi, Rule *r, Map *m)
+solver_choicerulecheck(Solver *solv, Id pi, Rule *r, Map *m, Queue *q)
{
Pool *pool = solv->pool;
Rule *ur;
- Queue q;
- Id p, pp, qbuf[32];
+ Id p, pp;
int i;
- ur = solv->rules + solv->updaterules + (pi - pool->installed->start);
- if (!ur->p)
- ur = solv->rules + solv->featurerules + (pi - pool->installed->start);
- if (!ur->p)
- return 0;
- queue_init_buffer(&q, qbuf, sizeof(qbuf)/sizeof(*qbuf));
- FOR_RULELITERALS(p, pp, ur)
- if (p > 0)
- queue_push(&q, p);
- if (q.count > 1)
- policy_filter_unwanted(solv, &q, POLICY_MODE_CHOOSE);
- for (i = 0; i < q.count; i++)
- if (MAPTST(m, q.elements[i]))
- break;
- /* 1: none of the newest versions provide it */
- i = i == q.count ? 1 : 0;
- queue_free(&q);
- return i;
+ if (!q->count || q->elements[0] != pi)
+ {
+ if (q->count)
+ queue_empty(q);
+ ur = solv->rules + solv->updaterules + (pi - pool->installed->start);
+ if (!ur->p)
+ ur = solv->rules + solv->featurerules + (pi - pool->installed->start);
+ if (!ur->p)
+ return 0;
+ queue_push2(q, pi, 0);
+ FOR_RULELITERALS(p, pp, ur)
+ if (p > 0)
+ queue_push(q, p);
+ }
+ if (q->count == 2)
+ return 1;
+ if (q->count == 3)
+ {
+ p = q->elements[2];
+ return MAPTST(m, p) ? 0 : 1;
+ }
+ if (!q->elements[1])
+ {
+ for (i = 2; i < q->count; i++)
+ if (!MAPTST(m, q->elements[i]))
+ break;
+ if (i == q->count)
+ return 0; /* all provide it, no need to filter */
+ /* some don't provide it, have to filter */
+ queue_deleten(q, 0, 2);
+ policy_filter_unwanted(solv, q, POLICY_MODE_CHOOSE);
+ queue_unshift(q, 1); /* filter mark */
+ queue_unshift(q, pi);
+ }
+ for (i = 2; i < q->count; i++)
+ if (MAPTST(m, q->elements[i]))
+ return 0; /* at least one provides it */
+ return 1; /* none of the new packages provided it */
}
static inline void
@@ -2883,7 +2902,7 @@ solver_addchoicerules(Solver *solv)
Pool *pool = solv->pool;
Map m, mneg;
Rule *r;
- Queue q, qi;
+ Queue q, qi, qcheck;
int i, j, rid, havechoice;
Id p, d, pp;
Id p2, pp2;
@@ -2902,6 +2921,7 @@ solver_addchoicerules(Solver *solv)
solv->choicerules_ref = solv_calloc(solv->pkgrules_end, sizeof(Id));
queue_init(&q);
queue_init(&qi);
+ queue_init(&qcheck);
map_init(&m, pool->nsolvables);
map_init(&mneg, pool->nsolvables);
/* set up negative assertion map from infarch and dup rules */
@@ -3019,7 +3039,7 @@ solver_addchoicerules(Solver *solv)
p2 = qi.elements[i];
if (!p2)
continue;
- if (solver_choicerulecheck(solv, p2, r, &m))
+ if (solver_choicerulecheck(solv, p2, r, &m, &qcheck))
{
/* oops, remove element p from q */
queue_removeelement(&q, qi.elements[i + 1]);
@@ -3028,6 +3048,7 @@ solver_addchoicerules(Solver *solv)
qi.elements[j++] = p2;
}
queue_truncate(&qi, j);
+
if (!q.count || !qi.count)
{
FOR_RULELITERALS(p, pp, r)
@@ -3099,6 +3120,7 @@ solver_addchoicerules(Solver *solv)
}
queue_free(&q);
queue_free(&qi);
+ queue_free(&qcheck);
map_free(&m);
map_free(&mneg);
solv->choicerules_end = solv->nrules;
--
2.4.3

View File

@ -1,41 +0,0 @@
From 8542225bad5c1616b4ebe1ab78a6bf320726afd9 Mon Sep 17 00:00:00 2001
From: Michael Schroeder <mls@suse.de>
Date: Wed, 14 Oct 2015 14:30:46 +0200
Subject: [PATCH 6/6] Make keep_orphans also keep multiversion orphans
installed
Also make keep_orphanse add multiversion orphans to the
update rule, thus enforcing that they stay installed.
---
src/rules.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/rules.c b/src/rules.c
index 97ccc6e..381cb22 100644
--- a/src/rules.c
+++ b/src/rules.c
@@ -1302,6 +1302,8 @@ solver_addupdaterule(Solver *solv, Solvable *s, int allow_all)
if (j == 0 && p == -SYSTEMSOLVABLE && solv->dupmap_all)
{
queue_push(&solv->orphaned, s - pool->solvables); /* also treat as orphaned */
+ if (solv->keep_orphans && !(solv->droporphanedmap_all || (solv->droporphanedmap.size && MAPTST(&solv->droporphanedmap, s - pool->solvables - solv->installed->start))))
+ p = s - pool->solvables; /* keep this orphaned package installed */
j = qs.count;
}
qs.count = j;
@@ -1844,6 +1846,12 @@ solver_addduprules(Solver *solv, Map *addedmap)
r += solv->updaterules - solv->featurerules;
if (r->p == p && !r->d)
ip = p;
+ else if (solv->dupmap_all && solv->multiversion.size)
+ {
+ r = solv->rules + solv->updaterules + (p - solv->installed->start);
+ if (r->p == p)
+ ip = p;
+ }
}
if (!ip)
solver_addrule(solv, -p, 0, 0); /* no match, sorry */
--
2.4.3

View File

@ -29,26 +29,13 @@
%filter_setup
Name: libsolv
Version: 0.6.14
Release: 7%{?dist}
Version: 0.6.15
Release: 1%{?dist}
License: BSD
Url: https://github.com/openSUSE/libsolv
Source: https://github.com/openSUSE/libsolv/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0: 0001-ruby-make-compatible-with-ruby-2.2.patch
Patch1: 0001-Move-allowuninstall-map-creation.patch
Patch2: 0002-Prefer-to-autouninstall-orphans.patch
Patch3: 0003-Check-keep_orphans-flag-in-solver_addduprules.patch
Patch4: 0004-Fix-spelling-duh.patch
Patch5: 0001-Simplify-solver_addduprules-a-bit.patch
Patch6: 0002-Drop-inline-from-solver_addtodupmaps.patch
Patch7: 0003-Rename-hasdupjobs-to-needduprules.patch
Patch8: 0004-Fix-typo-in-comment.patch
Patch9: 0005-Speed-up-choice-rule-generation.patch
Patch10: 0006-Make-keep_orphans-also-keep-multiversion-orphans-ins.patch
BuildRequires: git-core
Group: Development/Libraries
Summary: Package dependency solver
BuildRequires: cmake libdb-devel expat-devel rpm-devel zlib-devel
@ -144,7 +131,7 @@ Perl bindings for sat solver.
%endif
%prep
%autosetup -S git
%autosetup -p1
%if %{with python3}
rm -rf %{py3dir}
@ -237,6 +224,9 @@ make ARGS="-V" test
%endif
%changelog
* Thu Dec 17 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.6.15-1
- Update to 0.6.15
* Tue Dec 08 2015 Jaroslav Mracek <jmracek@redhat.com> - 0.6.14-1
- Rebase to upstream b1ea392
- Enable bz2 compression support (Mikolaj Izdebski <mizdebsk@redhat.com>) (RhBug:1226647)

View File

@ -1 +1 @@
3bacd80472e4c8d5dd66d22f435f9258 libsolv-0.6.14.tar.gz
463a098ec418695af2d761ab6b08ceb5 libsolv-0.6.15.tar.gz