From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id WFGEJ+x6V2DwBQAA0tVLHw (envelope-from ) for ; Sun, 21 Mar 2021 16:57:16 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id qOJRI+x6V2DHNAAAbx9fmQ (envelope-from ) for ; Sun, 21 Mar 2021 16:57:16 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 539141D60C for ; Sun, 21 Mar 2021 17:57:16 +0100 (CET) Received: from localhost ([::1]:57580 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lO1O7-000234-H8 for larch@yhetil.org; Sun, 21 Mar 2021 12:57:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52448) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lO1Nu-00022M-G5 for guix-patches@gnu.org; Sun, 21 Mar 2021 12:57:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43802) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lO1Nu-0004UI-9B for guix-patches@gnu.org; Sun, 21 Mar 2021 12:57:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lO1Nu-0008IU-9A for guix-patches@gnu.org; Sun, 21 Mar 2021 12:57:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47295] [PATCH 2/2] status: Don't display download URLs for '--verbosity=1'. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 21 Mar 2021 16:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47295 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 47295@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 47295-submit@debbugs.gnu.org id=B47295.161634579931856 (code B ref 47295); Sun, 21 Mar 2021 16:57:02 +0000 Received: (at 47295) by debbugs.gnu.org; 21 Mar 2021 16:56:39 +0000 Received: from localhost ([127.0.0.1]:55347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lO1NW-0008Hk-Q1 for submit@debbugs.gnu.org; Sun, 21 Mar 2021 12:56:39 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lO1NV-0008HQ-5p for 47295@debbugs.gnu.org; Sun, 21 Mar 2021 12:56:37 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:41983) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lO1NP-0004Hu-Il; Sun, 21 Mar 2021 12:56:31 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=38628 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lO1NF-0005cv-6c; Sun, 21 Mar 2021 12:56:24 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Sun, 21 Mar 2021 17:56:04 +0100 Message-Id: <20210321165604.6426-2-ludo@gnu.org> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210321165604.6426-1-ludo@gnu.org> References: <20210321165604.6426-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1616345836; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=0CwcuxhLn+swXAvZPiCC6OJj4HsuYRObfl3+akdzIBs=; b=X2meU4bhaMQ+gUQOABxBJilukoRDxwNdlW8nmgiPlVb0TNGgWaukTM4Hlem8qFeeLs3e4j EbqT+jw6t2PCqkWdCU7EOZxZEcXglb4PJ0DgC9s2mzDgKf6eIDRrBFLme6dM6xUBGlRs6Y Cc72ZR6S3cASURRO98itRvlqy58BxgunGI9YkoyfoEeBV5DByhjZWsTCD7Cut3FY8yFsLt gJKiAuOZfl8bE/vYuRA9nEuUSvQ7Y1SFGYFbbK9ZchjTaHhwOYQuB1eU5+ZBZFShjNtxBR 8s/cRCGYeeavifyJFyRPnImFUsBx3nmtsmcv92x9v8I35XWF5BFP6M8aW/Lx6A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1616345836; a=rsa-sha256; cv=none; b=hLDmpr09bM3CXAGh+0GprDFY0EglvR37QbQjpzCte5zcIFWpkR3Dn/HSFEavt/x7RTobyG l2f8HQNs+9vdV2ats/A896bVcbpxkTab5PXjQwedUPQzDUX+a4DIvvSbYJ8/Asgn49Dt7Z rfF6iXC0hgI+cB3ZiIE6JYCyGMoY8frsPmQWUjA9Ck2eSeQ2blVud+isUbczY+vKATcjm6 3T+e0IRUFCPcQb6PB32/tMqjWWicoCLdeB/u+s6ZfZcaCX1GtCwSrND5FyZP5dD7/DL/qn QIH6govpadoDDpuqDMJkoEAEEdklYfHL9Cu81tGnyZhawODTXfhV8c1Vv1ALXw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 2.08 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 539141D60C X-Spam-Score: 2.08 X-Migadu-Scanner: scn0.migadu.com X-TUID: md5AN/ViSEdv With this change, each substitute occupies a single line of output (instead of two) when using '-v1', the default for 'guix package' & co. * guix/status.scm (print-build-event): Add #:print-urls? and honor it. (print-build-event/quiet): Pass #:print-urls? #f. (print-build-event/quiet-with-urls): New procedure. (logger-for-level): Add case for LEVEL 2. * doc/guix.texi (Common Build Options): Adjust '--verbosity' documentation. --- doc/guix.texi | 7 ++++--- guix/status.scm | 23 +++++++++++++++++++---- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 94ecd2c247..8c6550e733 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -10253,9 +10253,10 @@ guix-daemon, @option{--timeout}}). @cindex build logs, verbosity @item -v @var{level} @itemx --verbosity=@var{level} -Use the given verbosity @var{level}, an integer. Choosing 0 means that no -output is produced, 1 is for quiet output, and 2 shows all the build log -output on standard error. +Use the given verbosity @var{level}, an integer. Choosing 0 means that +no output is produced, 1 is for quiet output; 2 is similar to 1 but it +additionally displays download URLs; 3 shows all the build log output on +standard error. @item --cores=@var{n} @itemx -c @var{n} diff --git a/guix/status.scm b/guix/status.scm index d47bf1700c..362ae2882c 100644 --- a/guix/status.scm +++ b/guix/status.scm @@ -403,10 +403,12 @@ the current build phase." #:optional (port (current-error-port)) #:key (colorize? (color-output? port)) + (print-urls? #t) (print-log? #t)) "Print information about EVENT and STATUS to PORT. When COLORIZE? is true, produce colorful output. When PRINT-LOG? is true, display the build log in -addition to build events." +addition to build events. When PRINT-URLS? is true, display the URL of +substitutes being downloaded." (define info (if colorize? (cute colorize-string <> (color BOLD)) @@ -526,9 +528,10 @@ addition to build events." (format port (info (G_ "substituting ~a...")) item) (newline port))) (('download-started item uri _ ...) - (erase-current-line*) - (format port (info (G_ "downloading from ~a ...")) uri) - (newline port)) + (when print-urls? + (erase-current-line*) + (format port (info (G_ "downloading from ~a ...")) uri) + (newline port))) (('download-progress item uri (= string->number size) (= string->number transferred)) @@ -602,6 +605,17 @@ addition to build events." (colorize? (color-output? port))) (print-build-event event old-status status port #:colorize? colorize? + #:print-urls? #f + #:print-log? #f)) + +(define* (print-build-event/quiet-with-urls event old-status status + #:optional + (port (current-error-port)) + #:key + (colorize? (color-output? port))) + (print-build-event event old-status status port + #:colorize? colorize? + #:print-urls? #t ;show download URLs #:print-log? #f)) (define* (build-status-updater #:optional (on-change (const #t))) @@ -787,6 +801,7 @@ evaluate EXP... in that context." "Return the logging procedure that corresponds to LEVEL." (cond ((<= level 0) (const #t)) ((= level 1) print-build-event/quiet) + ((= level 2) print-build-event/quiet-with-urls) (else print-build-event))) (define (call-with-status-verbosity level thunk) -- 2.31.0