This module implements support for fetching bundles and their dependencies from remote locations (e.g., the network).
The predicate bundle_fetch/2 fetches a bundle and its dependencies, as follows:
A fetched bundle is automatically marked to distinguish them from user bundles, which are manually written by the user. It is possible to fetch a user bundle, e.g., to retreive all their dependencies.
Fetched bundles can be removed with bundle_rm/1. Removing a user bundle is not allowed with bundle_rm/1 (it must be done manually).
The location and fetch protocol is automatically recognized based on bundle aliases. See bundle_src_origin/2 for translation from bundle aliases to recognized origins (e.g., ciao-lang.org/foo downloads and uncompress a git archive).
Usage:add_bundle_origin(Bundle,Origin)
Select the origin for the given bundle name
Usage:get_bundle_origin(Bundle,Origin)
Obtain the origin for a bundle (for fetching). Use the default origin if unknown (default_origin/2).
Usage:
Cleanup the bundle fetch state
Usage:check_bundle_alias(BundleAlias,Origin,Bundle)
Given a URL-like BundleAlias, obtain its Origin term for fetch and the bundle name Name. Throws an exception if malformed and fails silently if it is not a URL-like alias.
Usage:bundle_fetch(Bundle,Fetched)
Fetch Bundle and all its dependencies. Fetched is the list of newly fetched bundles.
Usage:default_origin(Bundle,Origin)
Default origin when none is specified:
default_origin(Bundle,Origin) :- path_concat('github.com/ciao-lang',Bundle,Path), Origin=github(Path,master).