meta_package_manager.managers.tazpkg module¶
- class meta_package_manager.managers.tazpkg.Tazpkg[source]¶
Bases:
PackageManagerSliTaz GNU/Linux’s package manager.
The code also lives in a git clone, SliTaz-official/tazpkg.
Initialize
cli_errorslist.- maintenance_note: str | None = '[SliTaz](https://slitaz.org) has published no stable ISO since 5.0 (2023) but shows active development into 2026; `tazpkg` remains its native package manager.'¶
A watch note about a still-maintained upstream whose activity is slowing or whose status is ambiguous, as a MyST markdown block.
Unlike
unmaintained, this is purely informational: the manager stays in the default selection and in the test matrices. It renders as a{note}admonition atop the manager’s documentation page, flagging upstreams worth keeping an eye on (a slow release cadence, superseded-but-still-shipped tools, a discontinued platform still under vendor support). May embed markdown links. Mutually exclusive withunmaintained: a confirmed-dead manager carries anunmaintained_messageinstead. Enforced bytest_maintenance_note.
- name: str = 'TazPkg'¶
Return package manager’s common name.
Default value is based on class name.
- homepage_url: str | None = 'https://slitaz.org'¶
Home page of the project, only used in documentation for reference.
Left unset when the home page is the project’s repository, which
repository_urlnames on its own, and when it is the project’s manual, whichdocumentation_urlnames. Never inherited, like the other links.
- documentation_url: str | None = 'https://doc.slitaz.org/en:handbook:tazpkg'¶
Entry point of the project’s own documentation, or
Nonewhen it has none.The manual, the documentation site, or the man page of the CLI
mpmdrives: whichever page a user reads to learn the commands this manager wraps. Listed betweenhomepage_urlandrepository_urlin the links of the manager’s page, so a reader reaching for the tool’s reference finds it in the box of facts rather than in the prose below it.Left unset where a link would state a fact twice or invent one: a tool documenting itself in its repository alone, whose README
repository_urlalready reaches. A page about the ecosystem rather than the tool does not qualify either.Where a project’s only site is its manual, that address belongs here and
homepage_urlstays unset: the slot names what the page is, and a reader reaching for the reference looks under the documentation link.Never inherited, like every other link: the AUR helpers extending
pacmaneach document themselves.
- repository_url: str | None = 'https://hg.slitaz.org/tazpkg'¶
Repository holding the project’s code, or
Nonewhen it has no public one.Linked from the manager’s documentation page. Also what the weekly metrics sample reads:
docs/docs_update.pywrites it into the[tool.repomatic.metrics] subjectsofpyproject.tomlwhen its forge answers the sampler, through a mirror for a forge that does not.Never inherited, for the same reason as
wikipedia_url: the AUR helpers extendingpacmaneach live in a repository of their own.
- wikipedia_url: str | None = 'https://en.wikipedia.org/wiki/SliTaz'¶
English Wikipedia article about the project, or
Nonewhen it has none.Listed last in the links of the manager’s documentation page. The article covers the project that home page names, or is a redirect Wikipedia keeps under the project’s name, landing on the part of a broader article that describes it:
Cargo_(software)opens the Cargo section of the Rust article. An article that merely mentions the project does not count, nor does one about a related subject:lazyis a Neovim plugin manager, and the Neovim article is not about it.Never inherited: the metaclass resets it to
Noneon any class not declaring its own. A subclass often wraps a distinct project, like the six AUR helpers extendingpacman, and would otherwise present pacman’s article as its own. Documentation-only, likehomepage_url.
- keywords: tuple[str, ...] = ('slitaz',)¶
Well-known names for this manager that its
iddoes not already carry.Merged into the PyPI keywords of
pyproject.tomlbyupdate_keywords()ofdocs/docs_update.py, alongside every manager ID and the globally curatedKEYWORDS_EXTRAS. Declare an alias here rather than in that tuple whenever it names this manager: an alias living beside the class it describes cannot outlive it, where a central entry silently rots once the manager is renamed or dropped.Reserve
KEYWORDS_EXTRASfor terms belonging to no manager in particular, likecyclonedxorpackage manager. Documentation-only: no CLI output reads it.Each keyword also becomes a content rule of the issue labeller, so its precision bar applies here: see
generate_content_rules(). A subclass inherits the terms of its parent without claiming them, sincetest_manager_keywords_have_one_ownerreads what a class declares itself.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='slitaz', name='SliTaz GNU/Linux')})¶
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a
frozensetofPlatforminstances at instantiation.
- default_sudo: bool = True¶
Built-in escalation default, used when
sudoisNone.Falseon the base: most managers install into user-writable trees and never need root. The system package managers whose privileged operations require root (apt,dnf,pacman,zypper, …) set this toTrueso theirbuild_cli(..., sudo=True)operations escalate out of the box, while staying switchable off throughsudo(--no-sudoor config) for rootless setups.
- privileged_operations: ClassVar[frozenset[str]] = frozenset({'cleanup', 'install', 'remove', 'sync', 'upgrade', 'upgrade_all'})¶
Operations with at least one command this manager marks privileged.
Keyed by the
Operationsmember name, likeoperation_notes. An operation belongs here when a method implementing it passessudo=Truetorun_cli()orbuild_cli(), with the method-to-operation map ofMETHOD_OPERATIONS. Those commands are the only ones the escalation policy (sudo, elsedefault_sudo) wraps in the escalator. A definition derives the set from the operations it markssudo = true.prime_sudo()reads it to prompt only for the managers that escalate a command of the current run. With[mpm.overrides.gem] sudo = true,mpm syncasks for no password: thegem sources --updatecommand ofsynccarries no marker.test_privileged_operationsholds the set to the markers in the method bodies.
- extra_env: ClassVar = {'LC_ALL': 'C'}¶
Additional environment variables to add to the current context.
Automatically applied on each
meta_package_manager.execution.CLIExecutor.run_cli()calls.
- post_args: tuple[str, ...] = ('--output=raw',)¶
Global list of options used before and after the invoked package manager CLI.
Automatically added to each
meta_package_manager.execution.CLIExecutor.run_cli()call.Essentially used to force silencing, low verbosity or no-color output.
- version_cli: str | None = 'awk'¶
tazpkg has no version command at all: its own version only exists as the
tazpkgrow of the installed-packages database. This probe mirrors, verbatim, how tazpkg resolves itsVERSIONvariable for itself:export VERSION=$(awk -F$'\t' '$1=="tazpkg"{print $2}' \ "$PKGS_DB/installed.info")
- version_cli_options: tuple[str, ...] = ('-F\t', '$1=="tazpkg"{print $2}', '/var/lib/tazpkg/installed.info')¶
CLI options used to produce the version of the package manager.
The raw output produced by the package manager CLI will be parsed with the
version_regexesbelow to extract the version number.
- version_regexes: tuple[str, ...] = ('^(?P<version>[\\d.]+)$',)¶
A bare integer Mercurial revision on cooking releases (
944) or a dotted version on stable ones (4.9.2).
- property installed: Iterator[Package]¶
Fetch installed packages.
Captured on a minimal SliTaz 5.0 system, holding
tazpkgand its dependencies alone.$ tazpkg list --output=raw List of all installed packages ================================================================================ busybox 1.37.0 base-system gettext-base 0.21 base-system glibc-base 2.20 base-system ncurses-common 6.4 base-system slitaz-base-files 348 base-system tazpkg 5.9.5 base-system ================================================================================ 6 packages installed.
- search(query, extended, exact)[source]¶
Fetch matching packages.
tazpkg matches the query as a case-insensitive substring of
name-version, and answers in two sections: the installed matches, then the mirror’s. Only the mirror section is read, since it lists every match once, at the versionget-installfetches. Reading both would report an installed package twice.$ tazpkg search nano --output=raw Search result for "nano" ================================================================================ Installed packages -------------------------------------------------------------------------------- nano 9.0 utilities nanochess 1.0 games ================================================================================ 2 installed packages found for "nano" Available packages -------------------------------------------------------------------------------- nano 9.0 utilities nano-doc 9.0 utilities nano-lang 9.0 utilities nanochess 1.0 games nanoshot 0.2.15 utilities ================================================================================ 5 available packages found for "nano"
- install(package_id, version=None)[source]¶
Install one package from the mirror.
--forcedskips the already-installed guard, keeping the call non-interactive.SliTaz’s
check_tazpkgupg.shboot script creates/var/lock/tazpkgup.lockwhen the mirror has a newer TazPkg. While that lock exists, TazPkg refuses to install anything but itself, printsYou need upgrade tazpkg first !and exits0. That refusal is raised as an error naming the command to run first.$ sudo tazpkg get-install nano --forced --output=raw
- Return type:
- upgrade_all_cli()[source]¶
Generates the CLI to upgrade all packages.
-i(no long form) auto-confirms, upgrading every outdated package; the command recharges the package lists first.$ sudo tazpkg up -i --output=raw
- upgrade_one_cli(package_id, version=None)[source]¶
Generates the CLI to upgrade one package.
tazpkg has no per-package upgrade verb: its own upgrade loop re-runs
get-install --forcedon each outdated package.$ sudo tazpkg get-install nano --forced --output=raw
- cli_names: tuple[str, ...] = ('tazpkg',)¶
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this property’s value is derived from the manager’s ID (see the
MetaPackageManager.__init__method above).
- id: str = 'tazpkg'¶
Package manager’s ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as they’re used as feature flags for the mpm CLI.
- upgrade(package_id=None, version=None, *, outdated_ids=None)[source]¶
Upgrade one or all packages, and raise TazPkg’s self-upgrade refusal.
Both commands run
get-install, so the lock that stopsinstall()stops them too.up -ikeeps going after a refusal: it skips the packages its list places beforetazpkg, upgradestazpkg, which deletes the lock, then upgrades the rest.- Return type:
- virtual: bool = False¶
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
- remove(package_id)[source]¶
Remove one package.
No
--autoon purpose: it would also auto-confirm the “remove dependents?” follow-up and cascade. On a non-terminal stdout (mpm’s subprocess pipe) the(y/N)prompt is skipped and only the target package is removed.$ sudo tazpkg remove nano --output=raw
- Return type: