> For tagged eggs, the version number is the name of the most
> recently-added tag (correct)?
No. The version number is the greatest string sorting them as a human
would compare version numbers (eg. 1.12 is greater than 1.9.2, and the
date in which they were added is not relevant). There is an
exception: if the Subversion property "latest" is set in the tags/
directory, it takes precedence.
The specific logic (which I implemented a long time ago) is this:
(define (version-string->numbers string)
(map string->number (string-split string ".")))
(define (version-numbers> a b)
(and (not (null? a))
(or (null? b)
(> (car a) (car b))
(and (= (car a) (car b))
(version-numbers> (cdr a) (cdr b))))))
(define (pick-latest-version tags-dir)
(fold
(lambda (a pick)
(let ((a-nums (version-string->numbers a)))
(if (and (every number? a-nums) ; sanity check
(version-numbers>
a-nums
(version-string->numbers pick)))
a
pick)))
""
(directory tags-dir)))
Now that I think about it, perhaps this can be optimized using the
orders egg! ;-)
Thanks! :-)
Alejo.
http://azul.freaks-unidos.net/
_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users