diff --git a/pkgs/racket-pkgs/racket-test/tests/pkg/test-pkgs/pkg-test-ancient.plt b/pkgs/racket-pkgs/racket-test/tests/pkg/test-pkgs/pkg-test-ancient.plt new file mode 100644 index 0000000000..3aa08d04dc --- /dev/null +++ b/pkgs/racket-pkgs/racket-test/tests/pkg/test-pkgs/pkg-test-ancient.plt @@ -0,0 +1,5 @@ +H4sIAFKPSVIAA4VRy04DMQy85yui7YEsUkCCD+AHOHDgB9yst7U2ryZORfv1OLSLqFSJnJyZ +8cTjfLx/KuMhbCfQpuChYWU9A/lWcNTGQUW9wsZECIIOLDebl52F6AgjD6I0LWZwCxapDy0x +6nCubo/S0NnuQQXrL2vGH9ylOHty/Icwd/wv4uzZFvTAdMS3UW94Bfcp4A0zd+ZiI/REpV5B +9BLIrAHlKBmcJBuFnArrABStS96jzGQzFHm+90uaFhl6OvzqSimukD4mmm5yKWlQZlhthnsb +UzN5/Eekhz7OU1m6/uVVPW48xJ0ufc/8vJW/UQ8nBPUNuMmvW8UBAAA= diff --git a/pkgs/racket-pkgs/racket-test/tests/pkg/tests-install.rkt b/pkgs/racket-pkgs/racket-test/tests/pkg/tests-install.rkt index 83a7457e44..332a12b8c8 100644 --- a/pkgs/racket-pkgs/racket-test/tests/pkg/tests-install.rkt +++ b/pkgs/racket-pkgs/racket-test/tests/pkg/tests-install.rkt @@ -27,6 +27,13 @@ "test-pkgs/pkg-test1.zip test-pkgs/pkg-test3.zip" "pkg-test1 pkg-test3") + (with-fake-root + (shelly-case + "local package (old plt)" + $ "raco pkg install test-pkgs/pkg-test-ancient.plt" + $ "racket -l test-pkg-ancient" =stdout> "'yea\n" + $ "raco pkg remove pkg-test-ancient")) + (shelly-case "invalid package format is an error" $ "raco pkg install test-pkgs/pkg-test1.zip.CHECKSUM" =exit> 1) diff --git a/racket/collects/pkg/lib.rkt b/racket/collects/pkg/lib.rkt index a870ea9d53..5c05838eeb 100644 --- a/racket/collects/pkg/lib.rkt +++ b/racket/collects/pkg/lib.rkt @@ -1090,7 +1090,17 @@ (lambda (x) (log-pkg-debug "~a" x)) (lambda () pkg-dir) #f - (lambda (auto-dir main-dir file) pkg-dir))] + (lambda (auto-dir main-dir file) pkg-dir)) + (define info-path (build-path pkg-dir "info.rkt")) + (unless (file-exists? info-path) + ;; Add in "info.rkt" file to make it multi-collection, + ;; since a ".plt" archive is never single-collection. This + ;; is needed for supporting old ".plt" archives as packages. + (call-with-output-file info-path + (lambda (o) + (fprintf o "#lang setup/infotab\n") + (write '(define collection 'multi) o) + (newline o))))] [x (pkg-error "invalid package format\n given: ~a" x)])