meta_package_manager.managers.sun_tools module¶

class meta_package_manager.managers.sun_tools.Sun_Tools[source]¶

Bases: PackageManager

Solaris’ legacy System V Release 4 packaging tools.

Documentation:

The suite spans several binaries: pkginfo (the read-only query tool, used as the main CLI), pkgadd and pkgrm.

Note

SVR4 packages come from local media or datastream files, not a network repository: there is no catalog to search, refresh or diff against, and pkgadd installs a specific local artifact rather than resolving a name. Only installed and remove are therefore implemented; Solaris 11’s modern repository-based interface is IPS (pkg), a different manager.

Initialize cli_errors list.

maintenance_note: str | None = 'The SVR4 packaging commands are legacy, superseded by IPS since Solaris 11, but still shipped and supported on [Oracle Solaris 11.4](https://docs.oracle.com/cd/E37838_01/html/E61051/pkgsvr4.html), whose support runs through 2037.'¶

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 = 'Solaris SVR4 package tools'¶

Return package manager’s common name.

Default value is based on class name.

homepage_url: str | None = 'https://docs.oracle.com/cd/E86824_01/html/E54763/pkginfo-1.html'¶

Home page of the project, only used in documentation for reference.

platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='solaris', name='Solaris')})¶

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.

cli_names: tuple[str, ...] = ('pkginfo',)¶

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).

cli_search_path: tuple[str, ...] = ('/usr/sbin',)¶

List of additional path to help mpm hunt down the package manager CLI.

Must be a list of strings whose order dictates the search sequence.

Most of the time unnecessary: meta_package_manager.execution.CLIExecutor.cli_path works well on all platforms.

version_cli: str | None = 'uname'¶

None of the SVR4 tools has a version flag: pkginfo -v matches a package version and pkgadd/pkgrm only take -v as verbose. The suite ships with the base system, so its version is the OS release reported by uname -r (5.11 on Solaris 11).

version_cli_options: tuple[str, ...] = ('-r',)¶

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.]+)',)¶
$ uname -r
5.11
id: str = 'sun-tools'¶

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.

property installed: Iterator[Package]¶

Fetch installed packages.

Plain pkginfo prints no version column (only category, package instance and name), so the long -l listing is parsed instead: each package is a multi-line block carrying PKGINST:, VERSION: and STATUS: fields. Only completely-installed packages are yielded.

$ pkginfo -l
  PKGINST:  SUNWcar
      NAME:  Core Architecture, (Root)
  CATEGORY:  system
      ARCH:  i386.i86pc
   VERSION:  11.10.0,REV=2005.01.21.16.34
   BASEDIR:  /
    VENDOR:  Oracle Corporation
    STATUS:  completely installed
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.

-n runs non-interactively: pkgrm exits instead of prompting, so a removal requiring interaction (like a dependency confirmation) fails fast rather than hanging mpm’s subprocess.

$ sudo pkgrm -n SUNWzlib
Return type:

str