From f31edc299757fecc09472c3aaa411132f89e41d7 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Fri, 3 Feb 2012 14:46:55 +0000 Subject: [PATCH] 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" --- package-build.el | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/package-build.el b/package-build.el index 6f9dd80e..c7ab7d62 100644 --- a/package-build.el +++ b/package-build.el @@ -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