aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Woodward2005-01-13 18:06:36 +0000
committerJason Woodward2005-01-13 18:06:36 +0000
commit1d47501a32725c2222b078d4a26d2b4a475493ab (patch)
treebd6ef460f64471d28511f34dd188b0d1b0002be2 /src
parent2632ca2f1f075e7b91b34c249ca5041a7390ff43 (diff)
downloadslapt-get-1d47501a32725c2222b078d4a26d2b4a475493ab.tar.gz
deps of pkg that conflict are now set to remove just like when conflicts of requested pkg to install are detected
Diffstat (limited to 'src')
-rw-r--r--src/transaction.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/transaction.c b/src/transaction.c
index 5e58d15..cd33b88 100644
--- a/src/transaction.c
+++ b/src/transaction.c
@@ -520,30 +520,26 @@ int add_deps_to_trans(const rc_config *global_config, transaction_t *tran, struc
*/
if( (dep_installed = get_newest_pkg(installed_pkgs,deps->pkgs[c]->name)) == NULL ){
+ pkg_info_t *conflicted_pkg = NULL;
- if ( is_conflicted(tran,avail_pkgs,installed_pkgs,deps->pkgs[c]) == NULL ){
- add_install_to_transaction(tran,deps->pkgs[c]);
- }else{
- /* free_pkg_list(deps); */
- free(deps->pkgs);
- free(deps);
- return -1;
+ if ( (conflicted_pkg = is_conflicted(tran,avail_pkgs,installed_pkgs,deps->pkgs[c])) != NULL ){
+ add_remove_to_transaction(tran,conflicted_pkg);
}
+ add_install_to_transaction(tran,deps->pkgs[c]);
}else{
/* add only if its a valid upgrade */
if(cmp_pkg_versions(dep_installed->version,deps->pkgs[c]->version) < 0 ){
- if ( is_conflicted(tran,avail_pkgs,installed_pkgs,deps->pkgs[c]) == NULL ){
- add_upgrade_to_transaction(tran,dep_installed,deps->pkgs[c]);
- }else{
- /* free_pkg_list(deps); */
- free(deps->pkgs);
- free(deps);
- return -1;
+ pkg_info_t *conflicted_pkg = NULL;
+
+ if ( (conflicted_pkg = is_conflicted(tran,avail_pkgs,installed_pkgs,deps->pkgs[c])) != NULL ){
+ add_remove_to_transaction(tran,conflicted_pkg);
}
+ add_upgrade_to_transaction(tran,dep_installed,deps->pkgs[c]);
}
+
}
}