From 59a16275189f55ddd692b0ea5b415c706fa1fd69 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 28 Jul 2017 17:38:19 +0200 Subject: pull: Fetch source code from Git. * guix/scripts/pull.scm (%snapshot-url, with-environment-variable) (with-PATH): Remove. (ensure-guile-git!): New procedure. (%repository-url): New variable. (%default-options): Add 'repository-url' and 'ref'. (show-help, %options): Add '--commit' and '--url'. (temporary-directory, first-directory, interned-then-deleted) (unpack): Remove. (build-from-source): Rename 'tarball' to 'source'. Remove call to 'unpack'. (build-and-install): Rename 'tarball' to 'source'. (honor-lets-encrypt-certificates!, report-git-error): New procedures. (with-git-error-handling): New macro. (guix-pull)[fetch-tarball]: Remove. Wrap body in 'with-git-error-handling'. Rewrite to use 'latest-repository-commit'. * build-aux/build-self.scm (build): Print an error message and exit when GUILE-GIT is #f. * doc/guix.texi (Invoking guix pull): Mention Git. Document '--commit' and '--branch'. --- build-aux/build-self.scm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'build-aux/build-self.scm') diff --git a/build-aux/build-self.scm b/build-aux/build-self.scm index 8fb9af23ca..4933e02712 100644 --- a/build-aux/build-self.scm +++ b/build-aux/build-self.scm @@ -224,6 +224,23 @@ files." (current-error-port) (%make-void-port "w"))))) + (unless guile-git + ;; XXX: Guix before February 2017 lacks a 'guile-git' package altogether. + ;; If we try to upgrade anyway, the logic in (guix scripts pull) will not + ;; build (guix git), which will leave us with an unusable 'guix pull'. To + ;; avoid that, fail early. + (format (current-error-port) + "\ +Your installation is too old and lacks a '~a' package. +Please upgrade to an intermediate version first, for instance with: + + guix pull --url=https://git.savannah.gnu.org/cgit/guix.git/snapshot/v0.13.0.tar.gz +\n" + (match (effective-version) + ("2.0" "guile2.0-git") + (_ "guile-git"))) + (exit 1)) + (mlet %store-monad ((guile (guile-for-build))) (gexp->derivation "guix-latest" builder #:modules '((guix build pull) -- cgit v1.2.3