gnu: r-wgcna: Move to (gnu packages bioconductor).
[jackhill/guix/guix.git] / build-aux / update-guix-package.scm
index d45c183..f695e91 100644 (file)
@@ -1,5 +1,5 @@
 ;;; 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.
 ;;;
@@ -112,7 +112,8 @@ COMMIT."
                                       #: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
@@ -124,10 +125,20 @@ 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
+                              (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))))