Commit b2815bc1 authored by Gary King's avatar Gary King
Browse files

Robustified *asdf-revision* detection

parent 13807b4e
;;; This is asdf: Another System Definition Facility. Revision: @@VERSION@@ ;;; This is asdf: Another System Definition Facility.
;;; hash - $Format:%H$ ;;; hash - $Format:%H$
;;; ;;;
;;; Feedback, bug reports, and patches are all welcome: please mail to ;;; Feedback, bug reports, and patches are all welcome: please mail to
...@@ -120,16 +120,25 @@ ...@@ -120,16 +120,25 @@
(in-package #:asdf) (in-package #:asdf)
(defvar *asdf-revision* (defvar *asdf-revision*
;; find first tag that looks like /tags/[0-9]*\.[0-9]*. E.g., /tags/1.34
;; return nil or a list of the major and minor version numbers
(let* ((v "$Format:%d$") (let* ((v "$Format:%d$")
(to-find "tags/") (to-find "tags/")
(tags (search to-find v :test #'char=))) (start 0))
(when (and v tags) (when v
(let ((dot (position #\. v :start tags))) (loop for tag-start = (search to-find v :test #'char= :start2 start)
(when dot while tag-start do
(list (parse-integer v :start (+ tags (length to-find)) (when tag-start
:junk-allowed t) (let ((dot (position #\. v :start tag-start))
(parse-integer v :start (1+ dot) (space (position #\space v :start tag-start)))
:junk-allowed t))))))) (when (and dot (or (not space) (< dot space)))
;; success
(return
(list (parse-integer v :start (+ tag-start (length to-find))
:junk-allowed t)
(parse-integer v :start (1+ dot)
:junk-allowed t))))
(setf start (1+ tag-start))))))))
(defvar *compile-file-warnings-behaviour* :warn) (defvar *compile-file-warnings-behaviour* :warn)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment