el-get-issue-672.el 1.09 KB
Newer Older
Ryan C. Thompson's avatar
Ryan C. Thompson committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
;; https://github.com/dimitri/el-get/issues/672
;;
;; Status file migration fails with removed and unavailable recipe

;; Just install some package to make sure el-get creates the
;; appropriate directories
(setq el-get-sources
      (list '(:name a
                    :type builtin))
      debug-on-error t)
(el-get-install 'a)

;; Set up the status file with a removed package that has no current
;; recipe available.
(with-temp-buffer
16
  (insert (el-get-print-to-string
Ryan C. Thompson's avatar
Ryan C. Thompson committed
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
           '(:nonexistent-package "removed")))
  (write-file el-get-status-file))

;; Now try to read the status file. Without a fix, it will try to read
;; the recipe for "nonexistent-package" and fail, throwing an error.
(el-get-read-status-file)

;; Try to write package's status as "removed", which will also convert
;; the status file to the new format. Without a fix, it will again try
;; and fail to find the nonexistent recipe.
(el-get-save-package-status 'nonexistent-package "removed")

;; Now the list of package status recipes should be nil because no
;; packages are installed.
(assert (equal (el-get-package-status-recipes) nil) nil)