feat: add repo_update control modes

This commit is contained in:
2026-03-31 23:51:49 +03:00
parent dcd46a8499
commit 8db27e298c
8 changed files with 290 additions and 16 deletions

View File

@@ -23,6 +23,22 @@ Here is a breakdown of all configuration options:
- Enable or disable checking for updates before running operations.
- Default: `false`.
- **`repo_update`** (Object)
- Controls how repository index updates (e.g. `apt update`, `brew update`) are handled per
installer type. Keys are installer types, values are one of:
- `once` — Run the repo update at most once per sofmani run (default).
- `always` — Run the repo update before every install/update operation.
- `never` — Skip the repo update entirely.
- Supported types: `brew`, `apt`, `apk`.
- Default: `once` for all supported types.
- Example:
```yaml
repo_update:
brew: once
apt: always
apk: never
```
- **`summary`** (Boolean)
- Enable or disable the installation summary at the end.
- The summary shows newly installed and upgraded software in a hierarchical format.
@@ -73,6 +89,9 @@ debug: false
check_updates: true
summary: true
category_display: border
repo_update:
brew: once
apt: once
defaults:
type:
brew:

View File

@@ -493,6 +493,9 @@ install:
- **`brew`**
- **Description**: Installs packages using Homebrew.
- **Repo update**: Brew auto-updates its index on each command. By default, sofmani lets the first
brew command auto-update normally and suppresses it for subsequent ones (`once` mode). Configure
via the top-level [`repo_update`](./configuration-reference.md#global-options) option.
- **Options**:
- `opts.tap`: Name of the tap to install the package from.
@@ -513,6 +516,9 @@ install:
- **`apt`/`apk`**
- **Description**: Installs packages using apt install or apt add.
- Use `type: apt` for `apt install`, and `type: apk` for `apk add`.
- **Repo update**: Runs `apt update` or `apk update` before installing. By default, the update
runs at most once per sofmani run (`once` mode). Configure via the top-level
[`repo_update`](./configuration-reference.md#global-options) option.
- **Options**:
- `opts.flags`: Additional flags to pass to commands (fallback for install/update).
- `opts.install_flags`: Additional flags to pass only during install.