diff options
author | Ludovic Courtès <ludo@gnu.org> | 2014-05-27 23:19:49 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2014-05-27 23:19:49 +0200 |
commit | af018f5e0a1b7c67e9f40ca68929bd35b94206d3 (patch) | |
tree | 8c3efe66f8ac1f6178357937c0a41c6f5ff8f0f8 /guix/gnu-maintenance.scm | |
parent | d84a7be6675bd647931d8eff9134d00dd5a6bd58 (diff) | |
parent | 35066aa596931ef84922298c2760ceba69940cd1 (diff) | |
download | guix-patches-af018f5e0a1b7c67e9f40ca68929bd35b94206d3.tar guix-patches-af018f5e0a1b7c67e9f40ca68929bd35b94206d3.tar.gz |
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/gnu-maintenance.scm')
-rw-r--r-- | guix/gnu-maintenance.scm | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm index 14195da7ba..7b608daea2 100644 --- a/guix/gnu-maintenance.scm +++ b/guix/gnu-maintenance.scm @@ -167,13 +167,22 @@ (lambda (package) "Return true if PACKAGE is a GNU package. This procedure may access the network to check in GNU's database." - ;; TODO: Find a way to determine that a package is non-GNU without going - ;; through the network. + (define (mirror-type url) + (let ((uri (string->uri url))) + (and (eq? (uri-scheme uri) 'mirror) + (if (member (uri-host uri) '("gnu" "gnupg" "gcc")) + 'gnu + 'non-gnu)))) + (let ((url (and=> (package-source package) origin-uri)) (name (package-name package))) - (or (and (string? url) (string-prefix? "mirror://gnu" url)) - (and (member name (map gnu-package-name (official-gnu-packages))) - #t))))))) + (case (and (string? url) (mirror-type url)) + ((gnu) #t) + ((non-gnu) #f) + (else + ;; Last resort: resort to the network. + (and (member name (map gnu-package-name (official-gnu-packages))) + #t)))))))) ;;; |