raco pkg: fix dependency checking for user and shared scopes

This commit is contained in:
Matthew Flatt 2013-06-28 06:57:20 -06:00
parent 47f1b4498f
commit a89ba74f4e
4 changed files with 6 additions and 4 deletions

View File

@ -27,6 +27,7 @@
$ "racket -e '(require pkg-test2)'" =exit> 1
$ "raco pkg install test-pkgs/pkg-test2.zip" =exit> 1
$ "raco pkg install test-pkgs/pkg-test1.zip" =exit> 0
$ "raco pkg show" =exit> 0
$ "raco pkg install test-pkgs/pkg-test2.zip" =exit> 0
$ "racket -e '(require pkg-test2)'" =exit> 0
$ "racket -e '(require pkg-test2/contains-dep)'" =exit> 0

View File

@ -94,7 +94,8 @@
$ "racket -e '(require pkg-test1/a)'" =exit> 1
$ "racket -e '(require pkg/lib)' -e '(path->pkg \"test-pkgs/pkg-test1-linking\")'" =stdout> "\"pkg-test1-linking\"\n"
$ "racket -e '(require pkg/lib)' -e '(path->pkg \"test-pkgs/pkg-test1-linking/README\")'" =stdout> "\"pkg-test1-linking\"\n"
$ "racket -e '(require pkg/lib)' -e '(path->pkg \"test-pkgs\")'" =stdout> "#f\n"
$ "racket -e '(require pkg/lib)' -e '(path->pkg \"test-pkgs\")'" =stdout> "\"racket-test\"\n"
$ "racket -e '(require pkg/lib)' -e '(path->pkg (collection-file-path \"main.rkt\" \"racket\"))'" =stdout> "#f\n"
$ "cp test-pkgs/pkg-test1-staging/a.rkt test-pkgs/pkg-test1-linking/pkg-test1/a.rkt"
$ "racket -e '(require pkg-test1/a)'"
$ "rm -f test-pkgs/pkg-test1-linking/pkg-test1/a.rkt"

View File

@ -38,7 +38,7 @@
(check-equal-values? (package-source->name+type "fish" 'dir) (values "fish" 'dir))
(check-equal-values? (package-source->name+type "fish!/" 'dir) (values #f 'dir))
(check-equal? (package-source->name "http://") #f))
(check-equal? (package-source->name "http://") #f)
(check-equal-values? (package-source->name+type "http://racket-lang.org/fish.plt" #f) (values "fish" 'file-url))
(check-equal-values? (package-source->name+type "https://racket-lang.org/fish.plt" #f) (values "fish" 'file-url))

View File

@ -440,11 +440,11 @@
(values k v))]
[(shared)
(define db (read-pkg-db))
(for/fold ([ht (merge-next-pkg-dbs 'installation)]) ([(v k) (in-hash db)])
(for/fold ([ht (merge-next-pkg-dbs 'installation)]) ([(k v) (in-hash db)])
(hash-set ht k v))]
[(user)
(define db (read-pkg-db))
(for/fold ([ht (merge-next-pkg-dbs 'shared)]) ([(v k) (in-hash db)])
(for/fold ([ht (merge-next-pkg-dbs 'shared)]) ([(k v) (in-hash db)])
(hash-set ht k v))])))