From: Phil Hagelberg Date: Sat, 28 Jan 2012 09:49:29 +0000 (+0800) Subject: Fix M-x package-install failure if no archive has been fetched yet. X-Git-Tag: emacs-pretest-24.0.93~29 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=70550acf88e5d7083d3aa83d201a8a7ebc3ba4b6;p=emacs.git Fix M-x package-install failure if no archive has been fetched yet. * emacs-lisp/package.el (package-install): Run package-refresh-contents if there is no archive yet. Fixes: debbugs:97978 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 887959d2fe0..896f7ce9a97 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-01-28 Phil Hagelberg + + * emacs-lisp/package.el (package-install): Run + package-refresh-contents if there is no archive yet (Bug#97978). + 2012-01-28 Chong Yidong * emacs-lisp/package.el (package-maybe-load-descriptor): New diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 7e56c5534ec..317fa1fd23d 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -889,6 +889,8 @@ archive in `package-archives'. Interactively, prompt for NAME." ;; symbols for completion. (unless package--initialized (package-initialize t)) + (unless package-archive-contents + (package-refresh-contents)) (list (intern (completing-read "Install package: " (mapcar (lambda (elt)