All predicatesShow sourcecpack.pl -- The ClioPatria package manager

Source cpack_install(+Install) is semidet
Install package by name or URL. The URL of a CPACK can be found on the web-page of the package. If a name is given, cpack_install/1 queries the configured servers for the package. For example:
?- cpack_install('EDM').
% Trying CPACK server at http://cliopatria.swi-prolog.org/cpack/EDM ...
% Installing package EDM:
%    EDM -- View Europeana Data Model
% Initialized empty Git repository in /home/jan/tmp/test/cpack/EDM/.git/
%     Installing EDM.pl ...
% /home/jan/tmp/test/config-enabled/010-packs.pl compiled into conf_packs 0.00 sec, 1,480 bytes
% Added the following config files:
%     /home/jan/tmp/test/config-enabled/010-packs.pl
%     /home/jan/tmp/test/config-enabled/EDM.pl
%   library(count) compiled into count 0.02 sec, 13,280 bytes
%  skin(EDM) compiled into edm 0.02 sec, 52,984 bytes
% /home/jan/tmp/test/config-enabled/EDM.pl compiled into conf_EDM 0.02 sec, 56,112 bytes
true.
Arguments:
Install- is either a URL on the server that returns the installation parameter (this is shown in the info box of the package), or the name of a package or a list of package names.
See also
- http://cliopatria.swi-prolog.org is the central package repository.
Source pack_data_url(+NameOrNames, -URL) is nondet[private]
URL can be tried to obtain information about the requested packages.
Source cpack_install_terms(+Terms) is det[private]
Install from the server reply.
Source package_status(+CpackTerm, -Status)[private]
Arguments:
Status- is a term cpack(Package, State), where State is one of no_change, upgrade(Old, New) or new.
Source cpack_download(+Repository, +TargetDir)[private]
Download Repository to Dir.
To be done
- Branches, trust
Source setup_push_for_download(+Dir) is det[private]
If the downloaded repository can be related to a push-location based on the current profile, we setup a remote for pushing changes. This remote has tehe symbolic name upload.
To be done
- We can (and should) also verify whether the upload and downloaded origin are at the same version.
Source cpack_upgrade
Upgrade all packages to the server versions.
Source cpack_upgrade(Package)
Upgrade Package. This is the same as cpack_install(Package).
Source cpack_configure(+Name) is det
Just configure a package.
Source cpack_add_dir(+ConfigEnable, +PackageDir)
Install package located in directory PackageDir.
To be done
- Register version-tracking with register_git_module/3.
Source add_pack_to_search_path(+PackFile, +Pack, +Dir, -Modified, +Options) is det[private]
Add a directive as below to PackFile. If PackFile already contains a declaration for Pack with different attributes, the file is rewritten using the new attributes.
:- cpack_register(Pack, Dir, Options).
Source cpack_remove(+Pack) is det
Source cpack_remove(+Pack, +Options) is det
Remove CPACK Pack. Processed options:
force(Boolean)
If true, omit checking whether removing the package will break dependencies.
fake(true)
Print messages indicating what actions will be preformed, but do not modify anything.
To be done
- Should we also try to unload all loaded files?
Source cpack_unregister(+Pack, +Options) is det[private]
Remove registration of the given CPACK. This is achieved by updating 010-packs.pl and reloading this file.
Source remove_config(+Dir, +Options)[private]
Remove configuration that we loaded from Dir. Currently deletes links and Prolog `link files'.
To be done
- Deal with copied config files. We can base this on config.done and maybe on the module name.
- Update config.done.
Source remove_dir(+Dir, Options)[private]
Removes a directory recursively.
Source cpack_register(+PackName, +Dir, +Options)
Attach a CPACK to the search paths
Source current_cpack(-Name) is nondet
True when Name is the name of a registered package.
Source cpack_property(Name, Property) is nondet
True when Property is a property of the CPACK Name. Defined properties are:
  • directory(Dir)
Source prolog_version:git_module_hook(?Name, ?Directory, ?Options) is nondet[multifile]
Make packages available for the version management implemented by library(version).
Source cpack_create(+Name, +Title, +Options) is det
Create a new package. Options include
type(Type)
Label of a subclass of cpack:Package. Default is package
title(Title)
Title for the package. Should be a short line.
foafname(FoafName)
foaf:name to put into the default template
foafmbox(Email)
foaf:mbox to put into the default template

Default options are extracted from the cpack:Profile named default

To be done
- Allow selection profile, auto-loading of profile, etc.
Source git_setup_push(+Dir, +Vars) is det[private]
Set an origin for the newly created repository. This also tries to setup a bare repository at the remote machine using git_create_origin/2.
Source git_create_origin(+Dir, +PushURL, +Title) is det[private]
Try to create the repository origin. As the user has setup push, we hope he setup SSH appropriately. Note that this only works if the remote user has a real shell and not a git-shell.

When using GitHub, PushURL is

git@github.com:<user>/@CPACK@.git
https://github.com/<user>/@CPACK@.git
Source make_cpack_dir(+BaseDir, +CPACKDir) is det[private]
Setup th directory structure for a new package.
Source cpack_load_profile is det[private]
Try to load the profile from user_profile('.cpack.ttl').
To be done
- Prompt for a default profile (notably fill in the servers).
Source cpack_load_schema[private]
Ensure the CPACK schema data is loaded.
Source cpack_package_dir(+PackageName, -Dir, +Create)[private]
Installation directory for Package

Re-exported predicates

The following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.

Source cpack_remove(+Pack) is det
Source cpack_remove(+Pack, +Options) is det
Remove CPACK Pack. Processed options:
force(Boolean)
If true, omit checking whether removing the package will break dependencies.
fake(true)
Print messages indicating what actions will be preformed, but do not modify anything.
To be done
- Should we also try to unload all loaded files?