aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2004-11-28 04:56:15 +0000
committerJason Woodward2004-11-28 04:56:15 +0000
commitc314796ca4866283bbe902a972cebb1ecee944df (patch)
tree2c8c5ccc2074bdc6449eaa08d72978f755e0203b
parentb406188683edbd06df3a92f2c60893f7d999d684 (diff)
downloadslapt-get-c314796ca4866283bbe902a972cebb1ecee944df.tar.gz
--upgrade now checks to see if there is multiple installed packages and uses the newest one
-rw-r--r--ChangeLog2
-rw-r--r--src/action.c9
2 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index f93f7d3..2f51ffb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
0.9.9e Nov 27, 2004
+ * --upgrade now checks to see if there is multiple installed packages and
+ uses the newest one
* rewrote pkg_action_search()
* --show now shows installed pkgs
* get_installed_pkgs() now parses out the packages description as well
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(