Take sha1 of buffer contents, not buffer

This prevents the sha1 function from attempting and then failing to
encode the buffer contents in the wrong encoding.

* methods/el-get-http.el (el-get-http-compute-checksum): Call `sha1' on
  result of `buffer-string', not `current-buffer'.
This commit is contained in:
Noam Postavsky 2014-11-19 22:30:43 -05:00
parent 6d213db41e
commit 42cc1e3a98

View File

@ -77,7 +77,9 @@ into the package :localname option or its `file-name-nondirectory' part."
"Compute SHA1 of PACKAGE."
(with-temp-buffer
(insert-file-contents-literally (el-get-http-dest-filename package url))
(sha1 (current-buffer))))
;; Note: don't pass buffer object, `sha1' tries (and sometimes
;; fails) to encode it.
(sha1 (buffer-string))))
(defun el-get-http-guess-website (package)
(plist-get (el-get-package-def package) :url))