From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] guix refresh: Add '--key-download'. Date: Sat, 08 Jun 2013 16:48:51 +0200 Message-ID: <87fvwsr73g.fsf@gnu.org> References: <87ehdzlg89.fsf@gnu.org> <87d2t2ehnp.fsf@karetnikov.org> <87d2t24ejj.fsf@gnu.org> <87bo8jfziy.fsf@karetnikov.org> <87obcjt1x5.fsf@gnu.org> <87fvxu30pi.fsf@karetnikov.org> <877gj5su70.fsf@gnu.org> <87obchmx23.fsf@karetnikov.org> <87fvxc4r3k.fsf@karetnikov.org> <87y5b4y1vp.fsf@gnu.org> <877gih2t2a.fsf@karetnikov.org> <87a9n9vna8.fsf@gnu.org> <87ip1qsd8g.fsf_-_@karetnikov.org> <87ppvxgavg.fsf@gnu.org> <87obbg3l5i.fsf_-_@karetnikov.org> 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]:42220) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UlKWi-0000Mp-4L for bug-guix@gnu.org; Sat, 08 Jun 2013 10:53:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UlKWg-000195-JL for bug-guix@gnu.org; Sat, 08 Jun 2013 10:53:56 -0400 Received: from hera.aquilenet.fr ([141.255.128.1]:54390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UlKWg-00018j-7q for bug-guix@gnu.org; Sat, 08 Jun 2013 10:53:54 -0400 In-Reply-To: <87obbg3l5i.fsf_-_@karetnikov.org> (Nikita Karetnikov's message of "Sat, 08 Jun 2013 15:19:05 +0400") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: Nikita Karetnikov Cc: bug-guix@gnu.org Nikita Karetnikov skribis: >> It just occurred to me that it might be more intuitive to use one of > >> 'interactive >> #f ; never download >> _ ; (any other value) always download > > IMO, an attached version is better because we use high-level terms: > interactive, never, and always. Hmm yes but at the language level, =E2=80=98never=E2=80=99 is really #f. N= ot big deal though, so I=E2=80=99m fine either way. (Actually, R6RS-style enums are pr= obably what we=E2=80=99d need here, but that=E2=80=99s OK.) >> Modulo these details, it seems ready to get it. > > Can I push the attached version? > > What should I do next? For instance, I can change 'guix refresh' to > fetch signatures first and don't download tarballs that can't be > authenticated (when signatures are missing and 'never' is used). I don=E2=80=99t think it needs to be this fancy, IMO. > Or I can fix it not to mix version numbers (not to update Guile 1.8.8 > to version 2.0.9). This would be useful, because it=E2=80=99s a practical annoyance. I=E2=80=99m not sure how to proceed. The common pattern is packages that h= ave several series evolving in parallel, like GCC. For those, we could add something in the =E2=80=98properties=E2=80=99 field to say =E2=80=98dont-up= date=E2=80=99, and =E2=80=98guix refresh=E2=80=99 could check for that item. But what we really want to express is the fact that GCC 4.7.n should only be upgraded to GCC 4.7.p, not GCC 4.8. We could try to have a heuristic that guesses if we=E2=80=99re in such a situation. However that seems non-trivial, and possibly fragile. Instead, the Grand Plan would be to have an additional field in =E2=80=98package=E2=80=99 records that provides info as to how to look for = newer versions. Some of that info is currently in gnu-maintenance.scm (the =E2=80=98quirks=E2=80=99 variable). I=E2=80=99m not sure about how to represent that info in a generic way. Th= ere are probably ideas to steal from Debian=E2=80=99s uscan and other distro to= ols. Thoughts? (Note: it=E2=80=99s OK, and perhaps even advisable, to start with the simpl= est plan, and to leave the Grand Plan for later.) > (define* (download-tarball store project directory version > - #:optional (archive-type "gz")) > + #:key (archive-type "gz") > + (key-download 'interactive)) > "Download PROJECT's tarball over FTP and check its OpenPGP signature. = On > -success, return the tarball file name." > +success, return the tarball file name. KEY-DOWNLOAD specifies a download > +policy for missing OpenPGP keys; allowed values: INTERACTIVE (default), > +ALWAYS, and NEVER." In the docstring, please write =E2=80=98interactive=E2=80=99, =E2=80=98alwa= ys=E2=80=99, and =E2=80=98never=E2=80=99 lower-case and quoted, because these are not variable references. (Same in other procedures.) > + (define (receive?) > + (let ((answer > + (_ (begin (format #t "~a~a~%" > + "Would you like to download this ke= y " > + "and add it to your keyring?") > + (read-line))))) > + (string-match (locale-yes-regexp) answer))) Should be: (let ((answer (begin (format #t (_ "Would you like...")) (read-line)))) ...) Please commit with these minor changes. Thanks! Ludo=E2=80=99.