[pacman-dev] [PATCH] Added better colourisation support for the "-{Q, S}i" operation.

Allan McRae allan at archlinux.org
Mon Apr 18 06:05:21 UTC 2016


On 28/03/16 08:35, xavion.0 at gmail.com wrote:
> From: Xavion <Xavion (dot) 0 (at) Gmail (dot) com>
> 
> Specifically, the following changes have been made:
> * The repository is in 'magenta'
> * The package name is in 'bold'
> * The version is in 'green'
> * The group is in 'blue'
> 
> Signed-off-by: Xavion <Xavion (dot) 0 (at) Gmail (dot) com>
> ---
>  src/pacman/callback.c |  3 ++-
>  src/pacman/package.c  | 55 ++++++++++++++++++++++++++-------------------------
>  src/pacman/pacman.c   |  3 ++-
>  src/pacman/util.c     | 21 ++++++++++++--------
>  src/pacman/util.h     |  4 ++--
>  5 files changed, 47 insertions(+), 39 deletions(-)
> 
> diff --git a/src/pacman/callback.c b/src/pacman/callback.c
> index 1e1a4cd..3e4d7fa 100644
> --- a/src/pacman/callback.c
> +++ b/src/pacman/callback.c
> @@ -427,6 +427,7 @@ void cb_question(alpm_question_t *question)
>  				alpm_question_remove_pkgs_t *q = &question->remove_pkgs;
>  				alpm_list_t *namelist = NULL, *i;
>  				size_t count = 0;
> +				const colstr_t *colstr = &config->colstr;
>  				for(i = q->packages; i; i = i->next) {
>  					namelist = alpm_list_add(namelist,
>  							(char *)alpm_pkg_get_name(i->data));
> @@ -436,7 +437,7 @@ void cb_question(alpm_question_t *question)
>  							"The following package cannot be upgraded due to unresolvable dependencies:\n",
>  							"The following packages cannot be upgraded due to unresolvable dependencies:\n",
>  							count));
> -				list_display("     ", namelist, getcols());
> +				list_display("     ", namelist, colstr->nocolor, getcols());

Unrelated...

>  				printf("\n");
>  				q->skip = noyes(_n(
>  							"Do you want to skip the above package for this upgrade?",
> diff --git a/src/pacman/package.c b/src/pacman/package.c
> index 3ab9abc..92f6b37 100644
> --- a/src/pacman/package.c
> +++ b/src/pacman/package.c
> @@ -148,14 +148,14 @@ static void make_aligned_titles(void)
>   * @param deps a list with items of type alpm_depend_t
>   */
>  static void deplist_display(const char *title,
> -		alpm_list_t *deps, unsigned short cols)
> +		alpm_list_t *deps, const char *colour, unsigned short cols)

Why is the parameter added?   It is only ever called with colstr->nocolor


I stopped reviewing here.

Also, this patch did not apply on top of the group selection dialog
colouring patch despite being later in the series.


More information about the pacman-dev mailing list