aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Woodward2004-11-28 04:56:15 +0000
committerJason Woodward2004-11-28 04:56:15 +0000
commitc314796ca4866283bbe902a972cebb1ecee944df (patch)
tree2c8c5ccc2074bdc6449eaa08d72978f755e0203b /src
parentb406188683edbd06df3a92f2c60893f7d999d684 (diff)
downloadslapt-get-c314796ca4866283bbe902a972cebb1ecee944df.tar.gz
--upgrade now checks to see if there is multiple installed packages and uses the newest one
Diffstat (limited to 'src')
-rw-r--r--src/action.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/action.c b/src/action.c
index afc7649..72fac1a 100644
--- a/src/action.c
+++ b/src/action.c
@@ -477,6 +477,15 @@ void pkg_action_upgrade_all(const rc_config *global_config){
for(i = 0; i < installed_pkgs->pkg_count;i++){
pkg_info_t *update_pkg = NULL;
+ pkg_info_t *newer_installed_pkg = NULL;
+
+ /*
+ we need to see if there is another installed
+ package that is newer than this one
+ */
+ if( (newer_installed_pkg = get_newest_pkg(installed_pkgs,installed_pkgs->pkgs[i]->name)) != NULL ){
+ if( cmp_pkg_versions(installed_pkgs->pkgs[i]->version,newer_installed_pkg->version) < 0 ) continue;
+ }
/* see if we have an available update for the pkg */
update_pkg = get_newest_pkg(