summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-06-13 16:45:54 +0200
committerLudovic Courtès <ludo@gnu.org>2012-06-13 16:45:54 +0200
commitbcdd83ec69cb818c0a809ca03b1297e9725ad95b (patch)
tree6a6b87e489c0fdc3c22e168cdc46a9751889acdf
parent224f7ad6a3627df538a345ae3d3e8dd3494ecab2 (diff)
downloadguix-bcdd83ec69cb818c0a809ca03b1297e9725ad95b.tar.gz
Fix the order of the derivation's sources in `derivation-hash'.
* guix/derivations.scm (derivation-hash): Sort SOURCES alphabetically as
  well.
-rw-r--r--guix/derivations.scm27
1 files changed, 14 insertions, 13 deletions
diff --git a/guix/derivations.scm b/guix/derivations.scm
index 9f5ab16d6d..22d8d91f09 100644
--- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -240,19 +240,20 @@ in SIZE bytes."
        ;; derivation.  Note: inputs are sorted as in the order of their hex
        ;; hash representation because that's what the C++ `std::map' code
        ;; does.
-       (let* ((inputs (sort (map (match-lambda
-                                  (($ <derivation-input> path sub-drvs)
-                                   (let ((hash (call-with-input-file path
-                                                 (compose bytevector->base16-string
-                                                          derivation-hash
-                                                          read-derivation))))
-                                     (make-derivation-input hash sub-drvs))))
-                                 inputs)
-                            (lambda (i1 i2)
-                              (string<? (derivation-input-path i1)
-                                        (derivation-input-path i2)))))
-              (drv    (make-derivation outputs inputs sources
-                                       system builder args env-vars)))
+       (let* ((inputs  (sort (map (match-lambda
+                                   (($ <derivation-input> path sub-drvs)
+                                    (let ((hash (call-with-input-file path
+                                                  (compose bytevector->base16-string
+                                                           derivation-hash
+                                                           read-derivation))))
+                                      (make-derivation-input hash sub-drvs))))
+                                  inputs)
+                             (lambda (i1 i2)
+                               (string<? (derivation-input-path i1)
+                                         (derivation-input-path i2)))))
+              (sources (sort sources string<?))
+              (drv     (make-derivation outputs inputs sources
+                                        system builder args env-vars)))
          (sha256
           (string->utf8 (call-with-output-string
                          (cut write-derivation drv <>))))))))))