summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2013-09-26 10:55:21 +0200
committerAllan McRae <allan@archlinux.org>2013-10-14 04:59:48 +0200
commitd43f54e5c494a3796cf7fadece7ca4ce73ca807d (patch)
tree904c9289d4f869be530cd52e0e3b2ad9afd6252c /src
parent8eb8995aa762c8eded8db4041a11d330094795fd (diff)
downloadpacman-d43f54e5c494a3796cf7fadece7ca4ce73ca807d.tar.gz
pacman-d43f54e5c494a3796cf7fadece7ca4ce73ca807d.tar.xz
Display old and new version in pacman -Qu output
This changes the output from "foo 1.0" to "foo 1.0 -> 1.1" which makes cronjobs that mail the -Qu output way more helpful. Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/query.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/pacman/query.c b/src/pacman/query.c
index c9c82b94..518b76ab 100644
--- a/src/pacman/query.c
+++ b/src/pacman/query.c
@@ -318,8 +318,15 @@ static int display(alpm_pkg_t *pkg)
&& !config->op_q_changelog && !config->op_q_check) {
if(!config->quiet) {
const colstr_t *colstr = &config->colstr;
- printf("%s%s %s%s%s\n", colstr->title, alpm_pkg_get_name(pkg),
+ printf("%s%s %s%s%s", colstr->title, alpm_pkg_get_name(pkg),
colstr->version, alpm_pkg_get_version(pkg), colstr->nocolor);
+
+ if(config->op_q_upgrade) {
+ alpm_pkg_t *newpkg = alpm_sync_newversion(pkg, alpm_get_syncdbs(config->handle));
+ printf(" -> %s%s%s", colstr->version, alpm_pkg_get_version(newpkg), colstr->nocolor);
+ }
+
+ printf("\n");
} else {
printf("%s\n", alpm_pkg_get_name(pkg));
}