aboutsummaryrefslogtreecommitdiff
path: root/guix-download.in
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-11-08 00:25:26 +0100
committerLudovic Courtès <ludo@gnu.org>2012-11-08 00:25:26 +0100
commita3aa25f83dedc39966821eb14c8c3847c242af6c (patch)
treeb248ceb87008b148a5a6c546a6609e423bb71ba2 /guix-download.in
parent37d19403e78e8dfab24a471bee7c8ee17346e43c (diff)
downloadgnu-guix-a3aa25f83dedc39966821eb14c8c3847c242af6c.tar
gnu-guix-a3aa25f83dedc39966821eb14c8c3847c242af6c.tar.gz
guix-download: Print the hash of the file's contents, no that of the path.
* guix-download.in (guix-download): Display the hash of the contents of PATH, not the path hash. Also, call `add-to-store' with FIXED? = #t.
Diffstat (limited to 'guix-download.in')
-rw-r--r--guix-download.in10
1 files changed, 5 insertions, 5 deletions
diff --git a/guix-download.in b/guix-download.in
index 44118c9e3f..8a3c2c4100 100644
--- a/guix-download.in
+++ b/guix-download.in
@@ -173,9 +173,9 @@ Report bugs to: ~a.~%") "@PACKAGE_BUGREPORT@"))
(fetch uri port)
(close port)
(add-to-store store (basename (uri-path uri))
- #f #f "sha256" name))))
- (fmt (assq-ref opts 'format)))
- (format #t "~a~%~a~%"
- path
- (fmt (query-path-hash store path)))
+ #t #f "sha256" name))))
+ (hash (call-with-input-file path
+ (compose sha256 get-bytevector-all)))
+ (fmt (assq-ref opts 'format)))
+ (format #t "~a~%~a~%" path (fmt hash))
#t))