snow-chibi - Snow package manager
snow-chibi |
[options] command [arguments ...] |
Chibi Scheme comes with a package manager based on
Snow2 which can
be used to share R7RS libraries. Packages are distributed as tar gzipped
files called "snowballs" and may contain multiple libraries.
By default snow-chibi looks for packages in
the public repository, though
you can customize this with the --repo option. Packages can be
browsed on the site, but you can also search and query from the command-line
tool.
- search terms
...
- Print a list of available packages matching the given keywords.
- show names
...
- Show detailed information for the listed packages, which can be sexp
library names or the dotted shorthand used by Chibi Scheme. For example,
snow-chibi show "(chibi match)"
can be shortened as
snow-chibi show chibi.match
.
- status names
...
- Print the installed version of the given packages. Uninstalled packages
will not be shown. If no names are given, prints all currently installed
packages.
- implementations
- Print the currently installed Scheme implementations supported by
snow-chibi. If an implementation is found but has an older version,
a warning is printed.
The basic package management functionality, installing upgrading
and removing packages.
- install names
...
- Install the given packages. Package names can be sexp lists or use the
dotted shorthand. Explicit names for packages are optional, as a package
can always be referred to by the name of any library it contains. If
multiple packages provide libraries with the same name, you will be asked
to confirm which implementation to install.
- You can also bypass the repository and install a manually downloaded
snowball by giving a path to that file instead of a name.
- upgrade names
...
- Upgrade the packages if new versions are available. If no names are given,
upgrades all eligible packages.
- remove names
...
- Uninstalls the given packages. If the packages were not installed with
snow-chibi they cannot be removed.
- update
- snow-chibi keeps a local cache of the remote repository and updates
only periodically for performance, but you can force an update with this
command.
- index files
...
- If you have installed a package manually you can use this command to move
the package under snow-chibi supervision. Just pass the path to the
package files containing the installed R7RS library.
Creating packages can be done with the package command,
though other commands allow for uploading to public repositories.
- package files
...
- Create a package snowball from the given files, which should be R7RS
library files containing define-library forms. Include files are inferred
and packaged automatically. You can share packages directly, or upload
them to a snow repository for easy automated install.
- upload files
...
- Sign and upload to the default snow host. The files may either be .tgz
package files, or files containing define-library forms as in the
package command, from which packages are generated automatically.
Before you can upload to the default host a key must be generated and
registered first with the gen-key and reg-key commands.
- gen-key
- Create a new key, with your name, email address, and optionally an RSA
public key pair (disabled by default in the current implementation). The
key is saved locally to ~/.snow/priv-key.scm. You need to register it with
reg-key before it can be used for uploads.
- reg-key
- Register your key on the default Snow host.
- sign
file
- Sign a file with your key and write it to the .sig file. This can be used
with the verify command for testing, but otherwise is not needed as the
upload command generates the signature automatically.
- verify
sig-file
- Print a message verifying if a signature is valid.
- help
- Prints command-line reference.
The following options are used to select implementations for which
the packages are installed. By default the packages are installed only for
Chibi Scheme. You can use the implementations command to list
available implementations.
- --impls=impl1,impl2...
- Comma-separated list of implementations for which libraries are to be
installed.
Use all to install for all available
implementations.
- --program-implementation=impl
- Implementation for which to install executable programs.
The following options can be used to manually override or enforce
consistency and authenticity checks for installed or uploaded packages.
- --require-sig
- Verify signatures on packages before installing them.
- --ignore-sig
- Do not verify package signatures when installing.
- --ignore-digest
- Do not verify package checksums when installing.
- --skip-digest
- Do not compute checksums when making packages if there is no signing key
configured.
- --skip-version-checks
- Do not verify implementation versions for compatibility.
- --sign-uploads
- Sign uploaded packages with the signing key if it is configured.
The following options modify the default behavior of the
install and upgrade commands when installing packages.
- --skip-tests
- Do not run tests even if they are present.
- --show-tests
- Show test output even if they are successful.
- --install-tests
- Install test-only libraries. Normally these are skipped.
- --auto-upgrade-dependencies
- Upgrade installed dependencies when newer versions are available.
- --use-sudo={always|never|as-needed}
- Normally sudo is used only when necessary to install system files.
Use this option to override the default.
The following options are used to override the defaults for custom
repository configuration.
- --host=URI
- Base URI of Snow repository.
http://snow-fort.org is used by default.
- --repo=URI,path...
- Comma-separated list of URIs or paths of Snow repositories.
- --update-strategy={always|never|cache|confirm}
- Specify when to refresh repository cache. By default the cache is
refreshed automatically every 3 hours. You can also force an update,
prohibit any updates, or ask for an interactive prompt.
The following options control the gen-key and
reg-key commands used for generating new signature keys.
- --name=string
- Name to be associated with the key. If not specified, the name will be
prompted interactively.
- --email=string
- Email to be associated with the key. If not specified, the address will be
prompted interactively.
- --uri=URI
- URI of the repository where reg-key should upload the key, if not
the default host.
- --gen-rsa-key
- Enable RSA key generation.
- --bits=number
- Length of RSA key to use, between 256 and 2048 bits.
- --gen-key-in-process
- Generate RSA key without spawning a child interpreter.
The following options are used by the sign command.
- --output=filename
- Store signature in the specified file rather than using the *.sig
extension with the input.
- --digest={md5|sha-224|sha-256}
- Message digest function to use. SHA-256 is the default.
- --email=string
- Email address to associate with the signature.
The following options specify the information that package
and upload commands record in the created packages. Most of these
data fields can be reused and specified in the configuration file, see the
EASY PACKAGING section for details.
- --name=sexp
- Name of the package. Either an sexp library name or the dotted shorthand.
- --description=string
- Short textual description of the package.
- --version=major.minor.patch
- Version of the package.
- --version-file=path
- Specify a text file with the version string.
If both --version and --version-file are present
then --version takes priority.
- --programs=prog1,prog2...
- Comma-separated list of executable programs installed by this package.
- --data-files=file1,file2...
- Comma-separated list of extra data files installed by this package.
- --recursive
- Recursively visit and package subdependencies as well.
- --authors=author1,author2...
- Comma-separated list of the package authors. Names may be followed by
email addresses:
snow-chibi --authors="A. U. Thor <thor@example.com>" ...
- --maintainers=maintainter1,maintainter2...
- Comma-separated list of the package maintainers. Format is the same as for
the --authors list.
- --license=name
- Package license, such as "gpl". Please consult the
Snow
specification for the full list of supported license codes.
- --doc-from-scribble
- Automatically generate package documentation from Scribble literate
comments. See chibi-doc(1) for details.
- --doc=path
- Explicit documentation file to include with the package.
- --test=path
- Name of the test program containing test suite to run when installing the
package.
- --test-library=sexp
- Name of the library in the package exporting a (run-tests) function that
runs the test suite.
- --output-dir=path
- Directory where to put the resulting package. By default, the packages are
created in the current directory.
- --output=path
- Save the resulting package under the specified name.
Normally, the package file name is derived from the name and
version of the package. Use this option to set the file name explicitly,
it can be either a relative or an absolute path.
- --sig-file=path
- Existing signature file to use when uploading a package.
- --uri=URI
- Repository where the package should be uploaded, if not the default host.
The following options are used to override defaults for tools used
for installing packages. Normally they are selected automatically based on
the environment and the implementation for which the package is
installed.
- --builder={chibi|chicken|cyclone}
- Name of the builder to use for compiling libraries.
- --installer={chicken|cyclone}
- Name of the installer to use for library files.
- --program-builder={chicken|cyclone}
- Name of the program builder to use for executables.
- --scheme-script=command
- Shell command to use for running Scheme scripts. You can pass additional
arguments by separating them with spaces, for example:
snow-chibi --scheme-script="chibi-scheme -s" install ...
- --scheme-program-command=command
- Shell command to use for running Scheme programs. You can pass additional
arguments by separating them with spaces, like in --scheme-script.
- --chibi-path=path
- Path to Chibi Scheme executable.
By default chibi-scheme is expected to be
available.
- --cc=path
- Path to C compiler.
This overrides the CC environment variable.
- --cflags=flags
- Additional flags for the C compiler.
This overrides the CFLAGS environment variable.
- --use-curl
- Use cURL for file uploads. Make sure that it is installed and available as
curl in the search path.
- --sexp
- Output information in machine-readable sexp format instead of the default
human-readable output.
To encourage sharing code it's important to make it as easy as
possible to create packages, while encouraging documentation and tests. In
particular, you should never need to duplicate information anywhere. Thus
the package command automatically locates and packages include files
(and data, and FFI files) and determines dependencies for you. In addition,
it can automatically handle versions, docs and tests:
- •
- version can come explicitly from the --version option, or the
--version-file=file option
- •
- docs can come explicitly from the --doc=file option, or
be extracted automatically from literate documentation with
--doc-for-scribble
- •
- tests can come either explicitly from the --test=program
option, or the --test-library=lib-name which will
generate a program to run just the run-tests thunk in that
library
Other useful meta-info options include:
- --authors
- comma-delimited list of the package authors
- --maintainers
- comma-delimited list of the package maintainers
- --license
- the package license
These three are typically always the same, so it's useful to save
them in your ~/.snow/config.scm file. This file contains a single sexp and
can specify any option, for example:
((repository-uri "http://alopeke.gr/repo.scm")
(command
(package
(authors "Socrates <hemlock@aol.com>")
(doc-from-scribble #t)
(version-file "VERSION")
(test-library (append-to-last -test))
(license gpl))))
Top-level snow options are represented as a flat alist. Options
specific to a command are nested under (command (name ...)), with
most options here being for package. Here unless overridden on the
command-line, all packages will use the given author and license, try to
extract literate docs from the code, look for a version in the file named
"VERSION", and try to find a test suite with the same library name
appended with -test; e.g. for the library (socratic method), the test
library would be (socratic method-test). This form is an alternate to using
an explicit test-library name, and encourages you to keep your tests close
to the code they test. In the typical case, if using these conventions, you
can thus simply run snow-chibi package lib-file without any
other options.
Use can use the SNOW_CHIBI_CONFIG environment variable to
specify the path to the configuration file explicitly, rather than using the
default ~/.snow/config.scm