bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] guix refresh: Add '--key-download'.


From: Nikita Karetnikov
Subject: [PATCH] guix refresh: Add '--key-download'.
Date: Fri, 07 Jun 2013 09:26:23 +0400

> First the whole string should be enclosed in (_ ...), otherwise xgettext
> will just extract "~a~a" for translation.

Should I do the same here?

+                  (match arg
+                    ((or "interactive" "always" "never")
+                     (alist-cons 'key-download (string->symbol arg)
+                                 result))

> Perhaps change it to

>   #:key (key-download 'interactive)

I've tried that, but things like (package-update #:key-download
key-download) don't look right.  Here is a simplified example:

;; guix/scripts/refresh.scm
(define* (update-package #:key (key-download 'interactive))
  (package-update #:key-download key-download))

;; guix/gnu-maintenance.scm
(define* (download-tarball #:key (key-download 'interactive))
  (gnupg-verify* #:key-download key-download))

(define* (package-update #:key (key-download 'interactive))
  (download-tarball #:key-download key-download))

;; guix/gnupg.scm
(define* (gnupg-verify* #:key (key-download 'interactive))
  (begin (display key-download)
         (newline)))

scheme@(guile-user)> (update-package)
interactive
scheme@(guile-user)> (update-package #:key-download 'never)
never

> > +          (define (receive?)
> > +            (string=? "y"               ; XXX: i18n

> Guile’s (ice-9 i18n) exports ‘locale-yes-regexp’ and ‘locale-no-regexp’
> (info "(guile) Accessing Locale Information").

Is it fine now?

I'm attaching a patch.  Examples (some commands were omitted):

# ./pre-inst-env guix refresh -u

[...]

ftp://ftp.gnu.org/.../guile-2.0.9.tar.gz.sig    100.0% of 0.2 KiB
gpg: Signature made Wed 10 Apr 2013 06:14:45 AM UTC using DSA key ID EA52ECF4
gpg: Can't check signature: No public key
Would you like to download this key and add it to your keyring?
n
guix refresh: warning: signature verification failed for `guile-2.0.9.tar.gz'
guix refresh: warning: (could be because the public key is not in your keyring)

Should I prepend "guix refresh: " to the question?

# ./pre-inst-env guix refresh -u

[...]

ftp://ftp.gnu.org/.../guile-2.0.9.tar.gz.sig    100.0% of 0.2 KiB
gpg: Signature made Wed 10 Apr 2013 06:14:45 AM UTC using DSA key ID EA52ECF4
gpg: Can't check signature: No public key
Would you like to download this key and add it to your keyring?
y
gpg: requesting key EA52ECF4 from hkp server pgp.mit.edu
gpg: key EA52ECF4: public key "Ludovic Courtès <address@hidden>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1
gpg: Signature made Wed 10 Apr 2013 06:14:45 AM UTC using DSA key ID EA52ECF4
gpg: Good signature from "Ludovic Courtès <address@hidden>"
gpg:                 aka "Ludovic Courtès <address@hidden>"
gpg:                 aka "Ludovic Courtès <address@hidden>"
gpg:                 aka "Ludovic Courtès (INRIA) <address@hidden>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 83C4 F8E5 10A3 3B4C 5BEA  D15D 77DD 95E2 EA52 ECF4
gnu/packages/guile.scm:49:12: guile: updating from version 1.8.8 to version 
2.0.9...

# ./pre-inst-env guix refresh -u --key-download=never

[...]

ftp://ftp.gnu.org/.../guile-2.0.9.tar.gz.sig    100.0% of 0.2 KiB
gpg: Signature made Wed 10 Apr 2013 06:14:45 AM UTC using DSA key ID EA52ECF4
gpg: Can't check signature: No public key
guix refresh: warning: signature verification failed for `guile-2.0.9.tar.gz'
guix refresh: warning: (could be because the public key is not in your keyring)

# ./pre-inst-env guix refresh -u --key-download=always

[...]

ftp://ftp.gnu.org/.../guile-2.0.9.tar.gz.sig    100.0% of 0.2 KiB
gpg: Signature made Wed 10 Apr 2013 06:14:45 AM UTC using DSA key ID EA52ECF4
gpg: Can't check signature: No public key
gpg: requesting key EA52ECF4 from hkp server pgp.mit.edu
gpg: key EA52ECF4: public key "Ludovic Courtès <address@hidden>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1
gpg: Signature made Wed 10 Apr 2013 06:14:45 AM UTC using DSA key ID EA52ECF4
gpg: Good signature from "Ludovic Courtès <address@hidden>"
gpg:                 aka "Ludovic Courtès <address@hidden>"
gpg:                 aka "Ludovic Courtès <address@hidden>"
gpg:                 aka "Ludovic Courtès (INRIA) <address@hidden>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 83C4 F8E5 10A3 3B4C 5BEA  D15D 77DD 95E2 EA52 ECF4
gnu/packages/guile.scm:49:12: guile: updating from version 1.8.8 to version 
2.0.9...

# ./pre-inst-env guix refresh -u --key-download=interactive

ftp://ftp.gnu.org/.../guile-2.0.9.tar.gz.sig    100.0% of 0.2 KiB
gpg: Signature made Wed 10 Apr 2013 06:14:45 AM UTC using DSA key ID EA52ECF4
gpg: Can't check signature: No public key
Would you like to download this key and add it to your keyring?
n
guix refresh: warning: signature verification failed for `guile-2.0.9.tar.gz'
guix refresh: warning: (could be because the public key is not in your keyring)

# ./pre-inst-env guix refresh -u --key-download=interactive

ftp://ftp.gnu.org/.../guile-2.0.9.tar.gz.sig    100.0% of 0.2 KiB
gpg: Signature made Wed 10 Apr 2013 06:14:45 AM UTC using DSA key ID EA52ECF4
gpg: Can't check signature: No public key
Would you like to download this key and add it to your keyring?
y
gpg: requesting key EA52ECF4 from hkp server pgp.mit.edu
gpg: key EA52ECF4: public key "Ludovic Courtès <address@hidden>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1
gpg: Signature made Wed 10 Apr 2013 06:14:45 AM UTC using DSA key ID EA52ECF4
gpg: Good signature from "Ludovic Courtès <address@hidden>"
gpg:                 aka "Ludovic Courtès <address@hidden>"
gpg:                 aka "Ludovic Courtès <address@hidden>"
gpg:                 aka "Ludovic Courtès (INRIA) <address@hidden>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 83C4 F8E5 10A3 3B4C 5BEA  D15D 77DD 95E2 EA52 ECF4
gnu/packages/guile.scm:49:12: guile: updating from version 1.8.8 to version 
2.0.9...

# ./pre-inst-env guix refresh -u --key-download=foo
guix refresh: error: unsupported policy: foo

Attachment: 0001-guix-refresh-Add-key-download.patch
Description: Text Data

Attachment: pgpqE3VMpGsdx.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]