From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Small texlive variant Date: Thu, 11 Feb 2016 11:45:01 +0100 Message-ID: <87r3gjsez6.fsf@gnu.org> References: <20160115152153.GA9454@debian> <87vb6qc4d1.fsf@gnu.org> <20160209214906.GA18201@debian> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTokH-0007Ab-1o for guix-devel@gnu.org; Thu, 11 Feb 2016 05:45:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTokD-0005nj-Sm for guix-devel@gnu.org; Thu, 11 Feb 2016 05:45:08 -0500 In-Reply-To: <20160209214906.GA18201@debian> (Andreas Enge's message of "Tue, 9 Feb 2016 22:49:06 +0100") 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Andreas Enge Cc: guix-devel@gnu.org Andreas Enge skribis: > On Tue, Jan 19, 2016 at 10:20:42AM +0100, Ludovic Court=C3=A8s wrote: >> This is a bit verbose. I think it would be nice to have a data >> structure to describe what we are deleting, along these lines >> (untested): > > I agree, computer science 101 tells us to use a function when repeating t= he > same sequence of statements on separate data. This is what I did in the n= ew > attached patch; I also "flattened out" the deletion as you suggest. > > However, the data structure thing was too complicated for me and I think = not > really needed. I think it was clearer and separated concerns better (filtering vs. deleting.) :-) The version you propose is acceptable too. > From 8a2ebb8163c54f80f2a5e4708956b87b134ada85 Mon Sep 17 00:00:00 2001 > From: Andreas Enge > Date: Fri, 15 Jan 2016 16:00:47 +0100 > Subject: [PATCH] gnu: Add texlive-minimal. > > * gnu/packages/texlive.scm (texlive-texmf-minimal, texlive-minimal): > New variables. [...] > + (with-directory-excursion "texmf-dist" > + (for-each delete-file-recursively > + '("doc" "source" "tex4ht")) > + ;; Delete all subdirectories of "fonts", except for those > + ;; named "cm", that is, "afm/public/amsfonts/cm", This comment is too indented and redundant with the code below, I think. > + (let ((delete > + ;; delete all files and directories in SUBDIR > + ;; except for those given in the list EXCLUDE Make it an inner =E2=80=98define=E2=80=99, to reduce indentation. Also the docstring should be below the formal parameter list, and should be a sentence. > + (lambda (subdir exclude) I=E2=80=99d make exclude a keyword parameter, for clarity. With these changes, it would look like: (define* (delete directory #:key (except '())) ;; Delete all the files and directories in DIRECTORIES, except those ;; listed in in EXCEPT. =E2=80=A6) How does that sound? Thanks! Ludo=E2=80=99.