From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sahithi Yarlagadda Subject: Re: Next steps Date: Tue, 26 Jun 2018 01:43:46 +0530 Message-ID: <4b5ce9b0-a2d1-30e3-489b-a0028d227c5c@swecha.net> References: <8ea5d026-fab9-7b12-198e-610ad7743cb2@swecha.net> <87bmcnzjsp.fsf@elephly.net> <18408eca-ad0b-111a-0ef6-ab452c9ca89c@swecha.net> <878t7ryxvf.fsf@elephly.net> <02e1a59a-ebc1-dfce-e1d6-22e97e742214@swecha.net> <874lifypeb.fsf@elephly.net> <648f81fc-0607-2c3b-f9a3-ca3b29cd637b@swecha.net> <87bmck22uz.fsf@elephly.net> <8736xv1xvq.fsf@elephly.net> <64dfaf0c-3bcf-7b76-5831-b1c41d3f5563@swecha.net> <877en4ccut.fsf@elephly.net> <2b03fcec-c2d8-0604-156c-70fe7643a6cb@swecha.net> <87zhzzbqn6.fsf@elephly.net> <8f509759-c798-a150-bf5a-9b13cd07ac5b@swecha.net> <87lgbibir5.fsf@elephly.net> <564233bd-9511-7f84-3350-6a3a905534a8@swecha.net> <87r2l767sg.fsf@elephly.net> <874lhwtn5a.fsf@elephly.net> <204a32d1-f216-dedd-2234-cd05e3d406a9@swecha.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------D3F0EA1428D66C11701C8D84" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXXsk-0000fq-Dz for guix-devel@gnu.org; Mon, 25 Jun 2018 16:14:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXXsf-0005W6-En for guix-devel@gnu.org; Mon, 25 Jun 2018 16:14:38 -0400 In-Reply-To: <204a32d1-f216-dedd-2234-cd05e3d406a9@swecha.net> Content-Language: en-US List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ricardo Wurmus Cc: guix-devel This is a multi-part message in MIME format. --------------D3F0EA1428D66C11701C8D84 Content-Type: multipart/alternative; boundary="------------F4C4072945617A5C5F3D244B" --------------F4C4072945617A5C5F3D244B Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Ricardo, I think I am done with basic changes for 4th task. File is attached. As mentioned in IRC output is in escape code sequence when I tried in REPL. > I am done with 2nd task out of given 4 tasks and that was included in m= y > previous patch. > I am currently working on 4th task.=20 I am able to filter lines. I am trying out=C2=A0 to*only* filter lines when =E2=80=9Cguix package=E2= =80=9D is used but not when =E2=80=9Cguix build=E2=80=9D by adding other port. ---- Thanks!! Sahithi --------------F4C4072945617A5C5F3D244B Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Hi Ricardo,

I think I am done with basic changes for 4th task. File is attached. As mentioned in IRC output is in escape code sequence when I tried in REPL.

I am done with 2nd task out of given 4 tasks and that was included in my
previous patch.
I am currently working on 4th task. 
I am able to filter lines.
I am trying out  to *only* filter lines when “guix package” is used but not when “guix build” by adding other port.


----
Thanks!!
Sahithi
--------------F4C4072945617A5C5F3D244B-- --------------D3F0EA1428D66C11701C8D84 Content-Type: text/x-scheme; name="Try.scm" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="Try.scm" (use-modules (ice-9 match) ; need this for =E2=80=9Cmatch-lambda=E2=80=9D= (srfi srfi-1) (srfi srfi-26)) ; need this for =E2=80=9Cany=E2=80=9D (define str "phase foo failed after 100 seconds") ;; Each list item in =E2=80=9Cpatterns=E2=80=9D is a regular expression f= ollowed by a ;; number of colours. (let ((patterns '(("^(starting phase )(.*)" BLUE GREEN) ("^(phase)(.*)(succeeded after)(.*)(seconds)" GREEN BLUE GREEN BLUE GREEN) ("^(phase)(.*)(failed after)(.*)(seconds)" RED BLUE RED BLUE RED)))) ;; See if =E2=80=9Cany=E2=80=9D of the patterns matches, i.e. returns = a string and ;; not just #f. We use =E2=80=9Cmatch-lambda=E2=80=9D to bind the pat= tern to the ;; variable =E2=80=9Cpattern=E2=80=9D and the list of colours to the v= ariable ;; =E2=80=9Ccolors=E2=80=9D. (or (any (match-lambda ((pattern . colors) ;; TODO: use string-match, match:count, match:substring, ;; colorize-string, and=3D>, etc to see if a pattern matche= s ;; and to transform the string according to =E2=80=9Ccolors= =E2=80=9D. ;; If the pattern does not match return #f to ;; automatically try the next, thanks to =E2=80=9Cany=E2=80= =9D. =20 ;;(colorize-string (match:substring (match:count (string-ma= tch pattern str))) colors) =20 (and=3D> (string-match pattern str) (lambda (m) ; (colorize-string (map match:substring m (iota (- (mat= ch:count m) 1) 1) colors))) ;(map (cut match:substring m <>) (iota (- (match:count m) 1) 1)= ))) (string-join (map (lambda (n color) (colorize-string (match:substring m n= ) color)) (iota (- (match:count m) 1) 1) colors)))) =20 =20 )) patterns) ;; Nothing matched, so return the string without changes. str)) --------------D3F0EA1428D66C11701C8D84--