emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r103619: Fix package-strip-rcs-id to


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103619: Fix package-strip-rcs-id to be more robust.
Date: Thu, 10 Mar 2011 16:51:26 -0500
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 103619
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Thu 2011-03-10 16:51:26 -0500
message:
  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.
modified:
  lisp/ChangeLog
  lisp/emacs-lisp/package.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-03-10 11:28:33 +0000
+++ b/lisp/ChangeLog    2011-03-10 21:51:26 +0000
@@ -1,3 +1,8 @@
+2011-03-10  Chong Yidong  <address@hidden>
+
+       * emacs-lisp/package.el (package-strip-rcs-id): Accept any version
+       string that does not signal an error in version-to-list.
+
 2011-03-10  Michael Albinus  <address@hidden>
 
        * simple.el (delete-trailing-whitespace): Return nil for the

=== modified file 'lisp/emacs-lisp/package.el'
--- a/lisp/emacs-lisp/package.el        2011-03-08 17:11:19 +0000
+++ b/lisp/emacs-lisp/package.el        2011-03-10 21:51:26 +0000
@@ -848,15 +848,17 @@
   ;; Try to activate it.
   (package-initialize))
 
-(defun package-strip-rcs-id (v-str)
-  "Strip RCS version ID from the version string.
+(defun package-strip-rcs-id (str)
+  "Strip RCS version ID from the version string STR.
 If the result looks like a dotted numeric version, return it.
 Otherwise return nil."
-  (if v-str
-      (if (string-match "^[ \t]*[$]Revision:[ \t]\([0-9.]+\)[ \t]*[$]$" v-str)
-         (match-string 1 v-str)
-       (if (string-match "^[0-9.]*$" v-str)
-           v-str))))
+  (when str
+    (when (string-match "\\`[ \t]*[$]Revision:[ \t]+" str)
+      (setq str (substring str (match-end 0))))
+    (condition-case nil
+       (if (version-to-list str)
+           str)
+      (error nil))))
 
 (defun package-buffer-info ()
   "Return a vector describing the package in the current buffer.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]