2. Find, add and remove
solver is a new project of the lab: it computes the length of a vector with kinds and vectors.
program solver
!< The length of a vector, with the lab's packages.
use kinds, only : R8P
use vectors, only : norm
implicit none
print '(F6.3)', norm([3._R8P, 4._R8P])
end program solverFind
By words (in names, descriptions and keywords), by the module a program uses, or by build system:
$ fobis search kinds
lab:kinds file://~/remotes/kinds.git
Portable real kinds
vendor:kinds file://~/remotes/vendor-kinds.git
A vendor's real kinds, with its own tuning$ fobis search --module vectors
lab:vectors file://~/remotes/vectors.git
Small vectors of reals$ fobis search --build fobis
lab:kinds file://~/remotes/kinds.git
Portable real kinds
lab:vectors file://~/remotes/vectors.git
Small vectors of realsfobis info reads the source itself, not the index: its versions are the repository's tags, its modules those of the newest version.
$ fobis info vectors
vectors (file://~/remotes/vectors.git)
index : lab
summary : Small vectors of reals
license : MIT
build : fobis
versions : v0.1.0
modules : vectorsAdd
A name found in two indexes, from two different sources, is never resolved silently:
$ fobis add kinds
Error: kinds is in 2 indexes, name one of them:
lab:kinds file://~/remotes/kinds.git
vendor:kinds file://~/remotes/vendor-kinds.git
[exit status 2]The qualified name chooses:
$ fobis add lab:kinds
Added kinds = file://~/remotes/kinds.git :: semver=^1.0.0
Run 'fobis fetch' to fetch it.A module names the package providing it, when only one does:
$ fobis add --module vectors
Added vectors = file://~/remotes/vectors.git :: semver=^0.1.0
Run 'fobis fetch' to fetch it.A URL needs no index at all. timer is in none:
$ fobis add file://$HOME/remotes/timer.git
Added timer = file://~/remotes/timer.git :: semver=^1.0.0
Run 'fobis fetch' to fetch it.Remove
solver does not need timer after all:
$ fobis remove timer
Removed timer = file://~/remotes/timer.git :: semver=^1.0.0
Run 'fobis fetch' to drop it from the build.remove takes out the entry and the comment line add wrote above it. What is left in the fobos:
[dependencies]
# added by fobis add from index lab
kinds = file://~/remotes/kinds.git :: semver=^1.0.0
# added by fobis add from index lab
vectors = file://~/remotes/vectors.git :: semver=^0.1.0Each entry names a source and a range starting at the newest version. The fobos never names an index: fetch and build never read one, so the project keeps building if every index disappears.
Fetch and build
$ fobis fetch
Resolving semver '^1.0.0' for kinds...
Resolved kinds semver '^1.0.0' → v1.0.0
Cloning kinds from file://~/remotes/kinds.git
Checking out v1.0.0 for kinds
Resolving semver '^0.1.0' for vectors...
Resolved vectors semver '^0.1.0' → v0.1.0
Cloning vectors from file://~/remotes/vectors.git
Checking out v0.1.0 for vectors
Saved deps config to .fobis_deps/.deps_config.ini
Saved lock file to .fobis_deps/fobos.lock$ fobis build --quiet && ./build/solver
Building src/solver.f90
Compiling .fobis_deps/kinds/src/kinds.f90 serially
Compiling .fobis_deps/vectors/src/vectors.f90 serially
Compiling src/solver.f90 serially
Linking build/solver
Target src/solver.f90 has been successfully built
5.000What you learned
fobis search (--module, --build), fobis info, fobis add with a name, a qualified name, --module or a URL, fobis remove. Reference: search, add, remove.
Next: versions.