prolog_pack.pl -- A package manager for Prolog
The library(prolog_pack) provides the SWI-Prolog package manager. This library lets you inspect installed packages, install packages, remove packages, etc. It is complemented by the built-in attach_packs/0 that makes installed packages available as libaries.
- pack_list_installed is det
- List currently installed packages. Unlike pack_list/1, only locally installed packages are displayed and no connection is made to the internet.
- pack_info(+Pack)
- Print more detailed information about Pack.
- pack_search(+Query) is det
- pack_list(+Query) is det
- Query package server and installed packages and display results.
Query is matches case-insensitively against the name and title
of known and installed packages. For each matching package, a
single line is displayed that provides:
- Installation status
- p: package, not installed
- i: installed package; up-to-date with public version
- U: installed package; can be upgraded
- A: installed package; newer than publically available
- l: installed package; not on server
- Name@Version
- Name@Version(ServerVersion)
- Title
Hint:
?- pack_list('').
lists all packages.The predicates pack_list/1 and pack_search/1 are synonyms. Both contact the package server at http://www.swi-prolog.org to find available packages.
- Installation status
- pack_install(+Spec:atom) is det
- Install a package. Spec is one of
- Archive file name
- HTTP URL of an archive file name. This URL may contain a star (*) for the version. In this case pack_install asks for the deirectory content and selects the latest version.
- GIT URL (not well supported yet)
- A local directory name given as
file://
URL. - A package name. This queries the package repository at http://www.swi-prolog.org
After resolving the type of package, pack_install/2 is used to do the actual installation.
- pack_install(+Name, +Options) is det
- Install package Name. Processes the options below. Default
options as would be used by pack_install/1 are used to complete
the provided Options.
- url(+URL)
- Source for downloading the package
- package_directory(+Dir)
- Directory into which to install the package
- interactive(+Boolean)
- Use default answer without asking the user if there is a default action.
- silent(+Boolean)
- If
true
(default false), suppress informational progress messages. - upgrade(+Boolean)
- If
true
(defaultfalse
), upgrade package if it is already installed. - git(+Boolean)
- If
true
(defaultfalse
unless URL ends with =.git=), assume the URL is a GIT repository.
Non-interactive installation can be established using the option
interactive(false)
. It is adviced to install from a particular trusted URL instead of the plain pack name for unattented operation. - pack_url_file(+URL, -File) is det
- True if File is a unique id for the referenced pack and version. Normally, that is simply the base name, but GitHub archives destroy this picture. Needed by the pack manager.
- pack_rebuild(+Pack) is det
- Rebuilt possible foreign components of Pack.
- pack_rebuild is det
- Rebuild foreign components of all packages.
- environment(-Name, -Value) is nondet[multifile]
- Hook to define the environment for building packs. This
Multifile hook extends the process environment for building
foreign extensions. A value provided by this hook overrules
defaults provided by def_environment/2. In addition to changing
the environment, this may be used to pass additional values to
the environment, as in:
prolog_pack:environment('USER', User) :- getenv('USER', User).
- pack_upgrade(+Pack) is semidet
- Try to upgrade the package Pack.
- pack_remove(+Name) is det
- Remove the indicated package.
- pack_property(?Pack, ?Property) is nondet
- True when Property is a property of an installed Pack. This
interface is intended for programs that wish to interact with the
package manager. Defined properties are:
- directory(Directory)
- Directory into which the package is installed
- version(Version)
- Installed version
- title(Title)
- Full title of the package
- author(Author)
- Registered author
- download(URL)
- Official download URL
- readme(File)
- Package
README
file (if present) - todo(File)
- Package
TODO
file (if present)