Expand description
High-level package installation: fetch from registry, extract, lock.
The install flow glues the pieces together:
- Resolve a version for
name(fromversion_req, or the registry’slatestif none is given). - Download the tarball via
NetworkRegistry, which caches it under the cache directory and verifies its SHA-256 checksum. - Extract the tarball into
.bock/packages/<name>/<version>/. - Update
bock.packageto list the dependency. - Update
bock.lockwith aLockedPackageentry carrying the exact resolved version and checksum for reproducibility.
Offline mode: when no registry can be reached and a matching tarball already sits in the cache, installation is still possible — the tarball is extracted and the lockfile kept consistent, but the manifest entry records whichever version was already cached.
Structs§
- Install
Options - Options controlling a single package install.
- Installed
Package - Information about a newly installed package.
Constants§
- CACHE_
SUBDIR - Relative path (under a project) of the tarball cache.
- PACKAGES_
SUBDIR - Relative path (under a project) where extracted packages are installed.
Functions§
- clear_
cache - Wipe every tarball out of the cache directory.
- extract_
tarball - Extract a
.tar.gzarchive intotarget_dir, creating parents as needed. - install_
package - Install a package: download, extract, and update the manifest + lockfile.