From d39b1dbe627af218e49be6424857089a5888903b Mon Sep 17 00:00:00 2001 From: Xavier Chantry Date: Sun, 19 Jul 2009 11:15:11 +0200 Subject: 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 Signed-off-by: Dan McGee --- src/pacman/upgrade.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/pacman/upgrade.c') 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 */ -- cgit v1.2.3-24-g4f1b