diff options
author | Aaron Griffin <aaron@archlinux.org> | 2007-02-04 09:26:52 +0100 |
---|---|---|
committer | Aaron Griffin <aaron@archlinux.org> | 2007-02-04 09:26:52 +0100 |
commit | 63000584b6442412dbcdf1dd867e09fbde404afe (patch) | |
tree | 5ac1028f9aaf0ff5a75d9d2144a9ecc337dc2211 /src/pacman/query.c | |
parent | b2da4b42344444dc22f1e5b01fb4cd09033adc1d (diff) | |
download | pacman-63000584b6442412dbcdf1dd867e09fbde404afe.tar.gz pacman-63000584b6442412dbcdf1dd867e09fbde404afe.tar.xz |
Implemented a crappy version of -Qu (query upgrades). This simply outputs the
packages to be upgraded in a -Su operation. Much of the code is duplicated from
sync.c.
TODO: move the implementation to upgrades.c, and reimplement the sync_sysupgrade
function in terms of this:
trans->packages = alpm_get_upgrades();
Diffstat (limited to 'src/pacman/query.c')
-rw-r--r-- | src/pacman/query.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/pacman/query.c b/src/pacman/query.c index be7ca837..36b4af80 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -124,6 +124,19 @@ int pacman_query(alpm_list_t *targets) } } + if(config->op_q_upgrade) { + MSG(NL, _("Checking for package upgrades")); + alpm_list_t *syncpkgs; + + if((syncpkgs = alpm_get_upgrades()) != NULL) { + display_targets(syncpkgs); + return(0); + } else { + MSG(NL, _("no upgrades found")); + return(1); + } + } + for(i = targets; !done; i = (i ? alpm_list_next(i) : NULL)) { if(targets == NULL) { done = 1; |