mirror of
https://github.com/correl/melpa.git
synced 2025-04-10 17:00:08 -09: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'
|
Do not use this directly. Use `package-build-recipe-alist'
|
||||||
function.")
|
function.")
|
||||||
|
|
||||||
|
(defvar pb/recipe-alist-initialized nil
|
||||||
|
"Determines if `pb/recipe-alist` has been initialized.")
|
||||||
|
|
||||||
(defvar pb/archive-alist nil
|
(defvar pb/archive-alist nil
|
||||||
"Internal list of already-built packages, in the standard package.el format.
|
"Internal list of already-built packages, in the standard package.el format.
|
||||||
|
|
||||||
Do not use this directly. Use `package-build-archive-alist'
|
Do not use this directly. Use `package-build-archive-alist'
|
||||||
function for access to this function")
|
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")
|
(defconst pb/default-files-spec '("*.el" "dir" "*.info")
|
||||||
"Default value for :files attribute in recipes.")
|
"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 ()
|
(defun package-build-recipe-alist ()
|
||||||
"Retun the list of avalailable packages."
|
"Retun the list of avalailable packages."
|
||||||
(or pb/recipe-alist
|
(unless pb/recipe-alist-initialized
|
||||||
(setq pb/recipe-alist (pb/read-recipes-ignore-errors))))
|
(setq pb/recipe-alist (pb/read-recipes-ignore-errors)
|
||||||
|
pb/recipe-alist-initialized t))
|
||||||
|
pb/recipe-alist)
|
||||||
|
|
||||||
(defun package-build-archive-alist-remove (elt)
|
(defun package-build-archive-alist-remove (elt)
|
||||||
"Remove ELT from the archive list using `remove' and return the new value."
|
"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 ()
|
(defun package-build-archive-alist ()
|
||||||
"Return the archive list."
|
"Return the archive list."
|
||||||
(or pb/archive-alist
|
(unless pb/archive-alist-initialized
|
||||||
(setq pb/archive-alist
|
(setq pb/archive-alist
|
||||||
(cdr (pb/read-from-file
|
(cdr (pb/read-from-file
|
||||||
(expand-file-name "archive-contents"
|
(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 ()
|
(defun package-build-reinitialize ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(setq pb/recipe-alist nil
|
(setq pb/recipe-alist-initialized nil
|
||||||
pb/archive-alist nil))
|
pb/archive-alist-initialized nil))
|
||||||
|
|
||||||
|
|
||||||
;; Utility functions
|
;; Utility functions
|
||||||
|
|
Loading…
Add table
Reference in a new issue