diff --git a/pkgs/racket-pkgs/racket-test/tests/pkg/tests-remove.rkt b/pkgs/racket-pkgs/racket-test/tests/pkg/tests-remove.rkt index 5f3893aa79..fc46ef04bf 100644 --- a/pkgs/racket-pkgs/racket-test/tests/pkg/tests-remove.rkt +++ b/pkgs/racket-pkgs/racket-test/tests/pkg/tests-remove.rkt @@ -22,6 +22,12 @@ (shelly-case "remove of not installed package fails" $ "raco pkg show -u -a" =stdout> " [none]\n" $ "raco pkg remove not-there" =exit> 1) + (shelly-case "remove of bad name" + $ "raco pkg remove bad/" =exit> 1 + =stderr> #rx"disallowed") + (shelly-case "remove of bad name" + $ "raco pkg remove bad#2" =exit> 1 + =stderr> #rx"disallowed") (shelly-install "remove test" "test-pkgs/pkg-test1.zip") (shelly-install "remove test with immediately redundant package name" diff --git a/pkgs/racket-pkgs/racket-test/tests/pkg/tests-update.rkt b/pkgs/racket-pkgs/racket-test/tests/pkg/tests-update.rkt index 21a5c57aa4..106a222e1e 100644 --- a/pkgs/racket-pkgs/racket-test/tests/pkg/tests-update.rkt +++ b/pkgs/racket-pkgs/racket-test/tests/pkg/tests-update.rkt @@ -19,6 +19,9 @@ (shelly-case "update" + (shelly-case "update of bad name" + $ "raco pkg update bad#2" =exit> 1 + =stderr> #rx"disallowed") (shelly-install "local packages can't be updated (file)" "test-pkgs/pkg-test1.zip" $ "raco pkg update pkg-test1" =exit> 1) diff --git a/pkgs/racket-pkgs/racket-test/tests/pkg/util.rkt b/pkgs/racket-pkgs/racket-test/tests/pkg/util.rkt index a50c093622..994ae537cd 100644 --- a/pkgs/racket-pkgs/racket-test/tests/pkg/util.rkt +++ b/pkgs/racket-pkgs/racket-test/tests/pkg/util.rkt @@ -86,7 +86,7 @@ (λ () (delete-directory/files tmp-dir)))) (define-syntax-rule (with-fake-root e ...) - (with-fake-installation* (λ () e ...))) + (with-fake-root* (λ () e ...))) (define (with-thread start-thread thunk) (define thread-id (thread start-thread)) diff --git a/racket/collects/pkg/main.rkt b/racket/collects/pkg/main.rkt index 26b753ad84..17ea5d0a31 100644 --- a/racket/collects/pkg/main.rkt +++ b/racket/collects/pkg/main.rkt @@ -59,7 +59,15 @@ (with-pkg-lock/read-only (define-values (pkg scope) (for/fold ([prev-pkg #f] [prev-scope #f]) ([pkg (in-list pkgs)]) - (define pkg-name (package-source->name pkg pkgs-type)) + (define-values (pkg-name pkg-type) + (package-source->name+type pkg pkgs-type + #:must-infer-name? #t + #:complain + (lambda (s msg) + ((current-pkg-error) + (~a "~a\n" + " given: ~a") + msg s)))) (define scope (find-pkg-installation-scope pkg-name)) (cond [(not prev-pkg) (values pkg scope)]