[pacman-dev] [PATCH v2] pacman: stop eta timer breaking allignment

Allan McRae allan at archlinux.org
Mon Apr 19 13:53:59 UTC 2021


On 19/4/21 7:36 pm, morganamilo wrote:
> When the download estimate is over an hour the format displayed changes
> from mm:ss to hh:mm:ss. This causes everything to be out of alignment
> due to the extra characters.
> 
> So instead lets just go back to --:-- when the download => 100 minutes.
> ---
>  src/pacman/callback.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/src/pacman/callback.c b/src/pacman/callback.c
> index a28a79a9..3c1d3f14 100644
> --- a/src/pacman/callback.c
> +++ b/src/pacman/callback.c
> @@ -811,12 +811,8 @@ static void draw_pacman_progress_bar(struct pacman_progress_bar *bar)
>  
>  	/* 1 space + filenamelen + 1 space + 6 for size + 1 space + 3 for label +
>  	 * + 2 spaces + 4 for rate + 1 space + 3 for label + 2 for /s + 1 space +
> -	 * 8 for eta, gives us the magic 33 */
> -	filenamelen = infolen - 33;
> -	/* see printf() code, we omit 'HH:' in these conditions */
> -	if(eta_h == 0 || eta_h >= 100) {
> -		filenamelen += 3;
> -	}
> +	 * 5 for eta, gives us the magic 33 */

I fixed this comment.

Otherwise fine.

A


More information about the pacman-dev mailing list