YaST2 Developers Documentation: Packager



functions
files
intro

Packager

modules/Require.ycp
Provide installation on demand
This module is intended to replace the include file require.ycp, but that one still extsts for compatibility. If you change something here, check if also the other file needs changing.

Imports

  • Label
  • Mode
  • Mode
  • PackageAI
  • PackageCallbacksInit
  • Popup
  • Popup
  • Wizard

Global Functions

Local Variables

Local Functions

local target_initialized -> boolean

Has Pkg::TargetInit run?

local source_initialized -> boolean

Has Pkg::SourceStartCache run?

local last_op_canceled -> boolean

Was last operation canceled? Used to enhance the exit status to distinguish between package installation fail and installation canceled by user, as in the second case doesn't make much sense to display any error Is set to true when user canceled package installation, from RequireAndConflict* functions

global EnsureTargetInit () -> void

Ensure that Pkg:: calls work. This may become superfluous.

global EnsureSourceInit () -> void

Ensure that Pkg:: calls working with the installation sources work

global RunSuSEconfig () -> void

Run SuSE config, create new wizard dialog before it, close after it is finished

global LastOperationCanceled () -> boolean

Read-only interface for last_op_canceled Use immediately after calling some RequireAndTarget* function

Return value:
true if it was

global IsPackageAvailable (string package) -> boolean

Is a package available for installation?

Parameters:
package package name, without version or .rpm suffix
Return value:
true/false

global FooTarget () -> void

This is not a real function, just a docs placeholder

Most functions have two public variants: Foo and FooTarget. In normal mode they behave the same and act on the currently running system. In autoyast mode (Mode::config), FooTarget acts on the autoyast package list only and Foo acts both on the running system and the autoyast package list.

              |Normal AI
 -------------+----------
 Foo          |Pkg    AI, Pkg
 FooTarget    |Pkg    AI
Implementation: Foo and FooTarget call (private) FooPkg and FooAI according to the above table.

We need to access AutoinstSoftware, which will not be typcally installed. So we import it only in FooAI which are called if Mode::config.

local IsPackageInstalledPkg (string package) -> boolean

Is a package installed? Works on the current system.

Parameters:
package
See:
FooTarget

local IsPackageInstalledAI (string package) -> boolean

Is a package installed? Works on the target system.

Parameters:
package
See:
FooTarget

local AreAllPackagesInstalledPkg (list<string> packages) -> boolean

Are all of these packages installed? Works on the current system.

Parameters:
packages list of packages
Return value:
true/false
See:
FooTarget

local AreAllPackagesInstalledAI (list<string> packages) -> boolean

Are all of these packages installed? Works on the target system.

Parameters:
packages list of packages
Return value:
true/false
See:
FooTarget

global AreAllPackagesInstalled (list<string> packages) -> boolean

Are all of these packages installed? Use for required packages that you want installed. In both normal and autoyast modes, works on the current system. In autoyast mode, also works on the target system.

Parameters:
packages list of packages
Return value:
true/false
See:
FooTarget

global AreAllPackagesInstalledTarget (list<string> packages) -> boolean

Are all of these packages installed? Use for required packages that you want installed. In normal mode, works on the current system. In autoyast mode, works on the target system.

Parameters:
packages list of packages
Return value:
true/false
See:
FooTarget

global IsPackageInstalled (string package) -> boolean

This function is deprecated. Use AreAllPackagesInstalled or IsAnyPackageInstalled instead.

Obsolete! If required, use AreAllPackagesInstalled, if conflicting, use IsAnyPackageInstalled.

Parameters:
package

global IsPackageInstalledTarget (string package) -> boolean

Is a package installed? In normal mode, works on the current system. In autoyast mode, works on the target system.

Parameters:
package
See:
FooTarget

local IsAnyPackageInstalledAI (list<string> packages) -> boolean

Is any of these packages installed? Works on the target system.

Parameters:
packages list of packages
Return value:
true/false
See:
FooTarget

local IsAnyPackageInstalledPkg (list<string> packages) -> boolean

Is any of these packages installed? Works on the current system.

Parameters:
packages list of packages
Return value:
true/false
See:
FooTarget

global IsAnyPackageInstalled (list<string> packages) -> boolean

Is any of these packages installed? Use for conflicting packages that you want deleted. In both normal and autoyast modes, works on the current system. In autoyast mode, also works on the target system.

Parameters:
packages list of packages
Return value:
true/false
See:
FooTarget

global IsAnyPackageInstalledTarget (list<string> packages) -> boolean

Is any of these packages installed? Use for conflicting packages that you want deleted. In normal mode, works on the current system. In autoyast mode, works on the target system.

Parameters:
packages list of packages
Return value:
true/false
See:
FooTarget

local DoInstallAndRemovePkg (list<string> toinstall, list<string> toremove) -> boolean

Install required packages and remove conflicting packages. Works on the current system.

Parameters:
toinstall packages to install
toremove pacakges to remove
Return value:
success?
See:
FooTarget

local DoInstallAndRemoveAI (list<string> toinstall, list<string> toremove) -> boolean

Install required packages and remove conflicting packages. Works on the target system.

Parameters:
toinstall packages to install
toremove pacakges to remove
Return value:
success?
See:
FooTarget

global DoInstallAndRemove (list<string> toinstall, list<string> toremove) -> boolean

Install required packages and remove conflicting packages. In both normal and autoyast modes, works on the current system. In autoyast mode, also works on the target system.

Parameters:
toinstall packages to install
toremove pacakges to remove
Return value:
success?
See:
FooTarget

global DoInstallAndRemoveTarget (list<string> toinstall, list<string> toremove) -> boolean

Install required packages and remove conflicting packages. In normal mode, works on the current system. In autoyast mode, works on the target system.

Parameters:
toinstall packages to install
toremove pacakges to remove
Return value:
success?
See:
FooTarget

local RequireAndConflictPkg (list<string> require, list<string> conflict, string help, string continue_button, string cancel_button) -> boolean

Ensure that all required packages are installed and no conflicting packages are installed. Works on the current system and the user is presented an explanation and asked to confirm the changes.

Parameters:
require Required packages
conflict Conflicting packages
help Explanation (rich text). %1 and %2 represent a comma separated list of packages to be installed/removed
continue_button
cancel_button
Return value:
installation successful?
See:
FooTarget

local RequireAndConflictAI (list<string> require, list<string> conflict) -> boolean

Ensure that all required packages are installed and no conflicting packages are installed. Works on the target system and nothing is displayed.

Parameters:
require Required packages
conflict Conflicting packages
Return value:
installation successful?
See:
FooTarget

global RequireAndConflictButtons (list<string> require, list<string> conflict, string help, string continue_button, string cancel_button) -> boolean

Like RequireAndConflict but you can specify button texts in place of the default Continue and Cancel

Parameters:
require
conflict
help
continue_button Text which is going to be on the left-hand button
cancel_button Text which is going to be on the right-hand button
Return value:
installation successful?
See:
RequireAndConflict

global RequireAndConflictTargetButtons (list<string> require, list<string> conflict, string help, string continue_button, string cancel_button) -> boolean

Like RequireAndConflictTarget but you can specify button texts in place of the default Continue and Cancel

Parameters:
require
conflict
help
continue_button Text which is going to be on the left-hand button
cancel_button Text which is going to be on the right-hand button
Return value:
installation successful?
See:
RequireAndConflictTarget

global RequireAndConflict (list<string> require, list<string> conflict, string help) -> boolean

Ensure that all required packages are installed and no conflicting packages are installed. In both normal and autoyast modes, works on the current system. In autoyast mode, also works on the target system. If the current system is affected, the user is presented an explanation and asked to confirm the changes. For the target system, nothing is displayed.

Parameters:
require Required packages
conflict Conflicting packages
help Explanation (rich text). %1 and %2 represent a comma separated list of packages to be installed/removed
Return value:
installation successful?
See:
FooTarget

global RequireAndConflictTarget (list<string> require, list<string> conflict, string help) -> boolean

Ensure that all required packages are installed and no conflicting packages are installed. In normal mode, works on the current system and the user is presented an explanation and asked to confirm the changes. In autoyast mode, works on the target system and nothing is displayed.

Parameters:
require Required packages
conflict Conflicting packages
help Explanation (rich text). %1 and %2 represent a comma separated list of packages to be installed/removed
Return value:
installation successful?
See:
FooTarget

YaST2 Developers Documentation