meta_package_manager.managers.tazpkg module

class meta_package_manager.managers.tazpkg.Tazpkg[source]

Bases: PackageManager

SliTaz GNU/Linux’s package manager.

Documentation:

Note

tazpkg decorates every listing with localized, colorized titles, separators and count footers, with no terminal detection: LC_ALL=C pins the text to English, --output=raw switches the decorations to plain text, and any remaining ANSI sequence is stripped before parsing. Data rows are then matched by their digit-led version column, which no decoration line carries.

Note

No outdated operation: tazpkg up --check requires root and recharges the package lists from the mirror even when only listing, so there is no cleanly read-only upgradable listing.

Initialize cli_errors list.

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 with unmaintained: a confirmed-dead manager carries an unmaintained_message instead. Enforced by test_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.

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 frozenset of Platform instances at instantiation.

default_sudo: bool = True

Built-in escalation default, used when sudo is None.

False on 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 to True so their build_cli(..., sudo=True) operations escalate out of the box, while staying switchable off through sudo (--no-sudo or config) for rootless setups.

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 tazpkg row of the installed-packages database. This probe mirrors, verbatim, how tazpkg resolves its VERSION variable 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_regexes below 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.

$ tazpkg list --output=raw
List of all installed packages
================================================================================
busybox                            1.36.0            base-system
nano                               6.2               editors
================================================================================
2 packages installed.
search(query, extended, exact)[source]

Fetch matching packages.

tazpkg matches the query as a case-insensitive substring of name-version, over installed then mirrored packages.

$ tazpkg search nano --output=raw
Installed packages
--------------------------------------------------------------------------------
nano                    6.2               editors
--------------------------------------------------------------------------------
1 installed package found for: nano
Return type:

Iterator[Package]

install(package_id, version=None)[source]

Install one package from the mirror.

--forced skips the already-installed guard, keeping the call non-interactive.

$ sudo tazpkg get-install nano --forced --output=raw
Return type:

str

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
Return type:

tuple[str, ...]

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 --forced on each outdated package.

$ sudo tazpkg get-install nano --forced --output=raw
Return type:

tuple[str, ...]

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 python or python3.

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.

remove(package_id)[source]

Remove one package.

No --auto on 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:

str

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.

sync()[source]

Recharge the package lists from the mirror.

$ sudo tazpkg recharge --output=raw
Return type:

None

cleanup_cache()[source]

Delete every downloaded package from the cache.

$ sudo tazpkg clean-cache --output=raw
Return type:

None