libzypp 17.38.14
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

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

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 33 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":

@ UserInstalled
Explicitly installed by the user.
@ AutoInstalled
Installed as a dependency (auto).
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]

void 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
Exceptionon 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]

void 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 55 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  )