From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 4LVDOksRq19FKQAA0tVLHw (envelope-from ) for ; Tue, 10 Nov 2020 22:16:43 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 2O4vNksRq18RbwAAB5/wlQ (envelope-from ) for ; Tue, 10 Nov 2020 22:16:43 +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 6A66A9403CA for ; Tue, 10 Nov 2020 22:16:43 +0000 (UTC) Received: from localhost ([::1]:46680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcbwP-0007wV-JN for larch@yhetil.org; Tue, 10 Nov 2020 17:16:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcbvm-0007vA-Ry for guix-patches@gnu.org; Tue, 10 Nov 2020 17:16:08 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:55943) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kcbvm-00052b-IF for guix-patches@gnu.org; Tue, 10 Nov 2020 17:16:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kcbvm-0001YY-DS for guix-patches@gnu.org; Tue, 10 Nov 2020 17:16:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#44460] Add copyright lines Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 10 Nov 2020 22:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44460 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: John Soo Cc: 44460@debbugs.gnu.org Received: via spool by 44460-submit@debbugs.gnu.org id=B44460.16050465215926 (code B ref 44460); Tue, 10 Nov 2020 22:16:02 +0000 Received: (at 44460) by debbugs.gnu.org; 10 Nov 2020 22:15:21 +0000 Received: from localhost ([127.0.0.1]:39256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kcbv6-0001XW-N2 for submit@debbugs.gnu.org; Tue, 10 Nov 2020 17:15:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37546) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kcbv5-0001XH-66 for 44460@debbugs.gnu.org; Tue, 10 Nov 2020 17:15:19 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42667) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcbuz-0004pg-OV; Tue, 10 Nov 2020 17:15:13 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=49796 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kcbuz-0004tr-27; Tue, 10 Nov 2020 17:15:13 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87o8kcv30a.fsf@asu.edu> <878sbeoya2.fsf@asu.edu> Date: Tue, 10 Nov 2020 23:15:11 +0100 In-Reply-To: <878sbeoya2.fsf@asu.edu> (John Soo's message of "Fri, 06 Nov 2020 15:34:13 -0800") Message-ID: <87k0usn9jk.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) 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-Scanner: ns3122888.ip-94-23-21.eu 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-Spam-Score: -1.51 X-TUID: 93Ilm6Ew14mQ Hi John, John Soo skribis: >>>From 48945997d9139ddc5e288512de3dda8d5accaf44 Mon Sep 17 00:00:00 2001 > From: John Soo > Date: Wed, 4 Nov 2020 07:51:52 -0800 > Subject: [PATCH] processes: Optionally normalize recutils output. > > * guix/scripts/processes.scm: Add "normalize" flag [...] > +@table @code > +@item --normalize > +Normalize the output records into record sets (@pxref{Record Sets,,, > +recutils, GNU recutils manual}). Normalizing into record sets allows > +joins across record types. > + > +@example > +$ guix processes --normalize | \ > + recsel \ > + -j Session \ > + -t ChildProcess \ > + -p Session.PID,PID \ > + -e 'Session.ClientCommand ~ build' > +Session_PID: 4278 > +PID: 4435 > + > +Session_PID: 4278 > +PID: 4554 > + > +Session_PID: 4278 > +PID: 4646 > +@end example > +@end table Nice! Right above the example, I=E2=80=99d suggest adding a sentence like = =E2=80=9CThe example below lists=E2=80=A6=E2=80=9D (what does it list actually? :-)). In the default format, I wonder if we could already change split =E2=80=98ChildProcess=E2=80=99 into =E2=80=98ChildPID=E2=80=99 and =E2=80= =98ChildCommand=E2=80=99, as you had initially proposed on IRC; would that work? > +(define (lock->record lock port) > + (format port "LockHeld: ~a~%" lock)) Maybe =E2=80=98lock->recutils=E2=80=99 for consistency and to avoid confusi= on with Scheme =E2=80=9Crecords=E2=80=9D? > +(define (format-single-record port) Maybe =E2=80=98daemon-sessions->recutils=E2=80=99? Should =E2=80=98session= s=E2=80=99 be a parameter for clarity? > + "Display denormalized session information to PORT." > + (for-each (lambda (session) > + (daemon-session->recutils session port) > + (newline port)) ^ Indentation is off. > +(define (child-process->normalized-record process port) > + "Display PROCESS record on PORT in normalized form" > + (format port "PID: ~a" (process-id process)) > + (newline port) > + (format port "Command:~{ ~a~}" (process-command process))) > + > +(define (format-normalized port) Please add a docstring. Perhaps make =E2=80=98sessions=E2=80=99 a paramete= r? > + (define sessions (daemon-sessions)) > + > + (format port session-rec-type) As reported by =E2=80=98-Wformat=E2=80=99, passing a non-literal format str= ing is risky; write this instead: (display session-rec-type port) > + (newline port) > + (newline port) > + (for-each > + (lambda (session) Preferable indent =E2=80=98for-each=E2=80=99 like so: (for-each (lambda (session) Likewise below. > + (display (G_ " > + --normalize display results as normalized record sets")) Should it be =E2=80=98--format=3Dnormalized=E2=80=99 (just like we have =E2= =80=98--format=E2=80=99 in =E2=80=98guix describe=E2=80=99, for instance)? Could you send an updated patch? Thanks! Ludo=E2=80=99.