Bundle fetch

Author(s): Jose F. Morales.

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:

  • if the bundle is in a non-top workspace, stops fetching (and do not try to fetch dependencies)
  • if the bundle is missing, retreive and store it at the top workspace (see CIAOPATH environment)
  • if the bundle is in the top workspace, skips fetching
  • try fetch bundle dependencies

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 and interface

Documentation on exports

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.

        PREDICATEbundle_rm/1
        No further documentation available for this predicate.

        Documentation on internals

        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).
        

          Documentation on imports

          This module has the following direct dependencies: