Subject: bug#14941: [Patch] Lighten up wrt version specification

From: Tom Willemse <[email-masked]>
Date: Fri, 21 Feb 2014 00:19:42 +0100

Hey,

I said I would look at this bug and so I did. Sorry it took me so long
to undertake any action on it.

The attached merge directive/patch should take care of point #1, the
first half of #2 and point #3. Please let me know if you agree, I'll
happily fix any use cases you had in mind that still don't work.

In regard to the second half of #2, about requiring specific files,
instead of packages. How would you have package.el handle these when
downloading packages from ELPA or installing a package or file? Would
you have them skipped or would requiring a specific file prevent it from
being used in the same way? Or would the use have to make sure that file
is in their `load-path' before installing the package? What is the
use-case you have in mind?

Please let me know what you think, any comments, criticisms and
considerations would be greatly appreciated.

# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: [email-masked]
# target_branch: bzr://bzr.sv.gnu.org/emacs/trunk/
# testament_sha1: aec87ee7f2e339fadc41ed24fff80aebd511513f
# timestamp: 2014-02-20 23:52:58 +0100
# base_revision_id: [email-masked]\
#   jsvhe3qwzk6yylu5
# 
# Begin patch
=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog	2014-02-20 14:24:13 +0000
+++ lisp/ChangeLog	2014-02-20 22:49:57 +0000
@@ -1,3 +1,11 @@
+2014-02-20  Tom Willemse  <[email-masked]>
+
+	* emacs-lisp/package.el (package--prepare-dependencies): Default
+	to version "0" when no version has been specified, but a list is
+	still used.
+	(package-buffer-info): If no version header has been specified or
+	no value has been specified, default to version "0".
+
 2014-02-20  Michael Albinus  <[email-masked]>
 
 	* net/tramp.el (ls-lisp-use-insert-directory-program): Declare.

=== modified file 'lisp/emacs-lisp/package.el'
--- lisp/emacs-lisp/package.el	2014-02-12 01:20:34 +0000
+++ lisp/emacs-lisp/package.el	2014-02-20 22:49:57 +0000
@@ -1128,6 +1128,8 @@
                  ((symbolp dep) `(,dep "0"))
                  ((stringp dep)
                   (error "Invalid requirement specifier: %S" dep))
+                 ((and (listp dep) (null (cdr dep)))
+                  (list (car dep) "0"))
                  (t dep)))
               deps))))
 
@@ -1155,11 +1157,9 @@
 	   ;; probably wants us to use it.  Otherwise try Version.
 	   (pkg-version
 	    (or (package-strip-rcs-id (lm-header "package-version"))
-		(package-strip-rcs-id (lm-header "version"))))
+		(package-strip-rcs-id (lm-header "version"))
+                "0"))
            (homepage (lm-homepage)))
-      (unless pkg-version
-	(error
-	 "Package lacks a \"Version\" or \"Package-Version\" header"))
       (package-desc-from-define
        file-name pkg-version desc
        (if requires-str

# Begin bundle