Commit 58db5fc5 authored by Eric Timmons's avatar Eric Timmons

Fix bug where newly downloaded releases get the value T instead of a release object

parent 054b5fe6
......@@ -120,8 +120,20 @@ project-index and system-index files are read to instantiate the objects."))
object, otherwise error."
(unless (typep (index-object-store index) 'dual-object-store)
(error 'project-missing-version :version release :project project))
(dual-object-store-update-object (index-object-store index)
(project-releases-path project)))
(let ((offset (dual-object-store-update-object (index-object-store index)
(project-releases-path project))))
(cond
((numberp offset)
(with-open-object-stream (s (index-object-store index) (project-releases-path project)
:offset offset)
(project-load-releases-from-stream! project s))
t)
(offset
(with-open-object-stream (s (index-object-store index) (project-releases-path project))
(project-load-releases-from-stream! project s))
t)
(t
nil))))
(defmethod index-save ((index index))
(dolist (p (index-projects index))
......
......@@ -44,13 +44,14 @@ older than 60 minutes old."))
(let* ((primary (dual-object-store-primary object-store))
(secondary (dual-object-store-secondary object-store)))
(if (path-appendable-p path)
(with-open-object-stream (primary-stream primary path
:binary-p t
:offset (object-size secondary path)
:if-does-not-exist nil)
(when primary-stream
(object-append secondary path primary-stream)
t))
(let ((offset (object-size secondary path)))
(with-open-object-stream (primary-stream primary path
:binary-p t
:offset offset
:if-does-not-exist nil)
(when primary-stream
(object-append secondary path primary-stream)
offset)))
(with-open-object-stream (s primary path
:if-does-not-exist nil)
(when s
......
......@@ -138,10 +138,18 @@ instantiated."))
(release
(values release t))
(error
(values (index-release-data-missing (index project) project version) t))
(when (index-release-data-missing (index project) project version)
(let ((release (gethash version (project-release-ht project))))
(if release
(values release t)
(error 'project-missing-version :project project :version version)))))
(t
(handler-case
(index-release-data-missing (index project) project version)
(when (index-release-data-missing (index project) project version)
(let ((release (gethash version (project-release-ht project))))
(if release
(values release t)
(values nil t))))
(project-missing-version () (values nil t)))))))
(defmethod project-releases ((project project))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment