diff options
author | Chantry Xavier <shiningxc@gmail.com> | 2007-08-25 00:10:40 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-11-21 00:05:05 -0600 |
commit | 83fa6aa2896c0c940e8bf5b7499abc7ef955e658 (patch) | |
tree | 40e275009f7716bbccce692c034ef396ff2a891c /src | |
parent | 3e9c590480d7ec8fe576cf0a2216e1d3cb61db77 (diff) | |
download | pacman-83fa6aa2896c0c940e8bf5b7499abc7ef955e658.tar.xz |
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 <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/pacman/query.c | 8 |
1 files changed, 6 insertions, 2 deletions
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); } |