fix treatment of an old-style ".plt" file as a package

This commit is contained in:
Matthew Flatt 2013-09-30 08:44:28 -06:00
parent 214aba2930
commit 413985eeb4
3 changed files with 23 additions and 1 deletions

View File

@ -0,0 +1,5 @@
H4sIAFKPSVIAA4VRy04DMQy85yui7YEsUkCCD+AHOHDgB9yst7U2ryZORfv1OLSLqFSJnJyZ
8cTjfLx/KuMhbCfQpuChYWU9A/lWcNTGQUW9wsZECIIOLDebl52F6AgjD6I0LWZwCxapDy0x
6nCubo/S0NnuQQXrL2vGH9ylOHty/Icwd/wv4uzZFvTAdMS3UW94Bfcp4A0zd+ZiI/REpV5B
9BLIrAHlKBmcJBuFnArrABStS96jzGQzFHm+90uaFhl6OvzqSimukD4mmm5yKWlQZlhthnsb
UzN5/Eekhz7OU1m6/uVVPW48xJ0ufc/8vJW/UQ8nBPUNuMmvW8UBAAA=

View File

@ -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)

View File

@ -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)])