summaryrefslogtreecommitdiff
path: root/src/pacman/upgrade.c
diff options
context:
space:
mode:
authorXavier Chantry <shiningxc@gmail.com>2009-07-19 11:15:11 +0200
committerDan McGee <dan@archlinux.org>2010-03-14 18:44:40 -0500
commitd39b1dbe627af218e49be6424857089a5888903b (patch)
tree9225a360217ede5c5817fa41fb182454008dce6e /src/pacman/upgrade.c
parent67700b926a1eff745272975e7b089b80bf72cc30 (diff)
Add new --print operation for all operations
And a new --print-format option to configure the output. This implements FS#14208 Example usage : pacman -Sp --print-format "%r/%n-%v : %l [%s]" kdelibs extra/kdelibs-4.3.2-4 : ftp://mir2.archlinuxfr.org/archlinux/extra/os/i686/kdelibs-4.3.2-4-i686.pkg.tar.gz [0,00] Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman/upgrade.c')
-rw-r--r--src/pacman/upgrade.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/pacman/upgrade.c b/src/pacman/upgrade.c
index ddb47964..5e4234b1 100644
--- a/src/pacman/upgrade.c
+++ b/src/pacman/upgrade.c
@@ -69,7 +69,6 @@ int pacman_upgrade(alpm_list_t *targets)
}
/* add targets to the created transaction */
- printf(_("loading package data...\n"));
for(i = targets; i; i = alpm_list_next(i)) {
char *targ = alpm_list_getdata(i);
if(alpm_add_target(targ) == -1) {
@@ -129,6 +128,13 @@ int pacman_upgrade(alpm_list_t *targets)
}
/* Step 3: perform the installation */
+
+ if(config->print) {
+ print_packages(alpm_trans_get_add());
+ trans_release();
+ return(0);
+ }
+
/* print targets and ask user confirmation */
alpm_list_t *packages = alpm_trans_get_add();
if(packages == NULL) { /* we are done */