Commit Graph

6 Commits

Author SHA1 Message Date
Ludovic Courtès 3e0a42973b
progress: Rename 'erase-in-line' to 'erase-current-line'.
Suggested by Danny Milosavljevic <dannym@scratchpost.org>.

* guix/progress.scm (erase-in-line): Rename to...
(erase-current-line): ... this.  Adjust callers.
2017-12-15 11:53:21 +01:00
Ludovic Courtès 1fafa2f587
weather: Use (guix progress) for progress report.
* guix/progress.scm (start-progress-reporter!, stop-progress-reporter!)
(progress-reporter-report!): New procedures.
* guix/scripts/weather.scm (call-with-progress-reporter): New procedure.
(package-outputs)[update-progress!]: Remove.
Use 'call-with-progress-reporter' instead.
(guix-weather): Parameterize 'current-terminal-columns'.
2017-12-01 16:00:14 +01:00
Ludovic Courtès 4cdb27af48
progress: Add 'progress-reporter/bar'.
* guix/progress.scm (progress-reporter/bar): New procedure.
2017-12-01 16:00:14 +01:00
Ludovic Courtès 5ed534ccc3
progress: 'progress-bar' accounts for brackets.
* guix/progress.scm (progress-bar): Subtract 2 to BAR-WIDTH to account
for brackets.
2017-12-01 16:00:14 +01:00
Ludovic Courtès 1252dd325b
progress: Factorize erase-in-line.
* guix/progress.scm (erase-in-line): New procedure.
(progress-reporter/file): Use it.
2017-12-01 16:00:14 +01:00
Ludovic Courtès 8c3488259e
Add (guix progress).
Among other things, this removes (guix utils), (guix ui), (guix config),
etc. from the closure of (guix build download), as was the case since
798648515b.

* guix/utils.scm (<progress-reporter>, call-with-progress-reporter):
Move to...
* guix/progress.scm: ... here.  New file.
* Makefile.am (MODULES): Add it.
* guix/build/download.scm (current-terminal-columns)
(nearest-exact-integer, duration->seconds, seconds->string)
(byte-count->string, progress-bar, string-pad-middle)
(rate-limited, progress-reporter/file, dump-port*)
(time-monotonic): Move to progress.scm.
* guix/scripts/download.scm: Adjust accordingly.
* guix/scripts/substitute.scm: Likewise.
2017-10-19 23:21:49 +02:00