[pacman-dev] [PATCH] Indicate ignored packages in -Qu output

Andrew Gregory andrew.gregory.8 at gmail.com
Wed May 22 22:56:43 EDT 2013


On 05/19/13 at 10:14pm, Allan McRae wrote:
> Add "[ignored]" after packages that have their upgrades ignored in the
> pacman -Qu output.
> 
> Signed-off-by: Allan McRae <allan at archlinux.org>
> ---
>  src/pacman/query.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/src/pacman/query.c b/src/pacman/query.c
> index f051571..2f336d6 100644
> --- a/src/pacman/query.c
> +++ b/src/pacman/query.c
> @@ -387,8 +387,17 @@ 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),
> -					colstr->version, alpm_pkg_get_version(pkg), colstr->nocolor);
> +			const char *pkgname = alpm_pkg_get_name(pkg);
> +			const char *pkgver = alpm_pkg_get_version(pkg);
> +
> +			if(config->op_q_upgrade &&
> +					alpm_list_find_str(alpm_option_get_ignorepkgs(config->handle), pkgname)) {

Do we not need to check ignored groups as well?

> +				printf("%s%s %s%s%s %s\n", colstr->title, pkgname, colstr->version,
> +						pkgver, colstr->nocolor, _("[ignored]"));
> +			} else {
> +				printf("%s%s %s%s%s\n", colstr->title, pkgname, colstr->version,
> +						pkgver, colstr->nocolor);
> +			}
>  		} else {
>  			printf("%s\n", alpm_pkg_get_name(pkg));
>  		}
> -- 
> 1.8.2.3
> 
> 


More information about the pacman-dev mailing list