From 78e473f01716bc22a81a13f862e5082be043fd31 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 3 May 2015 17:11:58 -0700 Subject: [PATCH] always adjust `catalogs` configuration elements Pathnames in the list need to be made absolute "file://" URLs, even if the list has no #f element to splice the default catalog. --- racket/collects/pkg/private/config.rkt | 32 ++++++++++++-------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/racket/collects/pkg/private/config.rkt b/racket/collects/pkg/private/config.rkt index f41215f1bb..4cef87506b 100644 --- a/racket/collects/pkg/private/config.rkt +++ b/racket/collects/pkg/private/config.rkt @@ -67,23 +67,21 @@ [else (match k ['catalogs - (if (member #f v) - ;; Replace #f with default URLs, relative path - ;; with absolute path: - (apply append (for/list ([i (in-list v)]) - (cond - [(not i) (get-default)] - [(regexp-match? #rx"^[a-z]+://" i) - (list i)] - [else - ;; If it doesn't look like a URL, then treat it as - ;; a path (potentially relative to the configuration file): - (list - (url->string - (path->url - (simple-form-path - (path->complete-path i (path->complete-path (pkg-dir #t)))))))]))) - v)] + ;; Replace #f with default URLs, relative path + ;; with absolute path: + (apply append (for/list ([i (in-list v)]) + (cond + [(not i) (get-default)] + [(regexp-match? #rx"^[a-z]+://" i) + (list i)] + [else + ;; If it doesn't look like a URL, then treat it as + ;; a path (potentially relative to the configuration file): + (list + (url->string + (path->url + (simple-form-path + (path->complete-path i (path->complete-path (pkg-dir #t)))))))])))] [_ v])])) (define (update-pkg-cfg! key val)