summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2011-07-15 22:42:20 +0000
committerJason Woodward2011-07-15 22:42:20 +0000
commit8655f00e73909a9c59f9d96b36da458b01f2207a (patch)
tree45510c9cefe30a02f7d6e3a2700d911ffe99ebd4
parent27032f55e59e3427b2a24d22547fffd8b8f10aad (diff)
downloadslapt-get-8655f00e73909a9c59f9d96b36da458b01f2207a.tar.gz
make sure to remove the dependencies of a conflict as well as the conflict
-rw-r--r--ChangeLog3
-rw-r--r--src/action.c28
2 files changed, 30 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 8753d0b..6daef9c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
-0.10.2j Jun 26, 2011
+0.10.2j Jul 15, 2011
+ * make sure to remove the conflict's dependencies as well as the conflict
* Updated regex for reading /var/log/packages compressed and uncompressed sizes
* free regex and installed package list in slapt_pkg_action_filelist
* updating unit tests
diff --git a/src/action.c b/src/action.c
index ddd1acc..ad7f484 100644
--- a/src/action.c
+++ b/src/action.c
@@ -92,6 +92,20 @@ void slapt_pkg_action_install(const slapt_rc_config *global_config,
if (conflicts->pkg_count > 0 && global_config->ignore_dep != SLAPT_TRUE) {
unsigned int cindex = 0;
for (cindex = 0; cindex < conflicts->pkg_count;cindex++) {
+ /* make sure to remove the conflict's dependencies as well */
+ unsigned int cdindex = 0;
+ slapt_pkg_list_t *conflict_deps = slapt_is_required_by(global_config,
+ avail_pkgs, installed_pkgs,
+ tran->install_pkgs, tran->remove_pkgs,
+ conflicts->pkgs[cindex]);
+ for (cdindex = 0; cdindex < conflict_deps->pkg_count; ++cdindex) {
+ slapt_pkg_info_t *dep = conflict_deps->pkgs[cdindex];
+ if ( slapt_get_exact_pkg(installed_pkgs,dep->name, dep->version) != NULL) {
+ slapt_add_remove_to_transaction(tran,dep);
+ }
+ }
+ slapt_free_pkg_list(conflict_deps);
+
slapt_add_remove_to_transaction(tran,conflicts->pkgs[cindex]);
}
}
@@ -120,6 +134,20 @@ void slapt_pkg_action_install(const slapt_rc_config *global_config,
if (conflicts->pkg_count > 0 && global_config->ignore_dep != SLAPT_TRUE) {
unsigned int cindex = 0;
for (cindex = 0;cindex < conflicts->pkg_count;cindex++) {
+ /* make sure to remove the conflict's dependencies as well */
+ unsigned int cdindex = 0;
+ slapt_pkg_list_t *conflict_deps = slapt_is_required_by(global_config,
+ avail_pkgs, installed_pkgs,
+ tran->install_pkgs, tran->remove_pkgs,
+ conflicts->pkgs[cindex]);
+ for (cdindex = 0; cdindex < conflict_deps->pkg_count; ++cdindex) {
+ slapt_pkg_info_t *dep = conflict_deps->pkgs[cdindex];
+ if ( slapt_get_exact_pkg(installed_pkgs,dep->name, dep->version) != NULL) {
+ slapt_add_remove_to_transaction(tran,dep);
+ }
+ }
+ slapt_free_pkg_list(conflict_deps);
+
slapt_add_remove_to_transaction(tran,conflicts->pkgs[cindex]);
}
}