;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
#:select? version-controlled?))
(hash (query-path-hash store source))
(location (package-definition-location))
- (old-hash (origin-sha256 (package-source guix))))
+ (old-hash (content-hash-value
+ (origin-hash (package-source guix)))))
(edit-expression location
(update-definition commit hash
#:old-hash old-hash
;; 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
+ (string-append (getcwd) "/" 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))))