summaryrefslogtreecommitdiffstats
path: root/libopkg/opkg_install.c
diff options
context:
space:
mode:
authorpixdamix@gmail.com <pixdamix@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2012-11-22 04:18:02 (EST)
committer pixdamix@gmail.com <pixdamix@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2012-11-22 04:18:02 (EST)
commit4136443a3a7413ccaa230e023a37084ac1f4d570 (patch)
treedb4909e15f7b4f79982a30a14ccca09bf7f7b544 /libopkg/opkg_install.c
parentc2bab50c95c1e90fdb8ab2c31161f8a416c56e98 (diff)
detect circular dependencies
Add logic to detect circular dependencies. If we see any dependency from any given parent twice, ignore it the second time and print a notice message that we did so. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> git-svn-id: http://opkg.googlecode.com/svn/trunk@641 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg/opkg_install.c')
-rw-r--r--libopkg/opkg_install.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c
index 6ed67d2..be36a64 100644
--- a/libopkg/opkg_install.c
+++ b/libopkg/opkg_install.c
@@ -84,8 +84,14 @@ satisfy_dependencies_for(pkg_t *pkg)
/* The package was uninstalled when we started, but another
dep earlier in this loop may have depended on it and pulled
it in, so check first. */
+ if (is_pkg_in_pkg_vec(dep->wanted_by, pkg)) {
+ opkg_msg(NOTICE,"Breaking cicular dependency on %s for %s.\n", pkg->name, dep->name);
+ continue;
+ }
if ((dep->state_status != SS_INSTALLED) && (dep->state_status != SS_UNPACKED)) {
opkg_msg(DEBUG2,"Calling opkg_install_pkg.\n");
+ if (!is_pkg_in_pkg_vec(dep->wanted_by, pkg))
+ pkg_vec_insert(dep->wanted_by, pkg);
err = opkg_install_pkg(dep, 0);
/* mark this package as having been automatically installed to
* satisfy a dependency */
@@ -115,6 +121,8 @@ satisfy_dependencies_for(pkg_t *pkg)
/* The package was uninstalled when we started, but another
dep earlier in this loop may have depended on it and pulled
it in, so check first. */
+ if (!is_pkg_in_pkg_vec(dep->wanted_by, pkg))
+ pkg_vec_insert(dep->wanted_by, pkg);
if ((dep->state_status != SS_INSTALLED)
&& (dep->state_status != SS_UNPACKED)) {
opkg_msg(DEBUG2,"Calling opkg_install_pkg.\n");