summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-02-14 19:05:45 +0100
committerMarius Bakke <mbakke@fastmail.com>2020-02-14 19:05:45 +0100
commit7edafc884c2a21258541b17a231051702c458263 (patch)
treed4202c8d6516bacd32fa55ee23c54b069ef8abd6 /guix
parent89da127035737bdf922bc566970c5506c2e01b00 (diff)
parent64fc4f3705423c83c680a95d8dea81a39fce9a70 (diff)
downloadguix-patches-7edafc884c2a21258541b17a231051702c458263.tar
guix-patches-7edafc884c2a21258541b17a231051702c458263.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'guix')
-rw-r--r--guix/build/go-build-system.scm5
-rw-r--r--guix/git.scm25
-rw-r--r--guix/import/gem.scm147
-rw-r--r--guix/import/pypi.scm34
-rw-r--r--guix/scripts/build.scm19
-rw-r--r--guix/scripts/deploy.scm2
-rw-r--r--guix/scripts/describe.scm80
-rw-r--r--guix/scripts/pull.scm80
-rw-r--r--guix/scripts/system/reconfigure.scm2
-rw-r--r--guix/swh.scm4
-rw-r--r--guix/ui.scm2
11 files changed, 228 insertions, 172 deletions
diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm
index 4bc0156a88..0d15f978cd 100644
--- a/guix/build/go-build-system.scm
+++ b/guix/build/go-build-system.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2016 Petter <petter@mykolab.ch>
;;; Copyright © 2017, 2019 Leo Famulari <leo@famulari.name>
;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2020 Jack Hill <jackhill@jackhill.us>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -141,6 +142,10 @@ dependencies, so it should be self-contained."
;; Using the current working directory as GOPATH makes it easier for packagers
;; who need to manipulate the unpacked source code.
(setenv "GOPATH" (getcwd))
+ ;; Go 1.13 uses go modules by default. The go build system does not
+ ;; currently support modules, so turn modules off to continue using the old
+ ;; GOPATH behavior.
+ (setenv "GO111MODULE" "off")
(setenv "GOBIN" (string-append (assoc-ref outputs "out") "/bin"))
(let ((tmpdir (tmpnam)))
(match (go-inputs inputs)
diff --git a/guix/git.scm b/guix/git.scm
index a12f1eec8e..b1ce3ea451 100644
--- a/guix/git.scm
+++ b/guix/git.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2017, 2020 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
@@ -46,7 +46,9 @@
git-checkout
git-checkout?
git-checkout-url
- git-checkout-branch))
+ git-checkout-branch
+ git-checkout-commit
+ git-checkout-recursive?))
(define %repository-cache-directory
(make-parameter (string-append (cache-directory #:ensure? #f)
@@ -108,6 +110,10 @@ the 'SSL_CERT_FILE' and 'SSL_CERT_DIR' environment variables."
(string-append "R:" url)
url))))))
+;; Authentication appeared in Guile-Git 0.3.0, check if it is available.
+(define auth-supported?
+ (false-if-exception (resolve-interface '(git auth))))
+
(define (clone* url directory)
"Clone git repository at URL into DIRECTORY. Upon failure,
make sure no empty directory is left behind."
@@ -119,7 +125,13 @@ make sure no empty directory is left behind."
;; value in Guile-Git: <https://bugs.gnu.org/29238>.
(if (module-defined? (resolve-interface '(git))
'clone-init-options)
- (clone url directory (clone-init-options))
+ (let ((auth-method (and auth-supported?
+ (%make-auth-ssh-agent))))
+ (clone url directory
+ (if auth-supported?
+ (make-clone-options
+ #:fetch-options (make-fetch-options auth-method))
+ (clone-init-options))))
(clone url directory)))
(lambda _
(false-if-exception (rmdir directory)))))
@@ -281,7 +293,12 @@ When RECURSIVE? is true, check out submodules as well, if any."
;; Only fetch remote if it has not been cloned just before.
(when (and cache-exists?
(not (reference-available? repository ref)))
- (remote-fetch (remote-lookup repository "origin")))
+ (if auth-supported?
+ (let ((auth-method (and auth-supported?
+ (%make-auth-ssh-agent))))
+ (remote-fetch (remote-lookup repository "origin")
+ #:fetch-options (make-fetch-options auth-method)))
+ (remote-fetch (remote-lookup repository "origin"))))
(when recursive?
(update-submodules repository #:log-port log-port))
(let ((oid (switch-to-ref repository canonical-ref)))
diff --git a/guix/import/gem.scm b/guix/import/gem.scm
index 0bf9ff2552..bd5d5b3569 100644
--- a/guix/import/gem.scm
+++ b/guix/import/gem.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2015 David Thompson <davet@gnu.org>
;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
+;;; Copyright © 2020 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -20,28 +21,68 @@
(define-module (guix import gem)
#:use-module (ice-9 match)
- #:use-module (ice-9 pretty-print)
#:use-module (srfi srfi-1)
- #:use-module (rnrs bytevectors)
- #:use-module (json)
- #:use-module (web uri)
+ #:use-module (guix json)
#:use-module ((guix download) #:prefix download:)
#:use-module (guix import utils)
#:use-module (guix import json)
#:use-module (guix packages)
#:use-module (guix upstream)
#:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix base16)
#:use-module (guix base32)
- #:use-module (guix build-system ruby)
+ #:use-module ((guix build-system ruby) #:select (rubygems-uri))
#:export (gem->guix-package
%gem-updater
gem-recursive-import))
+;; Gems as defined by the API at <https://rubygems.org/api/v1/gems>.
+(define-json-mapping <gem> make-gem gem?
+ json->gem
+ (name gem-name) ;string
+ (platform gem-platform) ;string
+ (version gem-version) ;string
+ (authors gem-authors) ;string
+ (licenses gem-licenses "licenses" ;list of strings
+ (lambda (licenses)
+ ;; This is sometimes #nil (the JSON 'null' value). Arrange
+ ;; to always return a list.
+ (cond ((not licenses) '())
+ ((vector? licenses) (vector->list licenses))
+ (else '()))))
+ (info gem-info)
+ (sha256 gem-sha256 "sha" ;bytevector
+ base16-string->bytevector)
+ (home-page gem-home-page "homepage_uri") ;string
+ (dependencies gem-dependencies "dependencies" ;<gem-dependencies>
+ json->gem-dependencies))
+
+(define-json-mapping <gem-dependencies> make-gem-dependencies
+ gem-dependencies?
+ json->gem-dependencies
+ (development gem-dependencies-development ;list of <gem-dependency>
+ "development"
+ json->gem-dependency-list)
+ (runtime gem-dependencies-runtime ;list of <gem-dependency>
+ "runtime"
+ json->gem-dependency-list))
+
+(define (json->gem-dependency-list vector)
+ (if vector
+ (map json->gem-dependency (vector->list vector))
+ '()))
+
+(define-json-mapping <gem-dependency> make-gem-dependency gem-dependency?
+ json->gem-dependency
+ (name gem-dependency-name) ;string
+ (requirements gem-dependency-requirements)) ;string
+
+
(define (rubygems-fetch name)
- "Return an alist representation of the RubyGems metadata for the package NAME,
-or #f on failure."
- (json-fetch
- (string-append "https://rubygems.org/api/v1/gems/" name ".json")))
+ "Return a <gem> record for the package NAME, or #f on failure."
+ (and=> (json-fetch
+ (string-append "https://rubygems.org/api/v1/gems/" name ".json"))
+ json->gem))
(define (ruby-package-name name)
"Given the NAME of a package on RubyGems, return a Guix-compliant name for
@@ -50,41 +91,6 @@ the package."
(snake-case name)
(string-append "ruby-" (snake-case name))))
-(define (hex-string->bytevector str)
- "Convert the hexadecimal encoded string STR to a bytevector."
- (define hex-char->int
- (match-lambda
- (#\0 0)
- (#\1 1)
- (#\2 2)
- (#\3 3)
- (#\4 4)
- (#\5 5)
- (#\6 6)
- (#\7 7)
- (#\8 8)
- (#\9 9)
- (#\a 10)
- (#\b 11)
- (#\c 12)
- (#\d 13)
- (#\e 14)
- (#\f 15)))
-
- (define (read-byte i)
- (let ((j (* 2 i)))
- (+ (hex-char->int (string-ref str (1+ j)))
- (* (hex-char->int (string-ref str j)) 16))))
-
- (let* ((len (/ (string-length str) 2))
- (bv (make-bytevector len)))
- (let loop ((i 0))
- (if (= i len)
- bv
- (begin
- (bytevector-u8-set! bv i (read-byte i))
- (loop (1+ i)))))))
-
(define (make-gem-sexp name version hash home-page synopsis description
dependencies licenses)
"Return the `package' s-expression for a Ruby package with the given NAME,
@@ -97,8 +103,7 @@ VERSION, HASH, HOME-PAGE, DESCRIPTION, DEPENDENCIES, and LICENSES."
(uri (rubygems-uri ,name version))
(sha256
(base32
- ,(bytevector->nix-base32-string
- (hex-string->bytevector hash))))))
+ ,(bytevector->nix-base32-string hash)))))
(build-system ruby-build-system)
,@(if (null? dependencies)
'()
@@ -120,31 +125,25 @@ VERSION, HASH, HOME-PAGE, DESCRIPTION, DEPENDENCIES, and LICENSES."
(define* (gem->guix-package package-name #:optional (repo 'rubygems) version)
"Fetch the metadata for PACKAGE-NAME from rubygems.org, and return the
`package' s-expression corresponding to that package, or #f on failure."
- (let ((package (rubygems-fetch package-name)))
- (and package
- (let* ((name (assoc-ref package "name"))
- (version (assoc-ref package "version"))
- (hash (assoc-ref package "sha"))
- (synopsis (assoc-ref package "info")) ; nothing better to use
- (description (beautify-description
- (assoc-ref package "info")))
- (home-page (assoc-ref package "homepage_uri"))
- (dependencies-names (map (lambda (dep) (assoc-ref dep "name"))
- (vector->list
- (assoc-ref* package
- "dependencies"
- "runtime"))))
- (dependencies (map (lambda (dep)
- (if (string=? dep "bundler")
- "bundler" ; special case, no prefix
- (ruby-package-name dep)))
- dependencies-names))
- (licenses (map string->license
- (vector->list
- (assoc-ref package "licenses")))))
- (values (make-gem-sexp name version hash home-page synopsis
- description dependencies licenses)
- dependencies-names)))))
+ (let ((gem (rubygems-fetch package-name)))
+ (if gem
+ (let* ((dependencies-names (map gem-dependency-name
+ (gem-dependencies-runtime
+ (gem-dependencies gem))))
+ (dependencies (map (lambda (dep)
+ (if (string=? dep "bundler")
+ "bundler" ; special case, no prefix
+ (ruby-package-name dep)))
+ dependencies-names))
+ (licenses (map string->license (gem-licenses gem))))
+ (values (make-gem-sexp (gem-name gem) (gem-version gem)
+ (gem-sha256 gem) (gem-home-page gem)
+ (gem-info gem)
+ (beautify-description (gem-info gem))
+ dependencies
+ licenses)
+ dependencies-names))
+ (values #f '()))))
(define (guix-package->gem-name package)
"Given a PACKAGE built from rubygems.org, return the name of the
@@ -185,9 +184,9 @@ package on RubyGems."
(define (latest-release package)
"Return an <upstream-source> for the latest release of PACKAGE."
(let* ((gem-name (guix-package->gem-name package))
- (metadata (rubygems-fetch gem-name))
- (version (assoc-ref metadata "version"))
- (url (rubygems-uri gem-name version)))
+ (gem (rubygems-fetch gem-name))
+ (version (gem-version gem))
+ (url (rubygems-uri gem-name version)))
(upstream-source
(package (package-name package))
(version version)
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 354cae9c4c..6897f42be3 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -363,7 +364,11 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
(receive (guix-dependencies upstream-dependencies)
(compute-inputs source-url wheel-url temp)
(match guix-dependencies
- ((required-inputs test-inputs)
+ ((required-inputs native-inputs)
+ (when (string-suffix? ".zip" source-url)
+ (set! native-inputs (cons
+ '("unzip" ,unzip)
+ native-inputs)))
(values
`(package
(name ,(python->package-name name))
@@ -371,20 +376,29 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
(source
(origin
(method url-fetch)
- ;; PyPI URL are case sensitive, but sometimes a project
- ;; named using mixed case has a URL using lower case, so
- ;; we must work around this inconsistency. For actual
- ;; examples, compare the URLs of the "Deprecated" and
- ;; "uWSGI" PyPI packages.
- (uri ,(if (string-contains source-url name)
- `(pypi-uri ,name version)
- `(pypi-uri ,(string-downcase name) version)))
+ (uri (pypi-uri
+ ;; PyPI URL are case sensitive, but sometimes
+ ;; a project named using mixed case has a URL
+ ;; using lower case, so we must work around this
+ ;; inconsistency. For actual examples, compare
+ ;; the URLs of the "Deprecated" and "uWSGI" PyPI
+ ;; packages.
+ ,(if (string-contains source-url name)
+ name
+ (string-downcase name))
+ version
+ ;; Some packages have been released as `.zip`
+ ;; instead of the more common `.tar.gz`. For
+ ;; example, see "path-and-address".
+ ,@(if (string-suffix? ".zip" source-url)
+ '(".zip")
+ '())))
(sha256
(base32
,(guix-hash-url temp)))))
(build-system python-build-system)
,@(maybe-inputs required-inputs 'propagated-inputs)
- ,@(maybe-inputs test-inputs 'native-inputs)
+ ,@(maybe-inputs native-inputs 'native-inputs)
(home-page ,home-page)
(synopsis ,synopsis)
(description ,description)
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index f054fc2bce..eedf6bf6a8 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2013 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -34,6 +35,7 @@
#:use-module (guix monads)
#:use-module (guix gexp)
+ #:use-module (guix profiles)
#:autoload (guix http-client) (http-fetch http-get-error?)
#:use-module (ice-9 format)
#:use-module (ice-9 match)
@@ -680,6 +682,9 @@ Build the given PACKAGE-OR-DERIVATION and return their output paths.\n"))
-f, --file=FILE build the package or derivation that the code within
FILE evaluates to"))
(display (G_ "
+ -m, --manifest=FILE build the packages that the manifest given in FILE
+ evaluates to"))
+ (display (G_ "
-S, --source build the packages' source derivations"))
(display (G_ "
--sources[=TYPE] build source derivations; TYPE may optionally be one
@@ -768,6 +773,9 @@ must be one of 'package', 'all', or 'transitive'~%")
(option '(#\f "file") #t #f
(lambda (opt name arg result)
(alist-cons 'file arg result)))
+ (option '(#\m "manifest") #t #f
+ (lambda (opt name arg result)
+ (alist-cons 'manifest arg result)))
(option '(#\n "dry-run") #f #f
(lambda (opt name arg result)
(alist-cons 'dry-run? #t (alist-cons 'graft? #f result))))
@@ -804,6 +812,14 @@ build---packages, gexps, derivations, and so on."
(for-each validate-type lst)
lst))
+ ;; Note: Taken from (guix scripts refresh).
+ (define (manifest->packages manifest)
+ "Return the list of packages in MANIFEST."
+ (filter-map (lambda (entry)
+ (let ((item (manifest-entry-item entry)))
+ (if (package? item) item #f)))
+ (manifest-entries manifest)))
+
(append-map (match-lambda
(('argument . (? string? spec))
(cond ((derivation-path? spec)
@@ -827,6 +843,9 @@ build---packages, gexps, derivations, and so on."
(list (specification->package spec)))))
(('file . file)
(ensure-list (load* file (make-user-module '()))))
+ (('manifest . manifest)
+ (manifest->packages
+ (load* manifest (make-user-module '((guix profiles) (gnu))))))
(('expression . str)
(ensure-list (read/eval str)))
(('argument . (? derivation? drv))
diff --git a/guix/scripts/deploy.scm b/guix/scripts/deploy.scm
index bc0ceabd3f..ad05c333dc 100644
--- a/guix/scripts/deploy.scm
+++ b/guix/scripts/deploy.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2019 David Thompson <davet@gnu.org>
-;;; Copyright © 2019 Jakob L. Kreuze <zerodaysfordays@sdf.lonestar.org>
+;;; Copyright © 2019 Jakob L. Kreuze <zerodaysfordays@sdf.org>
;;;
;;; This file is part of GNU Guix.
;;;
diff --git a/guix/scripts/describe.scm b/guix/scripts/describe.scm
index 99a88c50fa..f13f221da9 100644
--- a/guix/scripts/describe.scm
+++ b/guix/scripts/describe.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
;;;
;;; This file is part of GNU Guix.
@@ -20,18 +20,22 @@
(define-module (guix scripts describe)
#:use-module ((guix config) #:select (%guix-version))
#:use-module ((guix ui) #:hide (display-profile-content))
+ #:use-module ((guix utils) #:select (string-replace-substring))
#:use-module (guix channels)
#:use-module (guix scripts)
#:use-module (guix describe)
#:use-module (guix profiles)
- #:use-module ((guix scripts pull) #:select (display-profile-content))
#:use-module (git)
#:use-module (json)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-37)
#:use-module (ice-9 match)
#:autoload (ice-9 pretty-print) (pretty-print)
- #:export (guix-describe))
+ #:use-module (web uri)
+ #:export (display-profile-content
+ channel-commit-hyperlink
+
+ guix-describe))
;;;
@@ -173,6 +177,76 @@ in the format specified by FMT."
channels))))
(display-package-search-path fmt))
+(define (display-profile-content profile number)
+ "Display the packages in PROFILE, generation NUMBER, in a human-readable
+way and displaying details about the channel's source code."
+ (display-generation profile number)
+ (for-each (lambda (entry)
+ (format #t " ~a ~a~%"
+ (manifest-entry-name entry)
+ (manifest-entry-version entry))
+ (match (assq 'source (manifest-entry-properties entry))
+ (('source ('repository ('version 0)
+ ('url url)
+ ('branch branch)
+ ('commit commit)
+ _ ...))
+ (let ((channel (channel (name 'nameless)
+ (url url)
+ (branch branch)
+ (commit commit))))
+ (format #t (G_ " repository URL: ~a~%") url)
+ (when branch
+ (format #t (G_ " branch: ~a~%") branch))
+ (format #t (G_ " commit: ~a~%")
+ (if (supports-hyperlinks?)
+ (channel-commit-hyperlink channel commit)
+ commit))))
+ (_ #f)))
+
+ ;; Show most recently installed packages last.
+ (reverse
+ (manifest-entries
+ (profile-manifest (if (zero? number)
+ profile
+ (generation-file-name profile number)))))))
+
+(define %vcs-web-views
+ ;; Hard-coded list of host names and corresponding web view URL templates.
+ ;; TODO: Allow '.guix-channel' files to specify a URL template.
+ (let ((labhub-url (lambda (repository-url commit)
+ (string-append
+ (if (string-suffix? ".git" repository-url)
+ (string-drop-right repository-url 4)
+ repository-url)
+ "/commit/" commit))))
+ `(("git.savannah.gnu.org"
+ ,(lambda (repository-url commit)
+ (string-append (string-replace-substring repository-url
+ "/git/" "/cgit/")
+ "/commit/?id=" commit)))
+ ("notabug.org" ,labhub-url)
+ ("framagit.org" ,labhub-url)
+ ("gitlab.com" ,labhub-url)
+ ("gitlab.inria.fr" ,labhub-url)
+ ("github.com" ,labhub-url))))
+
+(define* (channel-commit-hyperlink channel
+ #:optional
+ (commit (channel-commit channel)))
+ "Return a hyperlink for COMMIT in CHANNEL, using COMMIT as the hyperlink's
+text. The hyperlink links to a web view of COMMIT, when available."
+ (let* ((url (channel-url channel))
+ (uri (string->uri url))
+ (host (and uri (uri-host uri))))
+ (if host
+ (match (assoc host %vcs-web-views)
+ (#f
+ commit)
+ ((_ template)
+ (hyperlink (template url commit) commit)))
+ commit)))
+
;;;
;;; Entry point.
diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm
index cb1be989e1..51d4da209a 100644
--- a/guix/scripts/pull.scm
+++ b/guix/scripts/pull.scm
@@ -18,7 +18,7 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (guix scripts pull)
- #:use-module (guix ui)
+ #:use-module ((guix ui) #:hide (display-profile-content))
#:use-module (guix colors)
#:use-module (guix utils)
#:use-module ((guix status) #:select (with-status-verbosity))
@@ -37,6 +37,7 @@
inferior-available-packages
close-inferior)
#:use-module (guix scripts build)
+ #:use-module (guix scripts describe)
#:autoload (guix build utils) (which)
#:use-module ((guix build syscalls)
#:select (with-file-lock/no-wait))
@@ -56,13 +57,12 @@
#:use-module (srfi srfi-34)
#:use-module (srfi srfi-35)
#:use-module (srfi srfi-37)
- #:use-module (web uri)
#:use-module (ice-9 match)
#:use-module (ice-9 vlist)
#:use-module (ice-9 format)
- #:export (display-profile-content
- channel-list
- channel-commit-hyperlink
+ #:re-export (display-profile-content
+ channel-commit-hyperlink)
+ #:export (channel-list
with-git-error-handling
guix-pull))
@@ -188,42 +188,6 @@ Download and deploy the latest version of Guix.\n"))
%standard-build-options))
-(define %vcs-web-views
- ;; Hard-coded list of host names and corresponding web view URL templates.
- ;; TODO: Allow '.guix-channel' files to specify a URL template.
- (let ((labhub-url (lambda (repository-url commit)
- (string-append
- (if (string-suffix? ".git" repository-url)
- (string-drop-right repository-url 4)
- repository-url)
- "/commit/" commit))))
- `(("git.savannah.gnu.org"
- ,(lambda (repository-url commit)
- (string-append (string-replace-substring repository-url
- "/git/" "/cgit/")
- "/commit/?id=" commit)))
- ("notabug.org" ,labhub-url)
- ("framagit.org" ,labhub-url)
- ("gitlab.com" ,labhub-url)
- ("gitlab.inria.fr" ,labhub-url)
- ("github.com" ,labhub-url))))
-
-(define* (channel-commit-hyperlink channel
- #:optional
- (commit (channel-commit channel)))
- "Return a hyperlink for COMMIT in CHANNEL, using COMMIT as the hyperlink's
-text. The hyperlink links to a web view of COMMIT, when available."
- (let* ((url (channel-url channel))
- (uri (string->uri url))
- (host (and uri (uri-host uri))))
- (if host
- (match (assoc host %vcs-web-views)
- (#f
- commit)
- ((_ template)
- (hyperlink (template url commit) commit)))
- commit)))
-
(define* (display-profile-news profile #:key concise?
current-is-newer?)
"Display what's up in PROFILE--new packages, and all that. If
@@ -559,40 +523,6 @@ true, display what would be built without actually building it."
;;; Queries.
;;;
-(define (display-profile-content profile number)
- "Display the packages in PROFILE, generation NUMBER, in a human-readable
-way and displaying details about the channel's source code."
- (display-generation profile number)
- (for-each (lambda (entry)
- (format #t " ~a ~a~%"
- (manifest-entry-name entry)
- (manifest-entry-version entry))
- (match (assq 'source (manifest-entry-properties entry))
- (('source ('repository ('version 0)
- ('url url)
- ('branch branch)
- ('commit commit)
- _ ...))
- (let ((channel (channel (name 'nameless)
- (url url)
- (branch branch)
- (commit commit))))
- (format #t (G_ " repository URL: ~a~%") url)
- (when branch
- (format #t (G_ " branch: ~a~%") branch))
- (format #t (G_ " commit: ~a~%")
- (if (supports-hyperlinks?)
- (channel-commit-hyperlink channel commit)
- commit))))
- (_ #f)))
-
- ;; Show most recently installed packages last.
- (reverse
- (manifest-entries
- (profile-manifest (if (zero? number)
- profile
- (generation-file-name profile number)))))))
-
(define (indented-string str indent)
"Return STR with each newline preceded by IDENT spaces."
(define indent-string
diff --git a/guix/scripts/system/reconfigure.scm b/guix/scripts/system/reconfigure.scm
index 2f9dbb2508..77a72307b4 100644
--- a/guix/scripts/system/reconfigure.scm
+++ b/guix/scripts/system/reconfigure.scm
@@ -5,7 +5,7 @@
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2019 Christopher Baines <mail@cbaines.net>
-;;; Copyright © 2019 Jakob L. Kreuze <zerodaysfordays@sdf.lonestar.org>
+;;; Copyright © 2019 Jakob L. Kreuze <zerodaysfordays@sdf.org>
;;;
;;; This file is part of GNU Guix.
;;;
diff --git a/guix/swh.scm b/guix/swh.scm
index 3abf9aa1b5..8bdf9965f6 100644
--- a/guix/swh.scm
+++ b/guix/swh.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -39,7 +39,6 @@
request-rate-limit-reached?
origin?
- origin-id
origin-type
origin-url
origin-visits
@@ -247,7 +246,6 @@ FALSE-IF-404? is true, return #f upon 404 responses."
;; <https://archive.softwareheritage.org/api/1/origin/https://github.com/guix-mirror/guix/get>
(define-json-mapping <origin> make-origin origin?
json->origin
- (id origin-id)
(visits-url origin-visits-url "origin_visits_url")
(type origin-type)
(url origin-url))
diff --git a/guix/ui.scm b/guix/ui.scm
index a47dafecd4..dce97fb7b9 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -771,7 +771,7 @@ directories:~{ ~a~}~%")
(display-hint (condition-fix-hint c))
(exit 1))
- ;; On Guile 3.0.0, exceptions such as 'unbound-variable' come are
+ ;; On Guile 3.0.0, exceptions such as 'unbound-variable' are
;; compound and include a '&message'. However, that message only
;; contains the format string. Thus, special-case it here to
;; avoid displaying a bare format string.