-2013-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
+2013-12-14 Tom Willemse <tom@ryuslash.org> (tiny change)
+
+ * emacs-lisp/package.el (package--prepare-dependencies): New function.
+ (package-buffer-info): Use it (bug#15108).
* icomplete.el (icomplete-completions): Make sure the prefix is already
displayed elsewhere before hiding it.
(declare-function lm-homepage "lisp-mnt" (&optional file))
+(defun package--prepare-dependencies (deps)
+ "Turn DEPS into an acceptable list of dependencies.
+
+Any parts missing a version string get a default version string
+of \"0\" (meaning any version) and an appropriate level of lists
+is wrapped around any parts requiring it."
+ (cond
+ ((not (listp deps))
+ (error "Invalid requirement specifier: %S" deps))
+ (t (mapcar (lambda (dep)
+ (cond
+ ((symbolp dep) `(,dep "0"))
+ ((stringp dep)
+ (error "Invalid requirement specifier: %S" dep))
+ (t dep)))
+ deps))))
+
(defun package-buffer-info ()
"Return a `package-desc' describing the package in the current buffer.
"Package lacks a \"Version\" or \"Package-Version\" header"))
(package-desc-from-define
file-name pkg-version desc
- (if requires-str (package-read-from-string requires-str))
+ (if requires-str
+ (package--prepare-dependencies
+ (package-read-from-string requires-str)))
:kind 'single
:url homepage))))