raco setup: accomodate unusual flie names in pkg-dep checking

If a source file name lacks an extension, then the pkg-step would get
confused trying to convert a ".zo" name back to a source name. The
original name is not really needed, anyway.
This commit is contained in:
Matthew Flatt 2019-09-27 06:43:53 -06:00
parent 429436fb77
commit a07e973316

View File

@ -365,7 +365,9 @@
(when (file-exists? (build-path dir zo-f)) (when (file-exists? (build-path dir zo-f))
(define base (let ([m (regexp-match #rx#"^(.*)_[^_]+[.]zo$" (define base (let ([m (regexp-match #rx#"^(.*)_[^_]+[.]zo$"
(path-element->bytes zo-f))]) (path-element->bytes zo-f))])
(and m (bytes->string/utf-8 (cadr m))))) (or (and m (bytes->string/utf-8 (cadr m)))
;; In case the original file name had no suffix:
"unknown")))
(define in-mod `(lib ,(string-join (define in-mod `(lib ,(string-join
(append (map path-element->string coll-path) (list base)) (append (map path-element->string coll-path) (list base))
"/"))) "/")))