YaST2 Developers Documentation: AddOnProduct

AddOnProduct

AddOnProduct.ycp
This module provides integration of the add-on products

This module has an unstable interface.

Imports

  • Directory
  • FileUtils
  • FileUtils
  • InstShowInfo
  • Label
  • Language
  • Mode
  • Popup
  • ProductControl
  • ProductFeatures
  • ProductLicense
  • Report
  • Wizard
  • XML

Structures

Global Variables

Global Functions

Local Variables

Local Functions

local src_cache_id -> integer

ID for cache in the inst-sys

local system_proposals_prepared -> boolean

System proposals have already been prepared for merging?

local system_workflows_prepared -> boolean

System workflows have already been prepared for merging?

global add_on_products -> list<map<string,any> >

List of all selected sources

Structure add_on_products = [

   $[
     "media" : 4, // ID of the source
     "product_dir" : "/",
     "product" : "openSUSE version XX.Y",
   ],
   ...
 ]
global src_id -> integer

ID of currently added source for the add-on product

global last_ret -> symbol

return value of last step in the product adding workflow

global control_files_to_add -> list<string>

List of used control files, to be copied to target system

global finish_steps_before_chroot -> list<string>

Items if add-on product to be performed at the start of inst_finish

global finish_steps_after_chroot -> list<string>

Items of add-on product to be performed after swictching to chroot

global finish_steps_before_umount -> list<string>

Items of add-on product to be performed before unmounting disks

global UpdateInstSys (string filename) -> boolean

Adapts the inst-sys from the tarball

Parameters:
filename string the filename with the tarball to use to the update
Return value:
true on success
local PrepareProposals (list<map> proposals) -> list<map>

Check all proposals, split those ones which have multiple modes or architectures or stages into multiple proposals

Parameters:
proposals a list of proposals
Return value:
a list of updated proposals
local PrepareSystemProposals () -> void

Check all proposals, split those ones which have multiple modes or architectures or stages into multiple proposals. Works with base product proposals.

local PrepareWorkflows (list<map> workflows) -> list<map>

Check all workflows, split those ones which have multiple modes or architectures or stages into multiple workflows

Parameters:
workflows a list of workflows
Return value:
a list of updated workflows
local PrepareSystemWorkflows () -> void

Check all workflows, split those ones which have multiple modes or architectures or stages into multiple worlflows. Works with base product workflows.

global StoreInitialSettings () -> void

Stores the initial settings for workflows, proposals, inst_finish, clone_modules to be able to start from scratch when some part of the workflow modified by add-on is removed.

local ResetSystemWorkflowsAndProposals () -> void

Reset all the workflow and proposals modifications done by Add-on products.

See
StoreInitialSettings()
local ReplaceProposalModule (map proposal, string old, list<string> new) -> map

Replace a module in a proposal with a set of other modules

Parameters:
proposal a map describing the proposal
old string the old item to be replaced
new a list of items to be put into instead of the old one
Return value:
a map with the updated proposal
local MergeProposal (map base, map addon, string prod_name, string domain) -> map

Merge add-on proposal to a base proposal

Parameters:
base map the base product proposal
addon map the proposal of the addon productA
prod_name a name of the add-on product
domain
Return value:
merged proposals
local UpdateProposals (list<map> proposals, string prod_name, string domain) -> boolean

Update system proposals according to proposal update metadata

Parameters:
proposals a list of update proposals
prod_name string the product name (used in case of tabs)
domain string the text domain (for translations)
Return value:
true on success
local ReplaceWorkflowModule (map workflow, string old, list<map> new, string domain, boolean keep) -> map

Replace a module in a workflow with a set of other modules

Parameters:
workflow a map describing the workflow
old string the old item to be replaced
new a list of items to be put into instead of the old one
domain string a text domain
keep boolean true to keep original one (and just insert before)
Return value:
a map with the updated workflow
local MergeWorkflow (map base, map addon, string prod_name, string domain) -> map

Merge add-on workflow to a base workflow

Parameters:
base map the base product workflow
addon map the workflow of the addon product
prod_name a name of the add-on product
domain
Return value:
merged workflows
local UpdateWorkflows (list<map> workflows, string prod_name, string domain) -> boolean

Update system workflows according to workflow update metadata

Parameters:
workflows a list of update workflows
prod_name string the product name (used in case of tabs)
domain string the text domain (for translations)
Return value:
true on success
global RedrawWizardSteps () -> boolean

Redraw the wizard steps bar

Return value:
true on success
local UpdateInstFinish (map<string,list<string> > additional_steps) -> boolean

Add specified steps to inst_finish Just modifies internal variables, inst_finish grabs them itself

Parameters:
additional_steps a map specifying the steps to be added
Return value:
true on success
local UpdateInstallation (map update_file, string name, string domain) -> boolean

Adapts the installation workflow according to specified XML file

Parameters:
update_file a map containing the add-on product control file
name string the name of the add-on product
domain string the text domain for the add-on product
Return value:
true on success
local AddNewProposals (list<map> proposals) -> boolean

Add new defined proposal to the list of system proposals

Parameters:
proposals a lsit of proposals to be added
Return value:
true on success
local Replaceworkflows (list<map> workflows) -> boolean

Replace workflows for 2nd stage of installation

Parameters:
workflows a list of the workflows
Return value:
true on success
local UpdateProductInfo (map update_file) -> boolean

Update product options

Parameters:
update_file a map containing update control file
Return value:
true on success
global RereadAllSCRAgents () -> void

New add-on product might add also new agents. Functions Rereads all available agents.

See
bugzilla #239055, #245508
local CleanY2Update () -> void

Remove the /y2update directory from the system

global AcceptedLicenseAndInfoFile (integer src_id) -> boolean

Show /media.1/info.txt file in a pop-up message if such file exists. Show license if such exists and return whether users accepts it. Returns 'nil' when did not succed.

Parameters:
src_id
Return value:
whether the license has been accepted
local addons_requesting_registration -> list <integer>

Contains list of source IDs that request registration

global ProcessRegistration () -> boolean

Returns whether registration is requested by at least one of used Add-On products.

Return value:
if requested
global RemoveRegistrationFlag (integer src_id) -> void

Add-On product might have been added into products requesting registration. This pruduct has been removed (during configuring list of add-on products).

Parameters:
src_id
global PrepareForRegistration (integer src_id) -> void

Checks whether the content file of the add-on has a flag REGISTERPRODUCT set to "true" or "yes". If it has, product is added into list of pruducts that need registration. Cached content file is used if possible.

Parameters:
src_id
global RegisterAddOnProduct (integer src_id) -> void

Calls registration client if needed.

Parameters:
src_id
global DoInstall () -> symbol

Do installation of the add-on product within an installed system srcid is got via AddOnProduct::src_id

Return value:
the result symbol from wizard sequencer
global WFIntegrate (string filename) -> boolean

Integrate the changes in the workflow

Parameters:
filename string filename of the control file (local filename)
Return value:
true on success
global Integrate (integer srcid) -> boolean

Integrate the add-on product to the installation workflow, including preparations for 2nd stage and inst-sys update

Parameters:
srcid integer the source ID of the installation source
Return value:
true on success
global RemoveAddOnControlFile (integer srcid) -> boolean

Removes (from disk cache) a control file which was included in the add-on product.

Parameters:
srcid
global ReIntegrateFromScratch () -> boolean

Some product(s) were removed, reintegrating their control files from scratch.

global AddPreselectedAddOnProducts (string filelist) -> boolean

Auto-integrate add-on products in specified file

Parameters:
filelist string a file containing a list of add-on products to integrate
Return value:
true on exit
global TmpExportFilename () -> string

Returns the path where Add-Ons configuration is stored during the fist stage installation. This path reffers to the installed system.

See
bugzilla #187558
global ReadTmpExportFilename () -> boolean

Reads the Add-Ons configuration stored on disk during the first stage installation.

See
bugzilla #187558