snow: accept "_" as version separator

$ tools/snow-chibi  implementations
    WARNING: Implementation gauche is an unsupported version,
    0.9.10_pre1, but at least 0.9.4 is required.
    cyclone
    sagittarius

The easy solution is also accept "_" as version separator and consider
"pre1" the forth component. This makes the warning go away, and I don't
think it'll affect version comparison on other schemes.
This commit is contained in:
Nguyễn Thái Ngọc Duy 2020-08-24 18:35:34 +07:00
parent e307c872bf
commit 0eb0834bbc
2 changed files with 2 additions and 1 deletions

View file

@ -57,7 +57,7 @@
(define (version-split str) (define (version-split str)
(if str (if str
(map (lambda (x) (or (string->number x) x)) (map (lambda (x) (or (string->number x) x))
(string-split str #\.)) (string-split str (string->char-set "._")))
'())) '()))
(define (version-compare a b) (define (version-compare a b)

View file

@ -11,6 +11,7 @@
(scheme write) (scheme write)
(scheme process-context) (scheme process-context)
(srfi 1) (srfi 1)
(chibi char-set)
(chibi net http) (chibi net http)
(chibi pathname) (chibi pathname)
(chibi string) (chibi string)