From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 30 08:46:53 2017 Received: (at submit) by debbugs.gnu.org; 30 Nov 2017 13:46:53 +0000 Received: from localhost ([127.0.0.1]:37653 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKPAy-0000OO-Nw for submit@debbugs.gnu.org; Thu, 30 Nov 2017 08:46:52 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50708) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKPAx-0000OC-GC for submit@debbugs.gnu.org; Thu, 30 Nov 2017 08:46:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKPAm-0000vG-P6 for submit@debbugs.gnu.org; Thu, 30 Nov 2017 08:46:46 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:45394) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eKPAm-0000v8-Lo for submit@debbugs.gnu.org; Thu, 30 Nov 2017 08:46:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKPAl-0002gW-Go for guix-patches@gnu.org; Thu, 30 Nov 2017 08:46:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKPAk-0000sq-Tv for guix-patches@gnu.org; Thu, 30 Nov 2017 08:46:39 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59143) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKPAe-0000oI-E8; Thu, 30 Nov 2017 08:46:32 -0500 Received: from [193.50.110.211] (port=49374 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eKPAd-00028v-Ui; Thu, 30 Nov 2017 08:46:32 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: guix-patches@gnu.org Subject: [PATCH 0/6] Display progress bar in 'guix system init' Date: Thu, 30 Nov 2017 14:46:20 +0100 Message-Id: <20171130134620.3877-1-ludo@gnu.org> X-Mailer: git-send-email 2.15.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hello! This patch set factorizes support for progress bars in the (guix progress) module that 宋文武 implemented a while back. It then uses it in ‘guix weather’ (which had its own progress bar) and in ‘guix system init’ when copying store items to the target partition. Feedback welcome! Ludo’. Ludovic Courtès (6): progress: Factorize erase-in-line. progress: 'progress-bar' accounts for brackets. progress: Add 'progress-reporter/bar'. weather: Use (guix progress) for progress report. guix system: Simplify closure copy. guix system: 'init' displays a progress bar while copying. .dir-locals.el | 3 +- guix/progress.scm | 69 ++++++++++++++++++++++++++++-- guix/scripts/system.scm | 76 ++++++++++++++++++--------------- guix/scripts/weather.scm | 106 +++++++++++++++++++++++------------------------ 4 files changed, 163 insertions(+), 91 deletions(-) -- 2.15.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 30 08:57:22 2017 Received: (at 29509) by debbugs.gnu.org; 30 Nov 2017 13:57:22 +0000 Received: from localhost ([127.0.0.1]:37667 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKPL8-0000ft-Jt for submit@debbugs.gnu.org; Thu, 30 Nov 2017 08:57:22 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53836) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKPL7-0000fb-MY for 29509@debbugs.gnu.org; Thu, 30 Nov 2017 08:57:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKPL1-0001QH-RD for 29509@debbugs.gnu.org; Thu, 30 Nov 2017 08:57:16 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59245) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKPKx-00019m-4R; Thu, 30 Nov 2017 08:57:11 -0500 Received: from [193.50.110.211] (port=49948 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eKPKu-00032N-Ep; Thu, 30 Nov 2017 08:57:08 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 29509@debbugs.gnu.org Subject: [PATCH 1/6] progress: Factorize erase-in-line. Date: Thu, 30 Nov 2017 14:56:57 +0100 Message-Id: <20171130135702.4321-1-ludo@gnu.org> X-Mailer: git-send-email 2.15.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 29509 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) * guix/progress.scm (erase-in-line): New procedure. (progress-reporter/file): Use it. --- guix/progress.scm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/guix/progress.scm b/guix/progress.scm index beca2c22a..1993c7403 100644 --- a/guix/progress.scm +++ b/guix/progress.scm @@ -153,6 +153,11 @@ width of the bar is BAR-WIDTH." (make-string filled #\#) (make-string empty #\space)))) +(define (erase-in-line port) + "Write an ANSI erase-in-line sequence to PORT to erase the whole line and +move the cursor to the beginning of the line." + (display "\r\x1b[K" port)) + (define* (progress-reporter/file file size #:optional (log-port (current-output-port)) #:key (abbreviation basename)) @@ -176,7 +181,7 @@ ABBREVIATION used to shorten FILE for display." (byte-count->string throughput) (seconds->string elapsed) (progress-bar %) %))) - (display "\r\x1b[K" log-port) + (erase-in-line log-port) (display (string-pad-middle left right (current-terminal-columns)) log-port) @@ -188,7 +193,7 @@ ABBREVIATION used to shorten FILE for display." (byte-count->string throughput) (seconds->string elapsed) (byte-count->string transferred)))) - (display "\r\x1b[K" log-port) + (erase-in-line log-port) (display (string-pad-middle left right (current-terminal-columns)) log-port) -- 2.15.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 30 08:57:27 2017 Received: (at 29509) by debbugs.gnu.org; 30 Nov 2017 13:57:27 +0000 Received: from localhost ([127.0.0.1]:37672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKPLC-0000gG-SI for submit@debbugs.gnu.org; Thu, 30 Nov 2017 08:57:27 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53847) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKPLA-0000fh-J8 for 29509@debbugs.gnu.org; Thu, 30 Nov 2017 08:57:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKPL1-0001QB-RS for 29509@debbugs.gnu.org; Thu, 30 Nov 2017 08:57:19 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59246) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKPKy-0001CM-1m; Thu, 30 Nov 2017 08:57:12 -0500 Received: from [193.50.110.211] (port=49948 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eKPKv-00032N-AX; Thu, 30 Nov 2017 08:57:09 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 29509@debbugs.gnu.org Subject: [PATCH 2/6] progress: 'progress-bar' accounts for brackets. Date: Thu, 30 Nov 2017 14:56:58 +0100 Message-Id: <20171130135702.4321-2-ludo@gnu.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171130135702.4321-1-ludo@gnu.org> References: <20171130135702.4321-1-ludo@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 29509 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) * guix/progress.scm (progress-bar): Subtract 2 to BAR-WIDTH to account for brackets. --- guix/progress.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guix/progress.scm b/guix/progress.scm index 1993c7403..ba7944214 100644 --- a/guix/progress.scm +++ b/guix/progress.scm @@ -146,7 +146,8 @@ INTERVAL (a time-duration object), otherwise does nothing and returns #f." (define* (progress-bar % #:optional (bar-width 20)) "Return % as a string representing an ASCII-art progress bar. The total width of the bar is BAR-WIDTH." - (let* ((fraction (/ % 100)) + (let* ((bar-width (max 3 (- bar-width 2))) + (fraction (/ % 100)) (filled (inexact->exact (floor (* fraction bar-width)))) (empty (- bar-width filled))) (format #f "[~a~a]" -- 2.15.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 30 08:57:29 2017 Received: (at 29509) by debbugs.gnu.org; 30 Nov 2017 13:57:29 +0000 Received: from localhost ([127.0.0.1]:37674 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKPLF-0000gV-2k for submit@debbugs.gnu.org; Thu, 30 Nov 2017 08:57:29 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53852) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKPLC-0000fl-Em for 29509@debbugs.gnu.org; Thu, 30 Nov 2017 08:57:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKPL1-0001QD-RR for 29509@debbugs.gnu.org; Thu, 30 Nov 2017 08:57:21 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59247) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKPKy-0001EY-QN; Thu, 30 Nov 2017 08:57:12 -0500 Received: from [193.50.110.211] (port=49948 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eKPKw-00032N-84; Thu, 30 Nov 2017 08:57:10 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 29509@debbugs.gnu.org Subject: [PATCH 3/6] progress: Add 'progress-reporter/bar'. Date: Thu, 30 Nov 2017 14:56:59 +0100 Message-Id: <20171130135702.4321-3-ludo@gnu.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171130135702.4321-1-ludo@gnu.org> References: <20171130135702.4321-1-ludo@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 29509 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) * guix/progress.scm (progress-reporter/bar): New procedure. --- guix/progress.scm | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/guix/progress.scm b/guix/progress.scm index ba7944214..1ee7ec319 100644 --- a/guix/progress.scm +++ b/guix/progress.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Sou Bunnbu ;;; Copyright © 2015 Steve Sprang +;;; Copyright © 2017 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -32,6 +33,7 @@ progress-reporter/silent progress-reporter/file + progress-reporter/bar byte-count->string current-terminal-columns @@ -212,6 +214,39 @@ ABBREVIATION used to shorten FILE for display." ;; Don't miss the last report. (stop render)))) +(define* (progress-reporter/bar total + #:optional + (prefix "") + (port (current-error-port))) + "Return a reporter that shows a progress bar every time one of the TOTAL +tasks is performed. Write PREFIX at the beginning of the line." + (define done 0) + + (define (report-progress) + (set! done (+ 1 done)) + (unless (> done total) + (let* ((ratio (* 100. (/ done total)))) + (erase-in-line port) + (if (string-null? prefix) + (display (progress-bar ratio (current-terminal-columns)) port) + (let ((width (- (current-terminal-columns) + (string-length prefix) 3))) + (display prefix port) + (display " " port) + (display (progress-bar ratio width) port))) + (force-output port)))) + + (progress-reporter + (start (lambda () + (set! done 0))) + (report report-progress) + (stop (lambda () + (erase-in-line port) + (unless (string-null? prefix) + (display prefix port) + (newline port)) + (force-output port))))) + ;; TODO: replace '(@ (guix build utils) dump-port))'. (define* (dump-port* in out #:key (buffer-size 16384) -- 2.15.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 30 08:57:29 2017 Received: (at 29509) by debbugs.gnu.org; 30 Nov 2017 13:57:29 +0000 Received: from localhost ([127.0.0.1]:37676 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKPLF-0000gX-Cl for submit@debbugs.gnu.org; Thu, 30 Nov 2017 08:57:29 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53854) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKPLC-0000fn-Lt for 29509@debbugs.gnu.org; Thu, 30 Nov 2017 08:57:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKPL1-0001Px-PE for 29509@debbugs.gnu.org; Thu, 30 Nov 2017 08:57:21 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59251) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKPKz-0001LN-DM; Thu, 30 Nov 2017 08:57:13 -0500 Received: from [193.50.110.211] (port=49948 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eKPKy-00032N-Oh; Thu, 30 Nov 2017 08:57:13 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 29509@debbugs.gnu.org Subject: [PATCH 6/6] guix system: 'init' displays a progress bar while copying. Date: Thu, 30 Nov 2017 14:57:02 +0100 Message-Id: <20171130135702.4321-6-ludo@gnu.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171130135702.4321-1-ludo@gnu.org> References: <20171130135702.4321-1-ludo@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 29509 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Until now it would print the name of each store item being copied, which was verbose and unhelpful. * guix/scripts/system.scm (copy-closure): Use 'progress-reporter/bar' and 'call-with-progress-reporter'. (guix-system): Parameterize 'current-terminal-columns'. --- guix/scripts/system.scm | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index acfa5fdbf..91d151d22 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -36,6 +36,8 @@ #:use-module (guix graph) #:use-module (guix scripts graph) #:use-module (guix build utils) + #:use-module (guix progress) + #:use-module ((guix build syscalls) #:select (terminal-columns)) #:use-module (gnu build install) #:autoload (gnu build file-systems) (find-partition-by-label find-partition-by-uuid) @@ -141,8 +143,18 @@ REFERENCES as its set of references." TARGET, and register them." (mlet* %store-monad ((to-copy (topologically-sorted* (list item))) (refs (mapm %store-monad references* to-copy))) - (for-each (cut copy-item <> <> target #:log-port log-port) - to-copy refs) + (define progress-bar + (progress-reporter/bar (length to-copy) + (format #f (G_ "copying to '~a'...") + target))) + + (call-with-progress-reporter progress-bar + (lambda (report) + (let ((void (%make-void-port "w"))) + (for-each (lambda (item refs) + (copy-item item refs target #:log-port void) + (report)) + to-copy refs)))) (return *unspecified*))) @@ -1092,7 +1104,8 @@ argument list and OPTS is the option alist." parse-sub-command)) (args (option-arguments opts)) (command (assoc-ref opts 'action))) - (parameterize ((%graft? (assoc-ref opts 'graft?))) + (parameterize ((%graft? (assoc-ref opts 'graft?)) + (current-terminal-columns (terminal-columns))) (process-command command args opts))))) ;;; Local Variables: -- 2.15.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 30 08:57:35 2017 Received: (at 29509) by debbugs.gnu.org; 30 Nov 2017 13:57:36 +0000 Received: from localhost ([127.0.0.1]:37680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKPLL-0000h7-MB for submit@debbugs.gnu.org; Thu, 30 Nov 2017 08:57:35 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53882) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKPLH-0000g9-2Q for 29509@debbugs.gnu.org; Thu, 30 Nov 2017 08:57:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKPL7-0001ZL-4C for 29509@debbugs.gnu.org; Thu, 30 Nov 2017 08:57:26 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59250) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKPKz-0001Iw-DL; Thu, 30 Nov 2017 08:57:13 -0500 Received: from [193.50.110.211] (port=49948 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eKPKx-00032N-Sz; Thu, 30 Nov 2017 08:57:12 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 29509@debbugs.gnu.org Subject: [PATCH 5/6] guix system: Simplify closure copy. Date: Thu, 30 Nov 2017 14:57:01 +0100 Message-Id: <20171130135702.4321-5-ludo@gnu.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171130135702.4321-1-ludo@gnu.org> References: <20171130135702.4321-1-ludo@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 29509 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) * guix/scripts/system.scm (copy-item): Add 'references' argument and remove 'references*' call. Turn into a non-monadic procedure. (copy-closure): Remove initial call to 'references*'. Only pass ITEM to 'topologically-sorted*' since that's equivalent. Compute the list of references corresponding to TO-COPY and pass it to 'copy-item'. --- guix/scripts/system.scm | 61 +++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index e50f1d8ac..acfa5fdbf 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -107,47 +107,44 @@ BODY..., and restore them." (store-lift topologically-sorted)) -(define* (copy-item item target +(define* (copy-item item references target #:key (log-port (current-error-port))) - "Copy ITEM to the store under root directory TARGET and register it." - (mlet* %store-monad ((refs (references* item))) - (let ((dest (string-append target item)) - (state (string-append target "/var/guix"))) - (format log-port "copying '~a'...~%" item) + "Copy ITEM to the store under root directory TARGET and register it with +REFERENCES as its set of references." + (let ((dest (string-append target item)) + (state (string-append target "/var/guix"))) + (format log-port "copying '~a'...~%" item) - ;; Remove DEST if it exists to make sure that (1) we do not fail badly - ;; while trying to overwrite it (see ), and - ;; (2) we end up with the right contents. - (when (file-exists? dest) - (delete-file-recursively dest)) + ;; Remove DEST if it exists to make sure that (1) we do not fail badly + ;; while trying to overwrite it (see ), and + ;; (2) we end up with the right contents. + (when (file-exists? dest) + (delete-file-recursively dest)) - (copy-recursively item dest - #:log (%make-void-port "w")) + (copy-recursively item dest + #:log (%make-void-port "w")) - ;; Register ITEM; as a side-effect, it resets timestamps, etc. - ;; Explicitly use "TARGET/var/guix" as the state directory, to avoid - ;; reproducing the user's current settings; see - ;; . - (unless (register-path item - #:prefix target - #:state-directory state - #:references refs) - (leave (G_ "failed to register '~a' under '~a'~%") - item target)) - - (return #t)))) + ;; Register ITEM; as a side-effect, it resets timestamps, etc. + ;; Explicitly use "TARGET/var/guix" as the state directory, to avoid + ;; reproducing the user's current settings; see + ;; . + (unless (register-path item + #:prefix target + #:state-directory state + #:references references) + (leave (G_ "failed to register '~a' under '~a'~%") + item target)))) (define* (copy-closure item target #:key (log-port (current-error-port))) "Copy ITEM and all its dependencies to the store under root directory TARGET, and register them." - (mlet* %store-monad ((refs (references* item)) - (to-copy (topologically-sorted* - (delete-duplicates (cons item refs) - string=?)))) - (sequence %store-monad - (map (cut copy-item <> target #:log-port log-port) - to-copy)))) + (mlet* %store-monad ((to-copy (topologically-sorted* (list item))) + (refs (mapm %store-monad references* to-copy))) + (for-each (cut copy-item <> <> target #:log-port log-port) + to-copy refs) + + (return *unspecified*))) (define* (install-bootloader installer-drv #:key -- 2.15.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 30 08:57:36 2017 Received: (at 29509) by debbugs.gnu.org; 30 Nov 2017 13:57:36 +0000 Received: from localhost ([127.0.0.1]:37682 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKPLL-0000h9-Uv for submit@debbugs.gnu.org; Thu, 30 Nov 2017 08:57:36 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53883) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKPLH-0000gA-3A for 29509@debbugs.gnu.org; Thu, 30 Nov 2017 08:57:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKPL7-0001Zn-BP for 29509@debbugs.gnu.org; Thu, 30 Nov 2017 08:57:26 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59249) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKPKz-0001Go-DK; Thu, 30 Nov 2017 08:57:13 -0500 Received: from [193.50.110.211] (port=49948 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eKPKx-00032N-0m; Thu, 30 Nov 2017 08:57:11 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 29509@debbugs.gnu.org Subject: [PATCH 4/6] weather: Use (guix progress) for progress report. Date: Thu, 30 Nov 2017 14:57:00 +0100 Message-Id: <20171130135702.4321-4-ludo@gnu.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171130135702.4321-1-ludo@gnu.org> References: <20171130135702.4321-1-ludo@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 29509 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) * 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'. --- .dir-locals.el | 3 +- guix/progress.scm | 22 ++++++++++ guix/scripts/weather.scm | 106 +++++++++++++++++++++++------------------------ 3 files changed, 76 insertions(+), 55 deletions(-) diff --git a/.dir-locals.el b/.dir-locals.el index 04b58d2ce..949f7e0bc 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -77,7 +77,8 @@ (eval . (put 'container-excursion 'scheme-indent-function 1)) (eval . (put 'eventually 'scheme-indent-function 1)) - ;; Recognize '~', '+', and '$', as used for gexps, as quotation symbols. + (eval . (put 'call-with-progress-reporter 'scheme-indent-function 1)) + ;; This notably allows '(' in Paredit to not insert a space when the ;; preceding symbol is one of these. (eval . (modify-syntax-entry ?~ "'")) diff --git a/guix/progress.scm b/guix/progress.scm index 1ee7ec319..0ca5c0878 100644 --- a/guix/progress.scm +++ b/guix/progress.scm @@ -31,6 +31,10 @@ progress-reporter? call-with-progress-reporter + start-progress-reporter! + stop-progress-reporter! + progress-reporter-report! + progress-reporter/silent progress-reporter/file progress-reporter/bar @@ -60,6 +64,24 @@ stopped." (($ start report stop) (dynamic-wind start (lambda () (proc report)) stop)))) +(define (start-progress-reporter! reporter) + "Low-level procedure to start REPORTER." + (match reporter + (($ start report stop) + (start)))) + +(define (progress-reporter-report! reporter) + "Low-level procedure to lead REPORTER to emit a report." + (match reporter + (($ start report stop) + (report)))) + +(define (stop-progress-reporter! reporter) + "Low-level procedure to stop REPORTER." + (match reporter + (($ start report stop) + (stop)))) + (define progress-reporter/silent (make-progress-reporter noop noop noop)) diff --git a/guix/scripts/weather.scm b/guix/scripts/weather.scm index 0d4a7fa26..2e782e36c 100644 --- a/guix/scripts/weather.scm +++ b/guix/scripts/weather.scm @@ -23,10 +23,11 @@ #:use-module (guix packages) #:use-module (guix profiles) #:use-module (guix derivations) + #:use-module (guix progress) #:use-module (guix monads) #:use-module (guix store) #:use-module (guix grafts) - #:use-module (guix build syscalls) + #:use-module ((guix build syscalls) #:select (terminal-columns)) #:use-module (guix scripts substitute) #:use-module (gnu packages) #:use-module (web uri) @@ -48,42 +49,38 @@ (cons package result)))) '())) +(define (call-with-progress-reporter reporter proc) + "This is a variant of 'call-with-progress-reporter' that works with monadic +scope." + ;; TODO: Move to a more appropriate place. + (with-monad %store-monad + (start-progress-reporter! reporter) + (mlet* %store-monad ((report -> (lambda () + (progress-reporter-report! reporter))) + (result (proc report))) + (stop-progress-reporter! reporter) + (return result)))) + (define* (package-outputs packages #:optional (system (%current-system))) "Return the list of outputs of all of PACKAGES for the given SYSTEM." (let ((packages (filter (cut supported-package? <> system) packages))) - - (define update-progress! - (let ((total (length packages)) - (done 0) - (width (max 10 (- (terminal-columns) 10)))) - (lambda () - (set! done (+ 1 done)) - (let* ((ratio (/ done total 1.)) - (done (inexact->exact (round (* width ratio)))) - (left (- width done))) - (format (current-error-port) "~5,1f% [~a~a]\r" - (* ratio 100.) - (make-string done #\#) - (make-string left #\space)) - (when (>= done total) - (newline (current-error-port))) - (force-output (current-error-port)))))) - (format (current-error-port) (G_ "computing ~h package derivations for ~a...~%") (length packages) system) - (foldm %store-monad - (lambda (package result) - (mlet %store-monad ((drv (package->derivation package system - #:graft? #f))) - (update-progress!) - (match (derivation->output-paths drv) - (((names . items) ...) - (return (append items result)))))) - '() - packages))) + (call-with-progress-reporter (progress-reporter/bar (length packages)) + (lambda (report) + (foldm %store-monad + (lambda (package result) + (mlet %store-monad ((drv (package->derivation package system + #:graft? #f))) + (report) + (match (derivation->output-paths drv) + (((names . items) ...) + (return (append items result)))))) + '() + packages))))) (cond-expand (guile-2.2 @@ -204,31 +201,32 @@ Report the availability of substitutes.\n")) (define (guix-weather . args) (with-error-handling - (let* ((opts (parse-command-line args %options - (list %default-options) - #:build-options? #f)) - (urls (assoc-ref opts 'substitute-urls)) - (systems (match (filter-map (match-lambda - (('system . system) system) - (_ #f)) - opts) - (() (list (%current-system))) - (systems systems))) - (packages (let ((file (assoc-ref opts 'manifest))) - (if file - (load-manifest file) - (all-packages)))) - (items (with-store store - (parameterize ((%graft? #f)) - (concatenate - (run-with-store store - (mapm %store-monad - (lambda (system) - (package-outputs packages system)) - systems))))))) - (for-each (lambda (server) - (report-server-coverage server items)) - urls)))) + (parameterize ((current-terminal-columns (terminal-columns))) + (let* ((opts (parse-command-line args %options + (list %default-options) + #:build-options? #f)) + (urls (assoc-ref opts 'substitute-urls)) + (systems (match (filter-map (match-lambda + (('system . system) system) + (_ #f)) + opts) + (() (list (%current-system))) + (systems systems))) + (packages (let ((file (assoc-ref opts 'manifest))) + (if file + (load-manifest file) + (all-packages)))) + (items (with-store store + (parameterize ((%graft? #f)) + (concatenate + (run-with-store store + (mapm %store-monad + (lambda (system) + (package-outputs packages system)) + systems))))))) + (for-each (lambda (server) + (report-server-coverage server items)) + urls))))) ;;; Local Variables: ;;; eval: (put 'let/time 'scheme-indent-function 1) -- 2.15.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 01 10:03:36 2017 Received: (at 29509-done) by debbugs.gnu.org; 1 Dec 2017 15:03:36 +0000 Received: from localhost ([127.0.0.1]:40117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKmqm-0000dC-99 for submit@debbugs.gnu.org; Fri, 01 Dec 2017 10:03:36 -0500 Received: from [141.255.128.1] (port=34762 helo=hera.aquilenet.fr) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKmqk-0000d5-NS for 29509-done@debbugs.gnu.org; Fri, 01 Dec 2017 10:03:35 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 016CE10113 for <29509-done@debbugs.gnu.org>; Fri, 1 Dec 2017 16:03:37 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eCROBeEDAL_2 for <29509-done@debbugs.gnu.org>; Fri, 1 Dec 2017 16:03:36 +0100 (CET) Received: from ribbon (unknown [193.50.110.211]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 6B78110112 for <29509-done@debbugs.gnu.org>; Fri, 1 Dec 2017 16:03:36 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: 29509-done@debbugs.gnu.org Subject: Re: [bug#29509] [PATCH 0/6] Display progress bar in 'guix system init' References: <20171130134620.3877-1-ludo@gnu.org> Date: Fri, 01 Dec 2017 16:03:33 +0100 In-Reply-To: <20171130134620.3877-1-ludo@gnu.org> ("Ludovic \=\?utf-8\?Q\?Cour\?\= \=\?utf-8\?Q\?t\=C3\=A8s\=22's\?\= message of "Thu, 30 Nov 2017 14:46:20 +0100") Message-ID: <877eu6fq2i.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 2.2 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Ludovic Courtès skribis: > progress: Factorize erase-in-line. > progress: 'progress-bar' accounts for brackets. > progress: Add 'progress-reporter/bar'. > weather: Use (guix progress) for progress report. > guix system: Simplify closure copy. > guix system: 'init' displays a progress bar while copying. [...] Content analysis details: (2.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_FAIL SPF: HELO does not match SPF record (fail) [SPF failed: Please see http://www.openspf.org/Why?s=helo;id=hera.aquilenet.fr;ip=141.255.128.1;r=debbugs.gnu.org] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Debbugs-Envelope-To: 29509-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.2 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Ludovic Courtès skribis: > progress: Factorize erase-in-line. > progress: 'progress-bar' accounts for brackets. > progress: Add 'progress-reporter/bar'. > weather: Use (guix progress) for progress report. > guix system: Simplify closure copy. > guix system: 'init' displays a progress bar while copying. [...] Content analysis details: (2.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_FAIL SPF: HELO does not match SPF record (fail) [SPF failed: Please see http://www.openspf.org/Why?s=helo;id=hera.aquilenet.fr;ip=141.255.128.1;r=debbugs.gnu.org] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS Ludovic Court=C3=A8s skribis: > progress: Factorize erase-in-line. > progress: 'progress-bar' accounts for brackets. > progress: Add 'progress-reporter/bar'. > weather: Use (guix progress) for progress report. > guix system: Simplify closure copy. > guix system: 'init' displays a progress bar while copying. I got an informal =E2=80=9CLGTM=E2=80=9D from Mathieu yesterday on IRC and = it all seems to work for me, so I went ahead and pushed. Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 14 17:02:03 2017 Received: (at 29509) by debbugs.gnu.org; 14 Dec 2017 22:02:03 +0000 Received: from localhost ([127.0.0.1]:34240 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePbZq-000733-T5 for submit@debbugs.gnu.org; Thu, 14 Dec 2017 17:02:03 -0500 Received: from dd1012.kasserver.com ([85.13.128.8]:50902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePbZm-00072c-K3 for 29509@debbugs.gnu.org; Thu, 14 Dec 2017 17:01:59 -0500 Received: from localhost (77.118.194.249.wireless.dyn.drei.com [77.118.194.249]) by dd1012.kasserver.com (Postfix) with ESMTPSA id 8D79A1CA03FA; Thu, 14 Dec 2017 23:01:56 +0100 (CET) Date: Thu, 14 Dec 2017 23:01:53 +0100 From: Danny Milosavljevic To: Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: Re: [bug#29509] [PATCH 1/6] progress: Factorize erase-in-line. Message-ID: <20171214230153.34dc95d4@scratchpost.org> In-Reply-To: <20171130135702.4321-1-ludo@gnu.org> References: <20171130134620.3877-1-ludo@gnu.org> <20171130135702.4321-1-ludo@gnu.org> X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 29509 Cc: 29509@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) > +(define (erase-in-line port) > + "Write an ANSI erase-in-line sequence to PORT to erase the whole line and > +move the cursor to the beginning of the line." > + (display "\r\x1b[K" port)) > + Hmm, with the "\r" in front it's more like erase-current-line, no? (f.e. the order is different: move the cursor to the beginning of the line and then erase the rest of the line - which then means: whole line) Otherwise LGTM! From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 14 17:03:24 2017 Received: (at 29509) by debbugs.gnu.org; 14 Dec 2017 22:03:24 +0000 Received: from localhost ([127.0.0.1]:34244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePbbA-000756-B0 for submit@debbugs.gnu.org; Thu, 14 Dec 2017 17:03:24 -0500 Received: from dd1012.kasserver.com ([85.13.128.8]:51042) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePbb9-00074z-6r for 29509@debbugs.gnu.org; Thu, 14 Dec 2017 17:03:23 -0500 Received: from localhost (77.118.194.249.wireless.dyn.drei.com [77.118.194.249]) by dd1012.kasserver.com (Postfix) with ESMTPSA id 2E4391CA03FA; Thu, 14 Dec 2017 23:03:22 +0100 (CET) Date: Thu, 14 Dec 2017 23:03:20 +0100 From: Danny Milosavljevic To: Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: Re: [bug#29509] [PATCH 2/6] progress: 'progress-bar' accounts for brackets. Message-ID: <20171214230320.49c5cdb0@scratchpost.org> In-Reply-To: <20171130135702.4321-2-ludo@gnu.org> References: <20171130135702.4321-1-ludo@gnu.org> <20171130135702.4321-2-ludo@gnu.org> X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Score: 1.8 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: LGTM! [...] Content analysis details: (1.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [85.13.128.8 listed in list.dnswl.org] 2.5 BODY_SINGLE_WORD Message body is only one word (no spaces) X-Debbugs-Envelope-To: 29509 Cc: 29509@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.8 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: LGTM! [...] Content analysis details: (1.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [85.13.128.8 listed in list.dnswl.org] 2.5 BODY_SINGLE_WORD Message body is only one word (no spaces) LGTM! From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 15 04:47:59 2017 Received: (at 29509) by debbugs.gnu.org; 15 Dec 2017 09:47:59 +0000 Received: from localhost ([127.0.0.1]:34635 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePmb1-0003Os-Ka for submit@debbugs.gnu.org; Fri, 15 Dec 2017 04:47:59 -0500 Received: from hera.aquilenet.fr ([141.255.128.1]:54321) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePmb0-0003Ol-JM for 29509@debbugs.gnu.org; Fri, 15 Dec 2017 04:47:58 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 55DA3102B8; Fri, 15 Dec 2017 10:48:01 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F_W-zMPPlSJA; Fri, 15 Dec 2017 10:48:00 +0100 (CET) Received: from ribbon (unknown [193.50.110.249]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 573A9DA55; Fri, 15 Dec 2017 10:48:00 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Danny Milosavljevic Subject: Re: [bug#29509] [PATCH 1/6] progress: Factorize erase-in-line. References: <20171130134620.3877-1-ludo@gnu.org> <20171130135702.4321-1-ludo@gnu.org> <20171214230153.34dc95d4@scratchpost.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 25 Frimaire an 226 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 15 Dec 2017 10:47:56 +0100 In-Reply-To: <20171214230153.34dc95d4@scratchpost.org> (Danny Milosavljevic's message of "Thu, 14 Dec 2017 23:01:53 +0100") Message-ID: <87o9n0l3ub.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 29509 Cc: 29509@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Danny Milosavljevic skribis: >> +(define (erase-in-line port) >> + "Write an ANSI erase-in-line sequence to PORT to erase the whole line= and >> +move the cursor to the beginning of the line." >> + (display "\r\x1b[K" port)) >> + > > Hmm, with the "\r" in front it's more like erase-current-line, no? (f.e. = the order is different: move the cursor to the beginning of the line and th= en erase the rest of the line - which then means: whole line) Yes you=E2=80=99re right: it uses the =E2=80=9Cerase-in-line=E2=80=9D ANSI = sequence but what it does is more appropriately described as =E2=80=9Cerase current line=E2=80= =9D (which is what the docstring says.) I=E2=80=99ve renamed it to =E2=80=98erase-current-line=E2=80=99. Thanks, Ludo=E2=80=99. From unknown Wed Aug 20 04:11:11 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 12 Jan 2018 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator