chickadee » henrietta-cache

Henrietta-cache

Description

A caching helper for Henrietta which fetches eggs from various sources.

Requirements

Documentation

This egg installs a small program called henrietta-cache which reads a file containing egg-to-URI mappings. These URIs are expected to resolve to a so-called "release-info" file, which provides further instructions on how to fetch actual releases of the egg.

These releases are downloaded into a caching directory, which can then be served by henrietta for use by chicken-install.

Henrietta-cache can be invoked as follows:

 henrietta-cache [-h] [-c|-cache-dir CACHEDIR] [-e|-egg-list EGGLIST] [-i|-init-file INITFILE]

The CACHEDIR points at the directory in which to place the cached files. It defaults to "cache". It will automatically create a subdirectory for each egg in the list and create a subdirectory called "tags" underneath those, in which it creates one directory for each release. This structure is used because it is expected by henrietta, and may change in the future.

The EGGLIST points to a file containing the list of eggs to fetch. It may be either a filename or an HTTP(S) URI.

The INITFILE is a file which will be loaded before starting the download process. This can be used to set handlers on the hooks, as documented below.

For more information about the structure of release-info files and what types of entries they can contain, see the tutorial on releasing eggs and the distributed egg repositories design document.

Hooks

(download-release-success-hook [SUCCESS-HOOK]) parameter

This is a hook you can register to run some code whenever a full release of an egg has been successfully downloaded.

SUCCESS-HOOK is a procedure of two arguments: the egg name and the release version (both strings).

(download-release-error-hook [ERROR-HOOK]) parameter

This is a hook you can register to run some code whenever a full release of an egg has failed to download.

ERROR-HOOK is a procedure of three arguments: the egg name, the release version and the error message on the exception that was thrown when the failure happened (all three are strings).

(download-release-info-file-error-hook [ERROR-HOOK]) parameter

This is a hook you can register to run some code whenever the download of the release-info file of an egg failed.

ERROR-HOOK is a procedure of three arguments: the egg name, the URI-string of the release-info file's location and the error message on the exception that was thrown when the failure happend (all three are strings).

Changelog

Author

Peter Bex

Repository

https://bitbucket.org/sjamaan/henrietta-cache

License

 Copyright (c) 2011-2013, Peter Bex
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
 3. The name of the authors may not be used to endorse or promote products
    derived from this software without specific prior written permission.
 
 THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Contents »