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).
Select the origin for the given bundle name
Obtain the origin for a bundle (for fetching). Use the default origin if unknown (default_origin/2).
Cleanup the bundle fetch state
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.
Fetch Bundle and all its dependencies. Fetched is the list of newly fetched bundles.
Default origin when none is specified:
default_origin(Bundle,Origin) :- path_concat('github.com/ciao-lang',Bundle,Path), Origin=github(Path,master).