raco dist: preserve relative location of runtime files only within a package

Previously, relative locations were preserved for all files with the same
root, but that tends to keep too much information about the original
filesystem layout, especially when runtime files are pulled both from
the installation and a user-specific area. Since packages can be installed
at different relative locations, it makes sense to preserve relative
locations only up to package boundaries.

original commit: 5c909cca0d
This commit is contained in:
Matthew Flatt 2014-04-30 14:36:33 -06:00
parent 79a884aa43
commit 38f585181e
4 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,12 @@
#lang scheme/base
(require scheme/runtime-path)
;; Check that relative paths are preserved:
(define-runtime-path f1 "embed-me1f1.rktl")
(define-runtime-path f2 "sub/embed-me1f2.rktl")
(with-output-to-file "stdout"
(lambda () (parameterize ([current-namespace (make-base-namespace)])
(load f1)))
#:exists 'append)

View File

@ -0,0 +1 @@
(load-relative "sub/embed-me1f2.rktl")

View File

@ -0,0 +1 @@
(printf "This is 1f\n")

View File

@ -236,6 +236,7 @@
(one-mz-test "embed-me1c.rkt" "This is 1c\n" #f) (one-mz-test "embed-me1c.rkt" "This is 1c\n" #f)
(one-mz-test "embed-me1d.rkt" "This is 1d\n" #f) (one-mz-test "embed-me1d.rkt" "This is 1d\n" #f)
(one-mz-test "embed-me1e.rkt" "This is 1e\n" #f) (one-mz-test "embed-me1e.rkt" "This is 1e\n" #f)
(one-mz-test "embed-me1f.rkt" "This is 1f\n" #f)
(one-mz-test "embed-me2.rkt" "This is 1\nThis is 2: #t\n" #t) (one-mz-test "embed-me2.rkt" "This is 1\nThis is 2: #t\n" #t)
(one-mz-test "embed-me13.rkt" "This is 14\n" #f) (one-mz-test "embed-me13.rkt" "This is 14\n" #f)
(one-mz-test "embed-me14.rkt" "This is 14\n" #f) (one-mz-test "embed-me14.rkt" "This is 14\n" #f)