From 83fa6aa2896c0c940e8bf5b7499abc7ef955e658 Mon Sep 17 00:00:00 2001 From: Chantry Xavier Date: Sat, 25 Aug 2007 00:10:40 +0200 Subject: Remove duplicated get_upgrades function, use sysupgrade instead. The alpm_get_upgrades was exactly the same as find_replacements + _alpm_sync_sysupgrade, except that it automatically made the eventual replacements, without asking the user : Replace %s with %s/%s? [Y/n] The replace question, asked in find_replacements. can now be skipped by using a NULL trans argument, so that we get the same behavior as with alpm_get_upgrades. So alpm_db_get_upgrades() can now be replaced by alpm_sync_sysupgrade(db_local, syncdbs). Signed-off-by: Chantry Xavier Signed-off-by: Dan McGee --- src/pacman/query.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/pacman/query.c') diff --git a/src/pacman/query.c b/src/pacman/query.c index b6814259..bb69527d 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -213,10 +213,14 @@ static int query_group(alpm_list_t *targets) static int query_upgrades(void) { - alpm_list_t *syncpkgs; + alpm_list_t *syncpkgs = NULL; printf(_("Checking for package upgrades... \n")); - if((syncpkgs = alpm_db_get_upgrades()) != NULL) { + alpm_list_t *syncdbs = alpm_option_get_syncdbs(); + if(alpm_sync_sysupgrade(db_local, syncdbs, &syncpkgs) == -1) { + return(-1); + } + if(syncpkgs) { display_targets(syncpkgs, db_local); return(0); } -- cgit v1.2.3