From dfae7bdd52476673424f8020befef166cf95f3fc Mon Sep 17 00:00:00 2001 From: Xavier Chantry Date: Fri, 25 Jul 2008 02:02:36 +0200 Subject: src/pacman : rework the display_targets function. We had a lot of duplicated code here. The code handling the showsize option needed to be there three times : 1) for install part of -S 2) for remove part of -S (conflict removal) 3) for -R This patch introduce a new display_targets(pkglist, install) function which can handle the 3 cases above. We pass install == 1 for case 1), and install == 0 for case 2) and 3). Now we can finally get the benefit of an old patch which handled the ShowSize option consistently in the 3 cases above, without an awful lot of duplicated code : http://www.archlinux.org/pipermail/pacman-dev/2008-January/011029.html Signed-off-by: Xavier Chantry Signed-off-by: Dan McGee --- src/pacman/util.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/pacman/util.h') diff --git a/src/pacman/util.h b/src/pacman/util.h index 722e4ab6..2ddc1b52 100644 --- a/src/pacman/util.h +++ b/src/pacman/util.h @@ -51,7 +51,8 @@ char *strreplace(const char *str, const char *needle, const char *replace); alpm_list_t *strsplit(const char *str, const char splitchar); void string_display(const char *title, const char *string); void list_display(const char *title, const alpm_list_t *list); -void display_targets(const alpm_list_t *syncpkgs, pmdb_t *db_local); +void display_targets(const alpm_list_t *pkgs, int install); +void display_synctargets(const alpm_list_t *syncpkgs); int yesno(short preset, char *fmt, ...); int pm_printf(pmloglevel_t level, const char *format, ...) __attribute__((format(printf,2,3))); int pm_fprintf(FILE *stream, pmloglevel_t level, const char *format, ...) __attribute__((format(printf,3,4))); -- cgit v1.2.3