summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2022-12-21 21:16:41 +0200
committerTimo Teräs <timo.teras@iki.fi>2022-12-21 22:45:43 +0200
commite60a6eb372ced4ad4953fce22ac932e57731c119 (patch)
tree2d69b10a3125afed462238f4eccd473f9e676434
parent8ad1884f1f42c6ba3d21832d57287028eedd6f03 (diff)
downloadapk-tools-e60a6eb372ced4ad4953fce22ac932e57731c119.tar.gz
apk-tools-e60a6eb372ced4ad4953fce22ac932e57731c119.tar.bz2
apk-tools-e60a6eb372ced4ad4953fce22ac932e57731c119.tar.xz
apk-tools-e60a6eb372ced4ad4953fce22ac932e57731c119.zip
solver: fix install_if via provides only
fixes #10721
-rw-r--r--src/solver.c9
-rw-r--r--test/installif6.repo34
-rw-r--r--test/installif6.test10
3 files changed, 51 insertions, 2 deletions
diff --git a/src/solver.c b/src/solver.c
index 2a15d7e..24643f5 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -230,6 +230,13 @@ static void discover_name(struct apk_solver_state *ss, struct apk_name *name)
pkg->ss.max_dep_chain = max(pkg->ss.max_dep_chain,
dep->name->ss.max_dep_chain+1);
}
+ foreach_array_item(pname0, pkg->name->rinstall_if)
+ discover_name(ss, *pname0);
+ foreach_array_item(dep, pkg->provides) {
+ if (dep->name->ss.seen) continue;
+ foreach_array_item(pname0, dep->name->rinstall_if)
+ discover_name(ss, *pname0);
+ }
dbg_printf("discover " PKG_VER_FMT ": tag_ok=%d, tag_pref=%d max_dep_chain=%d selectable=%d\n",
PKG_VER_PRINTF(pkg),
@@ -245,8 +252,6 @@ static void discover_name(struct apk_solver_state *ss, struct apk_name *name)
dbg_printf("discover %s: max_dep_chain=%d no_iif=%d\n",
name->name, name->ss.max_dep_chain, name->ss.no_iif);
}
- foreach_array_item(pname0, name->rinstall_if)
- discover_name(ss, *pname0);
}
static void name_requirers_changed(struct apk_solver_state *ss, struct apk_name *name)
diff --git a/test/installif6.repo b/test/installif6.repo
new file mode 100644
index 0000000..02a126f
--- /dev/null
+++ b/test/installif6.repo
@@ -0,0 +1,34 @@
+C:Q1C4uoV7SdMdDhYg4OCVmI71D8HIA=
+P:qt5-qtbase
+V:1
+S:1
+I:1
+p:so:libQt5Core.so.5=1
+
+C:Q1hdUpqRv5mYgJEqW52UmVsvmyysF=
+P:wayland-libs-client
+V:1
+S:1
+I:1
+p:so:libwayland-client.so.0=1
+
+C:Q1EyN5AdpAOBJWKMR89pp/C66o+OE=
+P:peruse
+V:1
+S:1
+I:1
+D:so:libQt5Core.so.5
+
+C:Q1eVpkasfqZAukAXFYbgwt4xAMZWU=
+P:sway
+V:1
+S:1
+I:1
+D:so:libwayland-client.so.0
+
+C:Q1/hQ3eH2AguTwJVGOz+keypXhXKY=
+P:qt5-qtwayland
+V:1
+S:1
+I:1
+i:wayland-libs-client qt5-qtbase
diff --git a/test/installif6.test b/test/installif6.test
new file mode 100644
index 0000000..37297e9
--- /dev/null
+++ b/test/installif6.test
@@ -0,0 +1,10 @@
+@ARGS
+--test-repo installif6.repo
+add sway peruse
+@EXPECT
+(1/5) Installing qt5-qtbase (1)
+(2/5) Installing peruse (1)
+(3/5) Installing wayland-libs-client (1)
+(4/5) Installing qt5-qtwayland (1)
+(5/5) Installing sway (1)
+OK: 0 MiB in 0 packages