summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Woodward2005-02-08 02:12:46 +0000
committerJason Woodward2005-02-08 02:12:46 +0000
commita70eb3da01ed8475e3ab61fd4ea6652c53dccd64 (patch)
treea79277106d2b2d1b07a666abf321b432df8513ec /src
parent42072dcbe31498618b34e9790ab428ff689f6d18 (diff)
downloadslapt-get-a70eb3da01ed8475e3ab61fd4ea6652c53dccd64.tar.gz
ensure when removing a package and the packages it requires, the packages that are required are installed. thanks NIkkou (nibbana80 at wp dot pl)
Diffstat (limited to 'src')
-rw-r--r--src/action.c6
-rw-r--r--src/package.c8
2 files changed, 7 insertions, 7 deletions
diff --git a/src/action.c b/src/action.c
index 29b3766..7e3043e 100644
--- a/src/action.c
+++ b/src/action.c
@@ -218,7 +218,8 @@ void pkg_action_remove(const rc_config *global_config,const pkg_action_args_t *a
for(c = 0; c < deps->pkg_count;c++){
- if( get_newest_pkg(installed_pkgs,deps->pkgs[c]->name) != NULL ){
+ if( get_exact_pkg(installed_pkgs,deps->pkgs[c]->name,
+ deps->pkgs[c]->version) != NULL ){
add_remove_to_transaction(&tran,deps->pkgs[c]);
}
@@ -462,7 +463,8 @@ void pkg_action_upgrade_all(const rc_config *global_config){
*/
deps = is_required_by(global_config,avail_pkgs,installed_pkgs->pkgs[r]);
for(c = 0; c < deps->pkg_count; c++ ){
- if( get_newest_pkg(avail_pkgs,deps->pkgs[c]->name) == NULL ){
+ if( get_exact_pkg(avail_pkgs,deps->pkgs[c]->name,
+ deps->pkgs[c]->version) == NULL ){
if( is_excluded(global_config,deps->pkgs[c]) != 1 ){
add_remove_to_transaction(&tran,deps->pkgs[c]);
}else{
diff --git a/src/package.c b/src/package.c
index 079b54b..2e5ba98 100644
--- a/src/package.c
+++ b/src/package.c
@@ -557,8 +557,8 @@ pkg_info_t *get_newest_pkg(struct pkg_list *pkg_list,const char *pkg_name){
/* if pkg has same name as our requested pkg */
if( (strcmp(pkg_list->pkgs[i]->name,pkg_name)) == 0 ){
-
- if( (pkg == NULL) || cmp_pkg_versions(pkg->version,pkg_list->pkgs[i]->version) < 0 ){
+ if( (pkg == NULL) || (cmp_pkg_versions(pkg->version,
+ pkg_list->pkgs[i]->version) < 0) ){
pkg = pkg_list->pkgs[i];
}
}
@@ -1428,9 +1428,7 @@ static void required_by(const rc_config *global_config,struct pkg_list *avail, p
execute_regex(&required_by_reg,avail->pkgs[i]->required);
if( required_by_reg.reg_return != 0 ) continue;
- /* only proceed if we don't have the required already */
- if( (get_newest_pkg(required_by_list,avail->pkgs[i]->name) == NULL) )
- add_pkg_to_pkg_list(required_by_list,avail->pkgs[i]);
+ add_pkg_to_pkg_list(required_by_list,avail->pkgs[i]);
}
free_regex(&required_by_reg);