On this page:
create-dirs-catalog
6.2.900.17

7.6 Package Directories Catalog

 (require pkg/dirs-catalog) package: base
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 --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.

procedure

(create-dirs-catalog catalog-path    
  dirs    
  [#:link? link?    
  #:merge? merge?    
  #:check-metadata? check-metadata?    
  #:status-printf status-printf])  void?
  catalog-path : path-string?
  dirs : (listof path-string?)
  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 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.