Version: 4.1.3
4 Utility Libraries
The planet collection provides configuration and utilities for using PLaneT.
4.1 config.ss: Client Configuration
The config.ss library provides several parameters useful for configuring how
PLaneT works.
Note that while these parameters can be useful to modify
programmatically, PLaneT code runs at module-expansion time and so
most user programs cannot set them until PLaneT has already
run. Therefore to meaningfully change these settings it is best to
manually edit the config.ss file.
The root PLaneT directory. If the environment variable PLTPLANETDIR is
set, default is its value; otherwise the default is the directory in
which "config.ss" is found.
The root of the PLaneT client’s cache directory.
The root of the PLaneT client’s uninstalled-packages cache. PLaneT
stores package distribution files in this directory, and searches for
them in this directory for them if necessary. Unlike the main PLaneT
cache, which contains compiled files and is specific to each
particular version of PLT Scheme, the uninstalled package cache is
shared by all versions of PLT Scheme that use the same package
repository, and it is searched if a package is not installed in the
primary cache and cannot be downloaded from the central PLaneT repository
(for instance due to a loss of Internet connectivity). This behavior
is intended to primarily benefit users who upgrade their PLT Scheme
installations frequently.
The file to use as the first place PLaneT looks to determine how a
particular PLaneT dependence in a file should be satisfied. The
contents of this file are used to ensure that no "magic upgrades"
occur after a package is installed. The default is the file "LINKAGE"
in the root PLaneT directory.
If #f, indicates that no logging should take place. Otherwise
specifies the file into which logging should be written. The default
is the file "INSTALL-LOG" in the root PLaneT directory.
PLaneT can use two different protocols to retrieve packages. If #t,
PLaneT will use the HTTP protocol; if #f it will use the custom-built
PLaneT protocol. The default value for this parameter is #t and setting
this parameter to #f is not recommended.
The URL for the servlet that will provide PLaneT packages if
USE-HTTP-DOWNLOADS? is #t, represented as a string. The default
value is "http://planet.plt-scheme.org/servlets/planet-servlet.ss".
The name of the PLaneT server to which the client should connect if
USE-HTTP-DOWNLOADS? is #f. The default value for this parameter is
"planet.plt-scheme.org".
The port on the server the client should connect to if
USE-HTTP-DOWNLOADS? is #f. The default value for this parameter is
270.
4.2 util.ss: Utilities
The "util.ss" library supports examination of the pieces of
PLaneT. It is meant primarily to support debugging and to allow easier
development of higher-level package-management tools. The
functionality exposed by the planet command-line tool is
also available programmatically through this library.
Downloads and installs the package specifed by the given owner name,
package name, major and minor version number. Returns false if no such
package is available; otherwise returns a package structure for the
installed package.
Holds a listing of all package names and versions installed in the
local cache.
Returns the current linkage table.
The linkage table is an association between file locations (encoded as path strings)
and concrete planet package versions. If a require line in the associated file requests a package,
this table is consulted to determine a particular concrete package to satisfy the request.
Makes a .plt archive file suitable for PLaneT whose contents are all
files in the given directory and returns that file’s name. If the
optional filename argument is provided, that filename will be used as
the output file’s name.
Unpacks the PLaneT archive with the given filename, placing its contents
into the given directory (creating that path if necessary).
Removes the specified package from the local planet cache.
Print a tree representing the file and directory structure of the
PLaneT archive .plt file named by plt-file to (current-output-port).
Print the contents of the file named file-to-print within the
PLaneT archive .plt file named by plt-file to (current-output-port).
Removes the entire linkage table from the system, which will force all
modules to relink themselves to PLaneT modules the next time they run.
Adds a development link between the specified package and the given
directory; once a link is established, PLaneT will treat the cache as
having a package with the given owner, name, and version whose files
are located in the given path. This is intended for package
development; users only interested in using PLaneT packages
available online should not need to create any development links.
If the specified package already has a development link, this function
first removes the old link and then adds the new one.
Removes any hard link that may be associated with the given package.
Returns the file system path to the file specified by the given quoted
planet require specification. This function downloads and installs the
specified package if necessary, but does not verify that the actual
file within it actually exists.
Macros that expand into expressions that evaluate to information about
the name, owner, and version number of the package in which they
appear. this-package-version returns a list consisting of a string
naming the package’s owner, a string naming the package, a number
indicating the package major version and a number indicating the
package minor version, or #f if the expression appears outside the
context of a package. The others are convenience macros that
select out the relevant field, or return #f if the expression
appears outside the context of a PLaneT package.