aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Woodward2004-10-30 03:10:23 +0000
committerJason Woodward2004-10-30 03:10:23 +0000
commitbe9deafad5be6f4778696a085f46375dfb10d5ce (patch)
tree62450e90445edf7f726af685fc89a005b02b9883 /src
parent286eb6858a9e1e2495f2bd8553dd35111b1b6b06 (diff)
downloadslapt-get-be9deafad5be6f4778696a085f46375dfb10d5ce.tar.gz
--install no longer recursively install deps that where excluded
Diffstat (limited to 'src')
-rw-r--r--src/action.c10
-rw-r--r--src/transaction.c17
2 files changed, 27 insertions, 0 deletions
diff --git a/src/action.c b/src/action.c
index 9df0802..3c5ada4 100644
--- a/src/action.c
+++ b/src/action.c
@@ -93,6 +93,8 @@ void pkg_action_install(const rc_config *global_config,const pkg_action_args_t *
/* this way we install the most up to date pkg */
if ( is_conflicted(&tran,avail_pkgs,installed_pkgs,pkg) == 0 )
add_install_to_transaction(&tran,pkg);
+ }else{
+ add_exclude_to_transaction(&tran,pkg);
}
}else{ /* else we upgrade or reinstall */
@@ -106,6 +108,8 @@ void pkg_action_install(const rc_config *global_config,const pkg_action_args_t *
if( add_deps_to_trans(global_config,&tran,avail_pkgs,installed_pkgs,pkg) == 0 ){
if ( is_conflicted(&tran,avail_pkgs,installed_pkgs,pkg) == 0 )
add_upgrade_to_transaction(&tran,installed_pkg,pkg);
+ }else{
+ add_exclude_to_transaction(&tran,pkg);
}
}else{
@@ -404,6 +408,8 @@ void pkg_action_upgrade_all(const rc_config *global_config){
if ( is_conflicted(&tran,avail_pkgs,installed_pkgs,update_pkg) == 0 )
add_upgrade_to_transaction(&tran,installed_pkgs->pkgs[i],update_pkg);
}
+ }else{
+ add_exclude_to_transaction(&tran,update_pkg);
}
}
@@ -445,6 +451,8 @@ void pkg_action_upgrade_all(const rc_config *global_config){
if( add_deps_to_trans(global_config,&tran,avail_pkgs,installed_pkgs,upgrade_pkg) == 0 ){
if ( is_conflicted(&tran,avail_pkgs,installed_pkgs,upgrade_pkg) == 0 )
add_install_to_transaction(&tran,upgrade_pkg);
+ }else{
+ add_exclude_to_transaction(&tran,upgrade_pkg);
}
}
@@ -462,6 +470,8 @@ void pkg_action_upgrade_all(const rc_config *global_config){
if( add_deps_to_trans(global_config,&tran,avail_pkgs,installed_pkgs,upgrade_pkg) == 0 ){
if ( is_conflicted(&tran,avail_pkgs,installed_pkgs,upgrade_pkg) == 0 )
add_upgrade_to_transaction(&tran,installed_pkg,upgrade_pkg);
+ }else{
+ add_exclude_to_transaction(&tran,upgrade_pkg);
}
}
diff --git a/src/transaction.c b/src/transaction.c
index 85332d5..2232da3 100644
--- a/src/transaction.c
+++ b/src/transaction.c
@@ -503,6 +503,11 @@ int add_deps_to_trans(const rc_config *global_config, transaction *tran, struct
pkg_info_t *dep_installed;
+ /*
+ * the dep wouldn't get this far if it where excluded,
+ * so we don't check for that here
+ */
+
if( (dep_installed = get_newest_pkg(installed_pkgs,deps->pkgs[c]->name)) == NULL ){
if ( is_conflicted(tran,avail_pkgs,installed_pkgs,deps->pkgs[c]) == 0 )
@@ -510,6 +515,18 @@ int add_deps_to_trans(const rc_config *global_config, transaction *tran, struct
}else{
+ /*
+ * however the installed version could be excluded,
+ * in which case upgrades should be
+ */
+ if( (is_excluded(global_config,dep_installed) == 1) && (global_config->ignore_dep == 0) ){
+ printf(_("%s, which is required by %s, is excluded\n"),dep_installed->name,pkg->name);
+ add_exclude_to_transaction(tran,dep_installed);
+ free(deps->pkgs);
+ free(deps);
+ return -1;
+ }
+
/* 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]) == 0 )