File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ starting storage block in STREAM, and the total file size."
127127 until (= byte (char-code #\Newline ))
128128 do (write-char (code-char byte ) string ))))
129129
130- (defun content-hash (tarfile)
130+ (defun content-hash (tarfile &optional content-info-processor )
131131 " Return a hash string of TARFILE. The hash is computed by creating
132132the digest of the files in TARFILE in order of their name."
133133 (uiop :with-temporary-file (:pathname temp)
@@ -150,7 +150,10 @@ the digest of the files in TARFILE in order of their name."
150150 (read-sequence buffer stream )
151151 (write-sequence buffer digest-stream :end partial))))
152152 (let ((contents (content-info stream )))
153- (setf contents (sort contents #' string< :key #' first ))
153+ (setf contents
154+ (if content-info-processor
155+ (funcall content-info-processor contents)
156+ contents))
154157 (dolist (info contents)
155158 (destructuring-bind (position size)
156159 (rest info)
Original file line number Diff line number Diff line change 9595 " Checks that the md5 and size of FILE are as expected from the quicklisp
9696dist."
9797 (let ((release (ql-dist :find-release name)))
98+ (unless (= (ql-dist :archive-size release) (file-size file))
99+ (error " file size mismatch for ~A " name))
98100 (unless (string-equal (ql-dist :archive-md5 release) (md5 file))
99101 (error " md5 mismatch for ~A " name))
100- (unless (string-equal (ql-dist :archive-content-sha1 release) (content-hash file))
101- (error " sha1 mismatch for ~A " name))
102- (unless (= (ql-dist :archive-size release) (file-size file))
103- (error " file size mismatch for ~A " name))))
102+ (unless (member (ql-dist :archive-content-sha1 release)
103+ (list (content-hash file (lambda (c) (sort c #' string< :key #' first )))
104+ (content-hash file #' reverse ))
105+ :test #' string-equal )
106+ (error " sha1 mismatch for ~A " name))))
104107
105108(defun register-fetch-scheme-functions ()
106109 (setf ql-http :*fetch-scheme-functions*
You can’t perform that action at this time.
0 commit comments