[pacman-dev] [PATCH 12/16] colorize the output if -Qi/Si

Andrew Gregory andrew.gregory.8 at gmail.com
Fri Mar 1 23:40:35 EST 2013


On 03/01/13 at 04:32pm, Simon Gomizelj wrote:
> Signed-off-by: Simon Gomizelj <simongmzlj at gmail.com>
> ---
>  src/pacman/package.c | 6 +++---
>  src/pacman/util.c    | 6 +++---
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/src/pacman/package.c b/src/pacman/package.c
> index 6daf745..1486f41 100644
> --- a/src/pacman/package.c
> +++ b/src/pacman/package.c
> @@ -167,13 +167,13 @@ void dump_pkg_full(alpm_pkg_t *pkg, int extra)
>  
>  	size = humanize_size(alpm_pkg_get_size(pkg), 'K', 2, &label);
>  	if(from == ALPM_PKG_FROM_SYNCDB) {
> -		printf(_("Download Size  : %6.2f %s\n"), size, label);
> +		printf("%s%s%s %6.2f %s\n", colstr.title, "Download Size  :", colstr.nc, size, label);
>  	} else if(from == ALPM_PKG_FROM_FILE) {
> -		printf(_("Compressed Size: %6.2f %s\n"), size, label);
> +		printf("%s%s%s %6.2f %s\n", colstr.title, "Compressed Size:", colstr.nc, size, label);
>  	}
>  
>  	size = humanize_size(alpm_pkg_get_isize(pkg), 'K', 2, &label);
> -	printf(_("Installed Size : %6.2f %s\n"), size, label);
> +	printf("%s%s%s %6.2f %s\n", colstr.title, "Installed Size :", colstr.nc, size, label);

This removes gettext translation for these labels.

>  	string_display(_("Packager       :"), alpm_pkg_get_packager(pkg), cols);
>  	string_display(_("Build Date     :"), bdatestr, cols);
> diff --git a/src/pacman/util.c b/src/pacman/util.c
> index a190765..012318e 100644
> --- a/src/pacman/util.c
> +++ b/src/pacman/util.c
> @@ -427,7 +427,7 @@ static size_t string_length(const char *s)
>  void string_display(const char *title, const char *string, unsigned short cols)
>  {
>  	if(title) {
> -		printf("%s ", title);
> +		printf("%s%s%s ", colstr.title, title, colstr.nc);
>  	}
>  	if(string == NULL || string[0] == '\0') {
>  		printf(_("None"));
> @@ -620,7 +620,7 @@ void list_display(const char *title, const alpm_list_t *list,
>  
>  	if(title) {
>  		len = string_length(title) + 1;
> -		printf("%s ", title);
> +		printf("%s%s%s ", colstr.title, title, colstr.nc);
>  	}
>  
>  	if(!list) {
> @@ -660,7 +660,7 @@ void list_display_linebreak(const char *title, const alpm_list_t *list,
>  
>  	if(title) {
>  		len = (unsigned short)string_length(title) + 1;
> -		printf("%s ", title);
> +		printf("%s%s%s ", colstr.title, title, colstr.nc);
>  	}
>  
>  	if(!list) {
> -- 
> 1.8.1.4
> 
> 

Did you mean to leave "Backup Files:" (from -Qii) uncolored?

apg


More information about the pacman-dev mailing list