show installed versions when 'ros use asdf'

This commit is contained in:
SANO Masatoshi 2017-06-22 15:32:58 +09:00
parent 56db252e25
commit 7c0d4e3603

View file

@ -10,7 +10,24 @@
(asdf (config "asdf.version"))) (asdf (config "asdf.version")))
(format s (if (zerop (length asdf)) (format s (if (zerop (length asdf))
"ASDF version is not specified.~%" "ASDF version is not specified.~%"
"choosen version is ~S~%") asdf)) "choosen version is ~S~%") asdf)
(format s "Version Candidates:~%no~%~{~A~%~}"
(sort (mapcar (lambda (x) (car (last (pathname-directory x))) )
(directory (merge-pathnames (format nil "lisp/asdf/*/") (homedir))))
(lambda (a b)
(loop for a- = a then (cdr a-)
for b- = b then (cdr b-)
for x = (car a-) for y = (car b-)
do (cond ((null x) (return nil))
((null y) (return t))
((> x y) (return t))
((< x y) (return nil)))))
:key (lambda (x)
(loop
for p = (position #\. x)
collect (parse-integer (subseq x 0 p))
while p
do (setq x (subseq x (1+ p))))))))
t) t)
((member version '("no" "-") :test 'equal) ((member version '("no" "-") :test 'equal)
(setf (config "asdf.version") nil) (setf (config "asdf.version") nil)