Skip to content

Commit 0847453

Browse files
committed
Add digests to the mock dist.
These can't actually be used - has to be done at the other end, when publishing the dist.
1 parent e19fd4c commit 0847453

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

indexes.lisp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,22 @@ true. If there's a SHA1 mismatch, signal an error."
216216
(store "distinfo-subscription-url"
217217
(distinfo-subscription-url distinfo))))))
218218

219+
(defun file-sha256 (file)
220+
(string-downcase
221+
(ironclad:byte-array-to-hex-string
222+
(ironclad:digest-file :sha256 file))))
223+
224+
(defun write-release-digests (dist output-file)
225+
(with-open-file (stream output-file :direction :output)
226+
(format stream "# key sha256~%")
227+
(dolist (release (provided-releases dist))
228+
(let* ((file (ql-dist:local-archive-file release))
229+
(sha256 (file-sha256 file)))
230+
(format stream "release/~A ~A~%"
231+
(ql-dist:name release)
232+
sha256))))
233+
(probe-file output-file))
234+
219235
(defun upload-distinfo (distinfo)
220236
(let ((sysindex #p"quicklisp-controller:tmp;systems.txt")
221237
(relindex #p"quicklisp-controller:tmp;releases.txt")
@@ -245,7 +261,8 @@ true. If there's a SHA1 mismatch, signal an error."
245261
(map-sources
246262
(lambda (source)
247263
(let ((tarball (ensure-cached-release-tarball source)))
248-
(copy tarball #p"archives/"))))))
264+
(copy tarball #p"archives/"))))
265+
(write-release-digests (dist name) "digests.txt")))
249266

250267
(defun mail-mock-report ()
251268
(if *report-to-email*

0 commit comments

Comments
 (0)