On this page:
create-dirs-catalog
8.15

7.6 Package Directories Catalog🔗ℹ

The pkg/dirs-catalog module provides create-dirs-catalog, which generates a package catalog (as a directory) that refers to a set of packages that are found in a given set of directories. Packages are discovered in the given directory as subdirectories that have an "info.rkt" file.

For example, the main Racket development repository includes a "pkgs" directory that holds packages such as base, and create-dirs-catalog constructs a catalog to be used to install those packages.

When run directly as a program, pkg/dirs-catalog expects a destination catalog followed by any number paths for directories that hold packages:

  racket -l- pkg/dirs-catalog dest-catalog dir ...

The --immediate, --link, --merge, --check-metadata, and --quiet flags correspond to optional keyword arguments of create-dirs-catalog.

Added in version 6.1.1.6 of package base.
Changed in version 6.90.0.4: Added --immediate.

procedure

(create-dirs-catalog catalog-path    
  dirs    
  [#:immediate? immediate?    
  #:link? link?    
  #:merge? merge?    
  #:check-metadata? check-metadata?    
  #:status-printf status-printf])  void?
  catalog-path : path-string?
  dirs : (listof path-string?)
  immediate? : any/c = #f
  link? : any/c = #f
  merge? : any/c = #f
  check-metadata? : any/c = #f
  status-printf : (string? any/c ... -> void?) = void
Creates or modifies catalog-path as a directory that works as a catalog (see Package Catalog Protocol) to list the packages that are contained in each directory specified by dirs. Packages are discovered in dirs as subdirectories that have an "info.rkt" file; if immediate? is true, then each directory in dirs is checked for an immediate "info.rkt" file before checking subdirectories.

If link? is true, then the catalog specifies that the package should be installed as a directory link, as opposed to copies.

If merge? is true, then existing catalog entries in catalog-path are preserved, otherwise old catalog entries are removed.

To create author and description information for each package in the catalog, create-dirs-catalog looks for a pkg-authors and pkg-desc definition in each package’s "info.rkt" file. If either definition is missing and check-metadata? is true, an error is reported.

If a package’s "info.rkt" file defines pkg-name, then the defined name is used as the package’s name instead of the package directory’s name.

Changed in version 6.90.0.4 of package base: Added the #:immediate argument.
Changed in version 7.3.0.2: Added support for pkg-name to name a package.