make packages single-collection by default
The `single-collection' "info.rkt" definition is no longer supported.
This commit is contained in:
parent
df95e83eb2
commit
aabbfdc3d5
|
@ -1,3 +1,5 @@
|
|||
#lang setup/infotab
|
||||
|
||||
(define collection 'multi)
|
||||
|
||||
(define deps '("base"))
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#lang setup/infotab
|
||||
|
||||
(define collection 'multi)
|
||||
|
||||
(define deps '("algol60"
|
||||
"at-exp-lib"
|
||||
"compatibility"
|
||||
|
|
|
@ -15,5 +15,6 @@
|
|||
"net-lib"
|
||||
"sandbox-lib"
|
||||
"scribble-lib"
|
||||
"compatibility-lib"))
|
||||
"compatibility-lib"
|
||||
"racket-test"))
|
||||
(define implies '("distro-build"))
|
||||
|
|
|
@ -83,14 +83,6 @@ name as the package. The @tech{checksum} is typically left implicit.
|
|||
The package directory can contain a file named @filepath{info.rkt}
|
||||
to declare other metadata (see @secref["metadata"]).
|
||||
|
||||
[@bold{The following paragraph and itemization is intentionally wrong.}
|
||||
Currently, if a package has no @filepath{info.rkt} file or no
|
||||
@racketidfont{collection} definition, it is treated as
|
||||
@tech{multi-collection package}. Also,
|
||||
@racketidfont{single-collection} is supported for temporary backward
|
||||
compatibility. The documentation from here on reflects the planned
|
||||
behavior.]
|
||||
|
||||
A @tech{package} can be a @tech{single-collection package} or a
|
||||
@tech{multi-collection package}:
|
||||
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
#lang setup/infotab
|
||||
(define collection 'multi)
|
|
@ -0,0 +1,2 @@
|
|||
#lang setup/infotab
|
||||
(define collection 'multi)
|
|
@ -0,0 +1,2 @@
|
|||
#lang setup/infotab
|
||||
(define collection 'multi)
|
|
@ -0,0 +1,2 @@
|
|||
#lang setup/infotab
|
||||
(define collection 'multi)
|
|
@ -1,3 +1,5 @@
|
|||
#lang setup/infotab
|
||||
|
||||
(define collection 'multi)
|
||||
|
||||
(define deps '("pkg-a"))
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
#lang racket/base
|
||||
|
||||
;; This module is in a single-collection package, so
|
||||
;; it's in a "pkg-c" collection.
|
||||
|
||||
'c
|
|
@ -0,0 +1,2 @@
|
|||
#lang setup/infotab
|
||||
(define collection 'multi)
|
|
@ -0,0 +1,2 @@
|
|||
#lang setup/infotab
|
||||
(define collection 'multi)
|
|
@ -0,0 +1,2 @@
|
|||
#lang setup/infotab
|
||||
(define collection 'multi)
|
|
@ -0,0 +1,2 @@
|
|||
#lang setup/infotab
|
||||
(define collection 'multi)
|
|
@ -0,0 +1,2 @@
|
|||
#lang setup/infotab
|
||||
(define collection 'multi)
|
|
@ -0,0 +1,2 @@
|
|||
#lang setup/infotab
|
||||
(define collection 'multi)
|
|
@ -1,3 +1,5 @@
|
|||
#lang setup/infotab
|
||||
|
||||
(define collection 'multi)
|
||||
|
||||
(define deps (list "pkg-test1"))
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#lang setup/infotab
|
||||
|
||||
(define collection 'multi)
|
||||
|
||||
(define deps (list "pkg-test1"))
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
#lang setup/infotab
|
||||
(define single-collection "pkg-test3")
|
||||
|
||||
(define collection "pkg-test3")
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
#lang setup/infotab
|
||||
|
||||
(define single-collection "pkg-test3")
|
||||
;; this is a single-collection package
|
||||
;; whose collection matches the package name
|
||||
|
||||
(define deps (list "pkg-test1"))
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#lang setup/infotab
|
||||
|
||||
(define collection 'multi)
|
||||
|
||||
(define version "1.0")
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#lang setup/infotab
|
||||
|
||||
(define collection 'multi)
|
||||
|
||||
(define version "2.1")
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
#lang setup/infotab
|
||||
|
||||
(define collection 'multi)
|
||||
|
||||
(define deps '(("pkg-v" #:version "2.0")
|
||||
("racket" "5.3.1.10")))
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#lang setup/infotab
|
||||
|
||||
(define collection 'multi)
|
||||
|
||||
(define deps '("pkg-z"))
|
||||
(define build-deps '("pkg-y"))
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
#lang setup/infotab
|
||||
|
||||
(define collection 'multi)
|
||||
|
||||
(define build-deps '("pkg-x"))
|
||||
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
#lang setup/infotab
|
||||
|
||||
(define collection 'multi)
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
#lang setup/infotab
|
||||
(define collection 'multi)
|
|
@ -0,0 +1,2 @@
|
|||
#lang setup/infotab
|
||||
(define collection 'multi)
|
|
@ -121,9 +121,10 @@
|
|||
$ "cp -r test-pkgs/pkg-test3 test-pkgs/pkg-test3-linking"
|
||||
$ "racket -e '(require pkg-test3)'" =exit> 1
|
||||
$ "raco pkg install --link test-pkgs/pkg-test1 test-pkgs/pkg-test3-linking"
|
||||
$ "racket -e '(require pkg-test3)'"
|
||||
$ "raco pkg remove pkg-test1 pkg-test3-linking"
|
||||
$ "racket -e '(require pkg-test3-linking)'"
|
||||
$ "racket -e '(require pkg-test3)'" =exit> 1
|
||||
$ "raco pkg remove pkg-test1 pkg-test3-linking"
|
||||
$ "racket -e '(require pkg-test3-linking)'" =exit> 1
|
||||
(finally
|
||||
$ "rm -r test-pkgs/pkg-test3-linking"))))
|
||||
|
||||
|
@ -133,6 +134,13 @@
|
|||
$ "raco pkg config --set catalogs http://localhost:9990"
|
||||
$ "raco pkg install pkg-test1-not-there" =exit> 1))
|
||||
|
||||
(with-fake-root
|
||||
(shelly-case
|
||||
"implicitly single-collection"
|
||||
$ "racket -e '(require pkg-c/c)'" =exit> 1
|
||||
$ "raco pkg install --link test-pkgs/pkg-c"
|
||||
$ "racket -e '(require pkg-c/c)'" =stdout> "'c\n"))
|
||||
|
||||
(with-fake-root
|
||||
(shelly-case
|
||||
"remote/name package"
|
||||
|
|
|
@ -35,17 +35,14 @@
|
|||
"pkg-x-platform1" "pkg-x-platform2")))
|
||||
|
||||
(define (create-package name)
|
||||
(define pkg-name name)
|
||||
(define dir (build-path pkgs-dir pkg-name))
|
||||
(make-directory* dir)
|
||||
(define coll-dir (build-path dir name))
|
||||
(define coll-dir (build-path pkgs-dir name))
|
||||
(make-directory* coll-dir)
|
||||
(call-with-output-file*
|
||||
(build-path coll-dir "main.rkt")
|
||||
(lambda (o)
|
||||
(displayln "#lang racket/base" o)))
|
||||
(parameterize ([db:current-pkg-catalog-file db])
|
||||
(db:set-pkg! pkg-name "local" "author@place" (path->string dir) "123456" "")))
|
||||
(db:set-pkg! name "local" "author@place" (path->string coll-dir) "123456" "")))
|
||||
|
||||
(create-package "pkg-x")
|
||||
(create-package "pkg-x-unix")
|
||||
|
|
|
@ -1409,29 +1409,22 @@
|
|||
(path-element->string name))]
|
||||
#:namespace [metadata-ns (make-metadata-namespace)])
|
||||
(define i (get-pkg-info dir metadata-ns))
|
||||
(and i
|
||||
(or
|
||||
(let ([s (i 'collection
|
||||
;; default will change from 'multi to 'use-pkg-name:
|
||||
(lambda () 'multi))])
|
||||
(unless (or (string? s)
|
||||
(eq? s 'multi)
|
||||
(eq? s 'use-pkg-name))
|
||||
(log-error (format (~a "bad `collection' definition in \"info.rkt\n"
|
||||
" path: ~a\n"
|
||||
" found: ~e\n"
|
||||
" expected: (or/c string? 'multi 'use-pkg-name)")
|
||||
(build-path dir "info.rkt")
|
||||
s)))
|
||||
(or (and (string? s)
|
||||
s)
|
||||
(and (eq? s 'use-pkg-name)
|
||||
pkg-name)))
|
||||
;; temporary backward compatubilty, to be removed when the
|
||||
;; default changes to 'multi
|
||||
(let ([s (i 'single-collection (lambda () #f))])
|
||||
(and (string? s)
|
||||
s)))))
|
||||
(if (not i)
|
||||
pkg-name
|
||||
(let ([s (i 'collection (lambda () 'use-pkg-name))])
|
||||
(unless (or (string? s)
|
||||
(eq? s 'multi)
|
||||
(eq? s 'use-pkg-name))
|
||||
(log-error (format (~a "bad `collection' definition in \"info.rkt\n"
|
||||
" path: ~a\n"
|
||||
" found: ~e\n"
|
||||
" expected: (or/c string? 'multi 'use-pkg-name)")
|
||||
(build-path dir "info.rkt")
|
||||
s)))
|
||||
(or (and (string? s)
|
||||
s)
|
||||
(and (eq? s 'use-pkg-name)
|
||||
pkg-name)))))
|
||||
|
||||
(define (get-setup-collects pkg-names+directories metadata-ns)
|
||||
(maybe-append
|
||||
|
|
Loading…
Reference in New Issue
Block a user