[pacman-dev] [PATCH] Feedback from installed package while searching

Nagy Gabor ngaba at bibl.u-szeged.hu
Thu Sep 3 15:54:16 EDT 2009


2009. 09. 3, csütörtök keltezéssel 21.18-kor djszapi2 at gmail.com ezt
írta:
> From: Laszlo Papp <djszapi2 at gmail.com>
> 
> To get feedback while searching instead of using another utility for
> this purpose, whether the desired packages are installed. You can see
> example for it in case of yaourt.
> 
> Signed-off-by: Laszlo Papp <djszapi2 at gmail.com>
> ---
>  src/pacman/sync.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/src/pacman/sync.c b/src/pacman/sync.c
> index dc93621..9935d6d 100644
> --- a/src/pacman/sync.c
> +++ b/src/pacman/sync.c
> @@ -330,6 +330,10 @@ static int sync_search(alpm_list_t *syncs, alpm_list_t *targets)
>  					printf(")");
>  				}
> 
> +				if (alpm_db_get_pkg(db_local, alpm_pkg_get_name(pkg))) {
> +						printf(" [%s]", _("installed"));
> +				}
> +
>  				/* we need a newline and initial indent first */
>  				printf("\n    ");
>  				indentprint(alpm_pkg_get_desc(pkg), 4);
> --
> 1.6.4.1
> 
> 

What is wrong with printf(_(" [installed]"));?

For my taste, printing [installed] when I have _older version_
installed, a bit strange. In this case [installed: 2.0-1] would be
better (but harder to parser).




More information about the pacman-dev mailing list