mirror of
https://github.com/correl/melpa.git
synced 2024-11-14 19:19:32 +00:00
add initialization variables for the internal lists since they can be nil
This commit is contained in:
parent
13e16af340
commit
27a8d21c6f
1 changed files with 19 additions and 9 deletions
|
@ -71,12 +71,18 @@
|
|||
Do not use this directly. Use `package-build-recipe-alist'
|
||||
function.")
|
||||
|
||||
(defvar pb/recipe-alist-initialized nil
|
||||
"Determines if `pb/recipe-alist` has been initialized.")
|
||||
|
||||
(defvar pb/archive-alist nil
|
||||
"Internal list of already-built packages, in the standard package.el format.
|
||||
|
||||
Do not use this directly. Use `package-build-archive-alist'
|
||||
function for access to this function")
|
||||
|
||||
(defvar pb/archive-alist-initialized nil
|
||||
"Determines if pb/archive-alist has been initialized.")
|
||||
|
||||
(defconst pb/default-files-spec '("*.el" "dir" "*.info")
|
||||
"Default value for :files attribute in recipes.")
|
||||
|
||||
|
@ -897,8 +903,10 @@ FILES is a list of (SOURCE . DEST) relative filepath pairs."
|
|||
|
||||
(defun package-build-recipe-alist ()
|
||||
"Retun the list of avalailable packages."
|
||||
(or pb/recipe-alist
|
||||
(setq pb/recipe-alist (pb/read-recipes-ignore-errors))))
|
||||
(unless pb/recipe-alist-initialized
|
||||
(setq pb/recipe-alist (pb/read-recipes-ignore-errors)
|
||||
pb/recipe-alist-initialized t))
|
||||
pb/recipe-alist)
|
||||
|
||||
(defun package-build-archive-alist-remove (elt)
|
||||
"Remove ELT from the archive list using `remove' and return the new value."
|
||||
|
@ -910,16 +918,18 @@ FILES is a list of (SOURCE . DEST) relative filepath pairs."
|
|||
|
||||
(defun package-build-archive-alist ()
|
||||
"Return the archive list."
|
||||
(or pb/archive-alist
|
||||
(unless pb/archive-alist-initialized
|
||||
(setq pb/archive-alist
|
||||
(cdr (pb/read-from-file
|
||||
(expand-file-name "archive-contents"
|
||||
package-build-archive-dir))))))
|
||||
package-build-archive-dir)))
|
||||
pb/archive-alist-initialized t))
|
||||
pb/archive-alist)
|
||||
|
||||
(defun package-build-reinitialize ()
|
||||
(interactive)
|
||||
(setq pb/recipe-alist nil
|
||||
pb/archive-alist nil))
|
||||
(setq pb/recipe-alist-initialized nil
|
||||
pb/archive-alist-initialized nil))
|
||||
|
||||
|
||||
;; Utility functions
|
||||
|
|
Loading…
Reference in a new issue