Skip to content

Commit

Permalink
Prevent errors when migrating status file
Browse files Browse the repository at this point in the history
Previously, if a package is listed as installed but it doesn't have a
recipe available, then status file migration would fail with an error
because it requires a recipe to save into the new status format. Now,
when this occurs, it just saves a "dummy" recipe that does nothing
instead. This does not result in any loss of functionality, since
without an available recipe the package in question is unusable
anyway.
  • Loading branch information
DarwinAwardWinner committed Jun 19, 2012
1 parent 1ec4d9e commit 7256607
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions el-get-status.el
Expand Up @@ -85,10 +85,18 @@
(loop for (p s) on ps by 'cddr
for psym = (el-get-package-symbol p)
when psym
collect (cons psym
(list 'status s
'recipe (when (string= s "installed")
(el-get-package-def psym))))))))
collect
(cons psym
(list 'status s
'recipe (when (string= s "installed")
(condition-case nil
(el-get-package-def psym)
;; If the recipe is not
;; available any more,
;; just provide a
;; placeholder no-op
;; recipe.
(error `(:name ,psym :type builtin))))))))))

(defun el-get-package-status-alist (&optional package-status-alist)
"return an alist of (PACKAGE . STATUS)"
Expand Down

0 comments on commit 7256607

Please sign in to comment.