guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] download: Fix some minor progress-logging regressions.


From: Steve Sprang
Subject: Re: [PATCH] download: Fix some minor progress-logging regressions.
Date: Wed, 23 Sep 2015 17:48:34 -0700

This patch is still pending. I don't want it to fall through the cracks. :-)

Thanks!
-Steve

On Thu, Sep 17, 2015 at 2:44 PM, Mathieu Lirzin <address@hidden> wrote:
> Steve Sprang <address@hidden> writes:
>
>> Here's attempt #2.
> [...]
>> @@ -101,15 +101,14 @@ width of the bar is BAR-WIDTH."
>>
>>  (define (string-pad-middle left right len)
>>    "Combine LEFT and RIGHT with enough padding in the middle so that the
>> -resulting string has length at least LEN.  This right justifies RIGHT."
>> -  (string-append left
>> -                 (string-pad right (max 0 (- len (string-length left))))))
>> -
>> -(define (store-url-abbreviation url)
>> -  "Return a friendlier version of URL for display."
>> -  (let ((store-path (string-append (%store-directory) "/" (basename url))))
>> -    ;; Take advantage of the implementation for store paths.
>> -    (store-path-abbreviation store-path)))
>> +resulting string has length at least LEN (it may overflow).  If the string
>> +does not overflow, the last char in RIGHT will be flush with the LEN
>> +column."
>> +  (let* ((total-used (+ (string-length left)
>> +                        (string-length right)))
>> +         (num-spaces (max 1 (- len total-used)))
>> +         (padding    (make-string num-spaces #\space)))
>> +    (string-append left padding right)))
>
> The phrasing is fine for me.  Thanks again.
>
> --
> Mathieu Lirzin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]