repair "info-cache.rktd" assumption of relative paths

Fix for 459a74455c to handle the case that a path
to record is not relative. The `raco pkg` tests
exposed the problem.
This commit is contained in:
Matthew Flatt 2017-04-09 10:41:17 -06:00
parent 50f67cf6e4
commit 016b8009c5

View File

@ -1278,10 +1278,12 @@
(let ([p (path->main-lib-relative (cc-path cc))])
(if (path? p)
;; Fall back to relative (with ".."s) to info root:
(encode-relative-path
(find-relative-path (cc-info-root cc)
p
#:more-than-root? #t))
(let ([rp (find-relative-path (cc-info-root cc)
p
#:more-than-root? #t)])
(if (relative-path? rp)
(encode-relative-path rp)
(path->bytes rp)))
p))]
[else (path->bytes (cc-path cc))])
(cons (domain) (cc-shadowing-policy cc)))))