diff options
author | Ludovic Courtès <ludo@gnu.org> | 2017-05-09 10:42:43 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2017-05-09 12:58:42 +0200 |
commit | aa1c3a0000793873ef31f33f8aa90f5ae1ab8b8d (patch) | |
tree | e9720cbf8701b2bd16e6d0091f7dc976c234c3e0 /build-aux/update-guix-package.scm | |
parent | 59898500dda7901d5e467754f2522f883fbf68ba (diff) | |
download | guix-aa1c3a0000793873ef31f33f8aa90f5ae1ab8b8d.tar.gz |
maint: update-guix-package: Protect the checkout from GC.
* build-aux/update-guix-package.scm (main): Define 'root', and call 'add-indirect-root' to protect SOURCE from GC.
Diffstat (limited to 'build-aux/update-guix-package.scm')
-rw-r--r-- | build-aux/update-guix-package.scm | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/build-aux/update-guix-package.scm b/build-aux/update-guix-package.scm index d45c183914..9598872dfd 100644 --- a/build-aux/update-guix-package.scm +++ b/build-aux/update-guix-package.scm @@ -124,10 +124,19 @@ COMMIT." ;; on a private branch. (reload-module (resolve-module '(gnu packages package-management))) - (pk source - (add-to-store store - (origin-file-name (package-source guix)) - #t "sha256" source))))) + + (let* ((source (add-to-store store + (origin-file-name (package-source guix)) + #t "sha256" source)) + (root (store-path-package-name source))) + + ;; Add an indirect GC root for SOURCE in the current directory. + (false-if-exception (delete-file root)) + (symlink source root) + (add-indirect-root store root) + + (format #t "source code for commit ~a: ~a (GC root: ~a)~%" + commit source root))))) ((commit) ;; Automatically deduce the version and revision numbers. (main commit #f)))) |