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 21:16:41 +0200
commit4476e36b7dd5083211d061adb0a75c18748df8c8 (patch)
treecff436e4e1d9ea4cf568f0d28f2009e0be34af6a
parentde0cad11c9f87d945f94612e20dee824aca3df6a (diff)
downloadapk-tools-4476e36b7dd5083211d061adb0a75c18748df8c8.tar.gz
apk-tools-4476e36b7dd5083211d061adb0a75c18748df8c8.tar.bz2
apk-tools-4476e36b7dd5083211d061adb0a75c18748df8c8.tar.xz
apk-tools-4476e36b7dd5083211d061adb0a75c18748df8c8.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 68aec53..a591818 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -231,6 +231,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),
@@ -246,8 +253,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