diff options
| author | Chong Yidong | 2011-03-10 16:51:26 -0500 |
|---|---|---|
| committer | Chong Yidong | 2011-03-10 16:51:26 -0500 |
| commit | ffbf300e1e88333532721940f8416b54e47ac0e7 (patch) | |
| tree | 5a1dcdfb409f9f1df698d1e27527825a78b35def /lisp | |
| parent | f3b54b0e1e770038e9842479d88916d95f7bfa51 (diff) | |
| download | emacs-ffbf300e1e88333532721940f8416b54e47ac0e7.tar.gz emacs-ffbf300e1e88333532721940f8416b54e47ac0e7.zip | |
Fix package-strip-rcs-id to be more robust.
See http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00396.html
* lisp/emacs-lisp/package.el (package-strip-rcs-id): Accept any version
string that does not signal an error in version-to-list.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/emacs-lisp/package.el | 16 |
2 files changed, 14 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 760224f601c..0fbdd9dff76 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-03-10 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * emacs-lisp/package.el (package-strip-rcs-id): Accept any version | ||
| 4 | string that does not signal an error in version-to-list. | ||
| 5 | |||
| 1 | 2011-03-10 Michael Albinus <michael.albinus@gmx.de> | 6 | 2011-03-10 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 7 | ||
| 3 | * simple.el (delete-trailing-whitespace): Return nil for the | 8 | * simple.el (delete-trailing-whitespace): Return nil for the |
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index d90164b5a95..29089400cef 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el | |||
| @@ -848,15 +848,17 @@ The package is found on one of the archives in `package-archives'." | |||
| 848 | ;; Try to activate it. | 848 | ;; Try to activate it. |
| 849 | (package-initialize)) | 849 | (package-initialize)) |
| 850 | 850 | ||
| 851 | (defun package-strip-rcs-id (v-str) | 851 | (defun package-strip-rcs-id (str) |
| 852 | "Strip RCS version ID from the version string. | 852 | "Strip RCS version ID from the version string STR. |
| 853 | If the result looks like a dotted numeric version, return it. | 853 | If the result looks like a dotted numeric version, return it. |
| 854 | Otherwise return nil." | 854 | Otherwise return nil." |
| 855 | (if v-str | 855 | (when str |
| 856 | (if (string-match "^[ \t]*[$]Revision:[ \t]\([0-9.]+\)[ \t]*[$]$" v-str) | 856 | (when (string-match "\\`[ \t]*[$]Revision:[ \t]+" str) |
| 857 | (match-string 1 v-str) | 857 | (setq str (substring str (match-end 0)))) |
| 858 | (if (string-match "^[0-9.]*$" v-str) | 858 | (condition-case nil |
| 859 | v-str)))) | 859 | (if (version-to-list str) |
| 860 | str) | ||
| 861 | (error nil)))) | ||
| 860 | 862 | ||
| 861 | (defun package-buffer-info () | 863 | (defun package-buffer-info () |
| 862 | "Return a vector describing the package in the current buffer. | 864 | "Return a vector describing the package in the current buffer. |