Commit e0f9b089 authored by Timo Teräs's avatar Timo Teräs

solver: enforce conflicts during upgrades and new pkg installs

This makes sure any conflicted packages will be removed first.
Useful if we know there are conflicting files, and want to avoid
adding potentially harmful replaces line. Add a test case for
this too.
parent f2d9a144
......@@ -762,11 +762,20 @@ static void cset_check_removal_by_iif(struct apk_solver_state *ss, struct apk_na
static void cset_gen_name_change(struct apk_solver_state *ss, struct apk_name *name)
{
struct apk_name **pname;
struct apk_package *pkg = name->ss.chosen.pkg, *opkg;
struct apk_package *pkg, *opkg;
struct apk_dependency *d;
if (pkg == NULL || pkg->ss.in_changeset)
if (name->ss.in_changeset) return;
pkg = name->ss.chosen.pkg;
if (pkg == NULL) {
/* Package removal */
opkg = name->ss.installed_pkg;
if (opkg) cset_gen_name_remove(ss, opkg);
name->ss.in_changeset = 1;
return;
}
if (pkg->ss.in_changeset) return;
pkg->ss.in_changeset = 1;
pkg->name->ss.in_changeset = 1;
......
C:Q1EyN5AdpAOBJWKMR89pp/C66o+OE=
P:libold
V:1
S:1
I:1
C:Q1eVpkasfqZAukAXFYbgwt4xAEEEe=
P:app
V:1
S:1
I:1
D:libold
C:Q1EyN5AdpAOBJWKMR89pp/C66o+OE=
P:libold
V:1
S:1
I:1
C:Q1EyN5AdpAOBJWKMR89pp/C66o+FE=
P:libnew
V:1
S:1
I:1
D:!libold
C:Q1eVpkasfqZAukAXFYbgwt4xAEEEe=
P:app
V:1
S:1
I:1
D:libold
C:Q1EyN5AdpAOBJWKMR89pp/C77FFFF=
P:app
V:2
S:1
I:1
D:libnew
@ARGS
--test-repo upgrade.repo
--test-instdb upgrade.installed
--test-world app
upgrade
@EXPECT
(1/3) Purging libold (1)
(2/3) Installing libnew (1)
(3/3) Upgrading app (1 -> 2)
OK: 0 MiB in 2 packages
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment