Declare the build and archive alist vars early, and initialize them later.

This keeps the byte-compilation process happier, and allows melpa
developers to reload the pkglist file using "M-x package-build-initialize"
This commit is contained in:
Steve Purcell 2012-02-03 14:46:55 +00:00
parent e65a8fc0b0
commit f31edc2997

View file

@ -63,6 +63,13 @@
:group 'package-build
:type 'string)
(defvar package-build-alist nil
"List of package build specs.")
(defvar package-build-archive-alist nil
"List of already-built packages, in the standard package.el format.")
(defun package-build-find-parse-time (regex)
"Find REGEX in current buffer and format as a proper time version."
(format-time-string
@ -334,15 +341,6 @@ If PKG-INFO is nil, an empty one is created."
(defvar package-build-alist
(package-build-read-from-file package-build-alist-file)
"List of package build specs.")
(defvar package-build-archive-alist
(cdr (package-build-read-from-file
(expand-file-name "archive-contents" package-build-archive-dir)))
"List of already-built packages, in the standard package.el format.")
(defun package-build-dump-archive-contents ()
"Dump the list of built packages back to the archive-contents file."
(package-build-dump (cons 1 package-build-archive-alist)
@ -367,4 +365,16 @@ If PKG-INFO is nil, an empty one is created."
desc
type)))))
(defun package-build-initialize ()
"Load the pkglist and archive-contents files."
(interactive)
(setq
package-build-alist (package-build-read-from-file package-build-alist-file)
package-build-archive-alist (cdr (package-build-read-from-file
(expand-file-name "archive-contents"
package-build-archive-dir)))))
(package-build-initialize)
;;; package-build.el ends here