Version: git-pkgs/managers current main at 241e284.
Trying to build Alpine package operations after registering the embedded definitions currently returns unknown manager: apk:
_, err := tr.BuildCommand("apk", "add", managers.CommandInput{
Args: map[string]string{"package": "curl", "version": "8.14.1-r2"},
})
Add an apk definition for Alpine's system package manager. Include definitions/apk.yaml, captured version and command help under references/apk, translator tests, and Docker coverage as described in the new manager contribution guide.
The command mapping should follow apk's own command and file formats:
- Use
apk add and apk del for package constraints. The apk-world(5) package specification covers exact versions such as curl=8.14.1-r2 and tagged repositories such as curl@edge.
- Use
apk list --installed for list, apk list --upgradable for outdated, and apk upgrade [packages] for update. apk update only refreshes repository indexes, so it should not be exposed as a package update.
apk dot --installed can provide raw dependency graph output for resolve; the command supports the shared query filters documented by apk-query(8).
- Do not advertise
path from apk info --contents. That command returns every owned file, not one package directory.
The generic install operation needs a safe definition because it has no package argument. apk fix repairs or reinstalls packages, so it should not be used as an install alias. Leave install unsupported unless the operation can reconcile a supplied world file without changing the existing API contract.
Repository flags need a small translator change. Apk requires global options before the command, while the current translator adds the command, positional arguments, and then dynamic flags. Add support for pre-command flags so repository selection is emitted as apk --repository URL add PACKAGE. The upstream apk-repositories(5) examples show repository configuration files that can be used as fixtures.
Commands that change the system normally require elevated permissions. The current Command schema does not expose this to callers. Add per-command privilege metadata and keep sudo out of generated commands so the caller controls elevation.
Tests should cover exact versions, repository tags and URLs, flag placement, installed and upgradable listings, package-specific and system upgrades, dependency graph output, and privilege metadata. Apk is non-interactive by default, so the definition should not add a nonexistent -y flag.
Version:
git-pkgs/managerscurrentmainat241e284.Trying to build Alpine package operations after registering the embedded definitions currently returns
unknown manager: apk:Add an
apkdefinition for Alpine's system package manager. Includedefinitions/apk.yaml, captured version and command help underreferences/apk, translator tests, and Docker coverage as described in the new manager contribution guide.The command mapping should follow apk's own command and file formats:
apk addandapk delfor package constraints. Theapk-world(5)package specification covers exact versions such ascurl=8.14.1-r2and tagged repositories such ascurl@edge.apk list --installedforlist,apk list --upgradableforoutdated, andapk upgrade [packages]forupdate.apk updateonly refreshes repository indexes, so it should not be exposed as a package update.apk dot --installedcan provide raw dependency graph output forresolve; the command supports the shared query filters documented byapk-query(8).pathfromapk info --contents. That command returns every owned file, not one package directory.The generic
installoperation needs a safe definition because it has no package argument.apk fixrepairs or reinstalls packages, so it should not be used as an install alias. Leaveinstallunsupported unless the operation can reconcile a supplied world file without changing the existing API contract.Repository flags need a small translator change. Apk requires global options before the command, while the current translator adds the command, positional arguments, and then dynamic flags. Add support for pre-command flags so repository selection is emitted as
apk --repository URL add PACKAGE. The upstreamapk-repositories(5)examples show repository configuration files that can be used as fixtures.Commands that change the system normally require elevated permissions. The current
Commandschema does not expose this to callers. Add per-command privilege metadata and keepsudoout of generated commands so the caller controls elevation.Tests should cover exact versions, repository tags and URLs, flag placement, installed and upgradable listings, package-specific and system upgrades, dependency graph output, and privilege metadata. Apk is non-interactive by default, so the definition should not add a nonexistent
-yflag.