libzypp: zypp::misc Namespace Reference

libzypp 17.38.15

zypp::misc Namespace Reference

## Namespaces
namespace | testcase

## Enumerations
enum | LoadSystemFlag { LS_READONLY = (1 << 0) , LS_NOREFRESH = (1 << 1) , LS_NOREPOS = (1 << 2) }
| Bits for tuning defaultLoadSystem. More...
enum class | PoolInstallState { NotInstalled = 0 , AutoInstalled = (1 << 0) , UserInstalled = (1 << 1) , OtherVersionInstalled = (1 << 2) , Satisfied = (1 << 3) , Broken = (1 << 4) , Locked = (1 << 5) , Retracted = (1 << 6) }
| Install-state flags for a pool item or selectable. More...

## Functions
ZYpp::Ptr | defaultLoadSystem (const Pathname &sysRoot_r="/", LoadSystemFlags flags_r=LoadSystemFlags()) ZYPP_API
| Create the ZYpp instance and load target and enabled repositories.
| ZYPP_DECLARE_FLAGS_AND_OPERATORS (LoadSystemFlags, LoadSystemFlag)
| relates: LoadSystemFlag Type-safe way of storing OR-combinations.
ZYpp::Ptr | defaultLoadSystem (LoadSystemFlags flags_r)
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
PoolInstallStateFlags | poolInstallState (const PoolItem &pi)
| Compute install-state flags for a PoolItem.
PoolInstallStateFlags | poolInstallState (const ui::Selectable &sel)
| Compute install-state flags for a ui::Selectable.
| ZYPP_DECLARE_FLAGS_AND_OPERATORS (PoolInstallStateFlags, PoolInstallState)

## Enumeration Type Documentation

## ◆ LoadSystemFlag

enum zypp::misc::LoadSystemFlag

Bits for tuning defaultLoadSystem.

Use LoadSystemFlags as a type-safe way of storing OR-combinations.

Enumerator
LS_READONLY | // Create readonly ZYpp instance.
LS_NOREFRESH | // Don't refresh existing repos.
LS_NOREPOS | // Don't loag existing repos (just Target).

Definition at line 34 of file DefaultLoadSystem.h.

## ◆ PoolInstallState

enum class zypp::misc::PoolInstallState
| strong

Install-state flags for a pool item or selectable.

`NotInstalled` (zero) is the base state — nothing installed, nothing special. All other flags are additive modifiers on top of the install state.

Flags compose naturally:

- `AutoInstalled` | `Locked` — auto-installed dependency that is locked.
- `OtherVersionInstalled` | `UserInstalled` — user-installed, but a different version than any available candidate.

Testing for "is anything installed":

flags & ( PoolInstallState::AutoInstalled | PoolInstallState::UserInstalled )
zypp::misc::PoolInstallState::UserInstalled
@ UserInstalled
Explicitly installed by the user.
Definition PoolInstallState.h:62
zypp::misc::PoolInstallState::AutoInstalled
@ AutoInstalled
Installed as a dependency (auto).
Definition PoolInstallState.h:61

Note
  `OtherVersionInstalled` has nothing to do with vendor/source mismatch. It means the installed version is not identical to any available candidate in the current pool (which may be repo-filtered by the caller). It is always combined with `AutoInstalled` or `UserInstalled` so callers know how the other version got there.

Enumerator
NotInstalled | Not installed (base/default state).
AutoInstalled | Installed as a dependency (auto).
UserInstalled | Explicitly installed by the user.
OtherVersionInstalled | Installed, but no identical candidate available. Always combined with `AutoInstalled` or `UserInstalled`.
Satisfied | Pseudo-installed (patch/pattern) and satisfied.
Broken | Pseudo-installed and requirements are not met.
Locked | Locked — solver will not change this item.
Retracted | Retracted (PTF / blacklisted).

Definition at line 58 of file PoolInstallState.h.

## Function Documentation

## ◆ defaultLoadSystem() [1/2]

ZYpp::Ptr zypp::misc::defaultLoadSystem | ( | const Pathname & | sysRoot_r = "/",
|  | LoadSystemFlags | flags_r = LoadSystemFlags() )

Create the ZYpp instance and load target and enabled repositories.

See also
  LoadSystemFlag for options.

Exceptions

  Exception | on error

Todo
  properly handle service refreshs

Definition at line 37 of file DefaultLoadSystem.cc.

## ◆ ZYPP_DECLARE_FLAGS_AND_OPERATORS() [1/2]

zypp::misc::ZYPP_DECLARE_FLAGS_AND_OPERATORS | ( | LoadSystemFlags | ,
|  | LoadSystemFlag | )

relates: LoadSystemFlag Type-safe way of storing OR-combinations.

## ◆ defaultLoadSystem() [2/2]

ZYpp::Ptr zypp::misc::defaultLoadSystem | ( | LoadSystemFlags | flags_r | ) |
| inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 56 of file DefaultLoadSystem.h.

## ◆ poolInstallState() [1/2]

ZYPP_API PoolInstallStateFlags zypp::misc::poolInstallState | ( | const PoolItem & | pi | ) |

Compute install-state flags for a PoolItem.

For the PoolInstallState::OtherVersionInstalled flag, the selectable is looked up internally — callers do not need to provide it.

Definition at line 21 of file PoolInstallState.cc.

## ◆ poolInstallState() [2/2]

ZYPP_API PoolInstallStateFlags zypp::misc::poolInstallState | ( | const ui::Selectable & | sel | ) |

Compute install-state flags for a ui::Selectable.

PoolInstallState::OtherVersionInstalled is set when the installed object has no identical candidate available in the current pool. If the caller operates on a repo-filtered pool this naturally reflects the zypper "foreign installed" (v) case — no separate flag is needed.

Definition at line 74 of file PoolInstallState.cc.

## ◆ ZYPP_DECLARE_FLAGS_AND_OPERATORS() [2/2]

zypp::misc::ZYPP_DECLARE_FLAGS_AND_OPERATORS | ( | PoolInstallStateFlags | ,
|  | PoolInstallState | )