~ruther/guix-local

c0ff1be86c786a54b89b3ecd01f3cb65dddf0b0b — Nicolas Graves 6 months ago bd2470c
import: utils: Add default-git-error.

* guix/import/utils.scm (default-git-error): Add procedure.

Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
1 files changed, 15 insertions(+), 0 deletions(-)

M guix/import/utils.scm
M guix/import/utils.scm => guix/import/utils.scm +15 -0
@@ 32,6 32,7 @@
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (guix import utils)
  #:autoload   (git structs) (git-error-message)
  #:use-module (guix base32)
  #:use-module ((guix build download) #:prefix build:)
  #:use-module ((gcrypt hash) #:hide (sha256))


@@ 40,6 41,7 @@
  #:use-module (guix utils)
  #:use-module (guix packages)
  #:use-module (guix deprecation)
  #:use-module (guix diagnostics)
  #:use-module (guix discovery)
  #:use-module (guix build-system)
  #:use-module (guix git)


@@ 75,6 77,7 @@
            download-git-repository
            git-origin
            git->origin
            default-git-error

            package-names->package-inputs
            maybe-inputs


@@ 222,6 225,18 @@ be a procedure with a 'body property, used to generate the origin sexp."
                (values #f #f #f))))
    (values (git-origin url (peek-body proc) hash) directory)))

(define (default-git-error home-page)
  "Return a procedure to be passed to a `git-error' `catch' for HOME-PAGE."
  (match-lambda*
    (('git-error error)
     (warning location
              (G_ "failed to download Git repository ~a: ~a~%")
              home-page
              (git-error-message error))
     #f)
    (_
     #f)))

(define %spdx-license-identifiers
  ;; https://spdx.org/licenses/
  ;; The gfl1.0, nmap, repoze