From 19032dd0c1d2167793399473a1b490be1b635d17 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Thu, 27 Oct 2016 14:57:05 +0900 Subject: [PATCH] Imported Upstream version 0.6.16 Change-Id: Ie9a7a7345406dc0b4a9637e42502e2d98d601a46 Signed-off-by: DongHun Kwak --- VERSION.cmake | 2 +- package/libsolv.changes | 6 ++ src/rules.c | 8 +- src/solver.c | 2 +- .../{dup_allowuninstall => dup_allowuninstall.t} | 0 .../{dup_multiversion1 => dup_multiversion1.t} | 0 .../{dup_multiversion2 => dup_multiversion2.t} | 7 +- .../{dup_multiversion3 => dup_multiversion3.t} | 0 .../{dup_noarchchange => dup_noarchchange.t} | 0 test/testcases/distupgrade/dup_orphan1.t | 78 +++++++++++++++++ test/testcases/distupgrade/dup_orphan2.t | 98 ++++++++++++++++++++++ test/testcases/distupgrade/dup_orphan3.t | 95 +++++++++++++++++++++ 12 files changed, 291 insertions(+), 5 deletions(-) rename test/testcases/distupgrade/{dup_allowuninstall => dup_allowuninstall.t} (100%) rename test/testcases/distupgrade/{dup_multiversion1 => dup_multiversion1.t} (100%) rename test/testcases/distupgrade/{dup_multiversion2 => dup_multiversion2.t} (94%) rename test/testcases/distupgrade/{dup_multiversion3 => dup_multiversion3.t} (100%) rename test/testcases/distupgrade/{dup_noarchchange => dup_noarchchange.t} (100%) create mode 100644 test/testcases/distupgrade/dup_orphan1.t create mode 100644 test/testcases/distupgrade/dup_orphan2.t create mode 100644 test/testcases/distupgrade/dup_orphan3.t diff --git a/VERSION.cmake b/VERSION.cmake index 7ba4cb6..d8b6373 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 "15") +SET(LIBSOLV_PATCH "16") diff --git a/package/libsolv.changes b/package/libsolv.changes index 8714d4a..855d7ab 100644 --- a/package/libsolv.changes +++ b/package/libsolv.changes @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Mon Dec 21 12:59:19 CET 2015 - mls@suse.de + +- fix orphan handling for dup with keeporphans set [bnc#957606] +- bump version to 0.6.16 + +------------------------------------------------------------------- Mon Dec 14 15:48:01 CET 2015 - mls@suse.de - change product links to also look at timestamps [bnc#956443] diff --git a/src/rules.c b/src/rules.c index 248b1cd..70d6b07 100644 --- a/src/rules.c +++ b/src/rules.c @@ -1325,7 +1325,7 @@ solver_addupdaterule(Solver *solv, Solvable *s, int allow_all) } } } - if (!isorphaned && p == -SYSTEMSOLVABLE && solv->dupmap.size) + if (!isorphaned && p == -SYSTEMSOLVABLE && qs.count && solv->dupmap.size) p = s - pool->solvables; /* let the dup rules sort it out */ if (qs.count && p == -SYSTEMSOLVABLE) p = queue_shift(&qs); @@ -1864,6 +1864,12 @@ solver_addduprules(Solver *solv, Map *addedmap) solver_addrule(solv, -p, 0, solv->specialupdaters[p - installed->start]); continue; } + if (!r->p || (r->p == p && !r->d && !r->w2)) + { + /* this is an orphan */ + MAPSET(&solv->dupmap, p); /* for best rules processing */ + continue; + } solver_addrule(solv, -p, 0, 0); /* no match, sorry */ } } diff --git a/src/solver.c b/src/solver.c index 2e28b7d..261f367 100644 --- a/src/solver.c +++ b/src/solver.c @@ -228,7 +228,7 @@ autouninstall(Solver *solv, Id *problem) if (solv->keep_orphans) { r = solv->rules + v; - if (!r->d && r->p == (solv->installed->start + (v - solv->updaterules))) + if (!r->d && !r->w2 && r->p == (solv->installed->start + (v - solv->updaterules))) { lastfeature = v; lastupdate = 0; diff --git a/test/testcases/distupgrade/dup_allowuninstall b/test/testcases/distupgrade/dup_allowuninstall.t similarity index 100% rename from test/testcases/distupgrade/dup_allowuninstall rename to test/testcases/distupgrade/dup_allowuninstall.t diff --git a/test/testcases/distupgrade/dup_multiversion1 b/test/testcases/distupgrade/dup_multiversion1.t similarity index 100% rename from test/testcases/distupgrade/dup_multiversion1 rename to test/testcases/distupgrade/dup_multiversion1.t diff --git a/test/testcases/distupgrade/dup_multiversion2 b/test/testcases/distupgrade/dup_multiversion2.t similarity index 94% rename from test/testcases/distupgrade/dup_multiversion2 rename to test/testcases/distupgrade/dup_multiversion2.t index 18909eb..6708896 100644 --- a/test/testcases/distupgrade/dup_multiversion2 +++ b/test/testcases/distupgrade/dup_multiversion2.t @@ -89,8 +89,10 @@ job multiversion name a job distupgrade all packages # a-1-1 is treated as orphaned and stays behind result transaction,problems -#>erase b-1-1.i686@system +#>erase a-1-1.i686@system #>install a-2-1.i686@available +#>upgrade b-1-1.i686@system b-2-1.i686@available + nextjob @@ -100,7 +102,8 @@ job multiversion name a job distupgrade repo available # a-1-1 is treated as orphaned and stays behind result transaction,problems -#>erase b-1-1.i686@system +#>erase a-1-1.i686@system #>install a-2-1.i686@available +#>upgrade b-1-1.i686@system b-2-1.i686@available diff --git a/test/testcases/distupgrade/dup_multiversion3 b/test/testcases/distupgrade/dup_multiversion3.t similarity index 100% rename from test/testcases/distupgrade/dup_multiversion3 rename to test/testcases/distupgrade/dup_multiversion3.t diff --git a/test/testcases/distupgrade/dup_noarchchange b/test/testcases/distupgrade/dup_noarchchange.t similarity index 100% rename from test/testcases/distupgrade/dup_noarchchange rename to test/testcases/distupgrade/dup_noarchchange.t diff --git a/test/testcases/distupgrade/dup_orphan1.t b/test/testcases/distupgrade/dup_orphan1.t new file mode 100644 index 0000000..3c4976a --- /dev/null +++ b/test/testcases/distupgrade/dup_orphan1.t @@ -0,0 +1,78 @@ +# test dup with orphaned packages +# +# part 1: simple update +# +# dup should leave orphaned a installed +# +repo system 0 testtags +#>=Pkg: a 1 1 i686 +#>=Pkg: b 1 1 i686 +repo available 0 testtags +#>=Pkg: b 2 1 i686 +system i686 * system + +job distupgrade all packages +result transaction,problems +#>upgrade b-1-1.i686@system b-2-1.i686@available + +nextjob + +job distupgrade repo available +result transaction,problems +#>upgrade b-1-1.i686@system b-2-1.i686@available + + +### same with keeporphans + +nextjob + +solverflags keeporphans +job distupgrade all packages +result transaction,problems +#>upgrade b-1-1.i686@system b-2-1.i686@available + +nextjob + +solverflags keeporphans +job distupgrade repo available +result transaction,problems +#>upgrade b-1-1.i686@system b-2-1.i686@available + + +### same with allowuninstall + +nextjob + +solverflags allowuninstall +job distupgrade all packages +result transaction,problems +#>upgrade b-1-1.i686@system b-2-1.i686@available + + +nextjob + +solverflags allowuninstall +job distupgrade repo available +result transaction,problems +#>upgrade b-1-1.i686@system b-2-1.i686@available + + +### same with allowuninstall and keeporphans + +nextjob + +solverflags allowuninstall keeporphans +job distupgrade all packages +result transaction,problems +#>upgrade b-1-1.i686@system b-2-1.i686@available + + +nextjob + +solverflags allowuninstall keeporphans +job distupgrade repo available +result transaction,problems +#>upgrade b-1-1.i686@system b-2-1.i686@available + + + diff --git a/test/testcases/distupgrade/dup_orphan2.t b/test/testcases/distupgrade/dup_orphan2.t new file mode 100644 index 0000000..f4e746e --- /dev/null +++ b/test/testcases/distupgrade/dup_orphan2.t @@ -0,0 +1,98 @@ +# test dup with orphaned packages +# +# part 2: update conflicts with the orphan +# +# dup should leave orphaned a installed +# for "distupgrade repo available", a is not involved +# in the dup and thus not considered orphan. +# + +repo system 0 testtags +#>=Pkg: a 1 1 i686 +#>=Pkg: b 1 1 i686 +repo available 0 testtags +#>=Pkg: b 2 1 i686 +#>=Con: a +system i686 * system + +job distupgrade all packages +result transaction,problems +#>erase a-1-1.i686@system +#>upgrade b-1-1.i686@system b-2-1.i686@available + +nextjob + +job distupgrade repo available +result transaction,problems +#>erase a-1-1.i686@system +#>problem 4d4de423 info package b-2-1.i686 conflicts with a provided by a-1-1.i686 +#>problem 4d4de423 solution 2cf4745c erase a-1-1.i686@system +#>problem 4d4de423 solution 5a433aff allow b-1-1.i686@system +#>problem 4d4de423 solution ce4305f2 erase b-1-1.i686@system +#>upgrade b-1-1.i686@system b-2-1.i686@available + +### keeporphans + +nextjob + +solverflags keeporphans +job distupgrade all packages +result transaction,problems +#>problem 4d4de423 info package b-2-1.i686 conflicts with a provided by a-1-1.i686 +#>problem 4d4de423 solution 2cf4745c erase a-1-1.i686@system +#>problem 4d4de423 solution 5a433aff allow b-1-1.i686@system +#>problem 4d4de423 solution ce4305f2 erase b-1-1.i686@system + +nextjob + +solverflags keeporphans +job distupgrade repo available +result transaction,problems +#>erase a-1-1.i686@system +#>problem 4d4de423 info package b-2-1.i686 conflicts with a provided by a-1-1.i686 +#>problem 4d4de423 solution 2cf4745c erase a-1-1.i686@system +#>problem 4d4de423 solution 5a433aff allow b-1-1.i686@system +#>problem 4d4de423 solution ce4305f2 erase b-1-1.i686@system +#>upgrade b-1-1.i686@system b-2-1.i686@available + + +### same with allowuninstall + +nextjob + +solverflags allowuninstall +job distupgrade all packages +result transaction,problems +#>erase a-1-1.i686@system +#>upgrade b-1-1.i686@system b-2-1.i686@available + + +nextjob + +solverflags allowuninstall +job distupgrade repo available +result transaction,problems +#>erase b-1-1.i686@system + + +### same with allowuninstall and keeporphans + +nextjob + +solverflags allowuninstall keeporphans +job distupgrade all packages +result transaction,problems +#>erase a-1-1.i686@system +#>upgrade b-1-1.i686@system b-2-1.i686@available + + +nextjob + +solverflags allowuninstall keeporphans +job distupgrade repo available +result transaction,problems +#>erase a-1-1.i686@system +#>upgrade b-1-1.i686@system b-2-1.i686@available + + + diff --git a/test/testcases/distupgrade/dup_orphan3.t b/test/testcases/distupgrade/dup_orphan3.t new file mode 100644 index 0000000..6c04348 --- /dev/null +++ b/test/testcases/distupgrade/dup_orphan3.t @@ -0,0 +1,95 @@ +# test dup with orphaned packages +# +# part 3: a is not really an orphan, but cannott be downgraded +# + +repo system 0 testtags +#>=Pkg: a 1 1 i686 +#>=Pkg: b 1 1 i686 +repo available 0 testtags +#>=Pkg: a 1 0 i686 +#>=Pkg: b 2 1 i686 +system i686 * system + +solverflags !dupallowdowngrade +job distupgrade all packages +result transaction,problems +#>downgrade a-1-1.i686@system a-1-0.i686@available +#>upgrade b-1-1.i686@system b-2-1.i686@available +#>problem c43b1300 info problem with installed package a-1-1.i686 +#>problem c43b1300 solution c43b1300 replace a-1-1.i686@system a-1-0.i686@available + +nextjob + +solverflags !dupallowdowngrade +job distupgrade repo available +result transaction,problems +#>downgrade a-1-1.i686@system a-1-0.i686@available +#>upgrade b-1-1.i686@system b-2-1.i686@available +#>problem c43b1300 info problem with installed package a-1-1.i686 +#>problem c43b1300 solution c43b1300 replace a-1-1.i686@system a-1-0.i686@available + +### keeporphans + +nextjob + +solverflags !dupallowdowngrade keeporphans +job distupgrade all packages +result transaction,problems +#>downgrade a-1-1.i686@system a-1-0.i686@available +#>upgrade b-1-1.i686@system b-2-1.i686@available +#>problem c43b1300 info problem with installed package a-1-1.i686 +#>problem c43b1300 solution c43b1300 replace a-1-1.i686@system a-1-0.i686@available + +nextjob + +solverflags !dupallowdowngrade keeporphans +job distupgrade repo available +result transaction,problems +#>downgrade a-1-1.i686@system a-1-0.i686@available +#>upgrade b-1-1.i686@system b-2-1.i686@available +#>problem c43b1300 info problem with installed package a-1-1.i686 +#>problem c43b1300 solution c43b1300 replace a-1-1.i686@system a-1-0.i686@available + + +### same with allowuninstall + +nextjob + +solverflags !dupallowdowngrade allowuninstall +job distupgrade all packages +result transaction,problems +#>downgrade a-1-1.i686@system a-1-0.i686@available +#>upgrade b-1-1.i686@system b-2-1.i686@available + + +nextjob + +solverflags !dupallowdowngrade allowuninstall +job distupgrade repo available +result transaction,problems +#>downgrade a-1-1.i686@system a-1-0.i686@available +#>upgrade b-1-1.i686@system b-2-1.i686@available + + +### same with allowuninstall and keeporphans + +nextjob + +solverflags !dupallowdowngrade allowuninstall keeporphans +job distupgrade all packages +result transaction,problems +#>downgrade a-1-1.i686@system a-1-0.i686@available +#>upgrade b-1-1.i686@system b-2-1.i686@available + + +nextjob + +solverflags !dupallowdowngrade allowuninstall keeporphans +job distupgrade repo available +result transaction,problems +#>downgrade a-1-1.i686@system a-1-0.i686@available +#>upgrade b-1-1.i686@system b-2-1.i686@available + + + -- 2.7.4