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
  • String
  • URL
  • Wizard
  • WorkflowManager
  • 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 repositories

Structure add_on_products = [

   $[
     "media" : 4, // ID of the source
     "product_dir" : "/",
     "product" : "openSUSE version XX.Y",
     "autoyast_product" : "'PRODUCT' tag for AutoYaST Export",
   ],
   ...
 ]
global src_id -> integer

ID of currently added repository for the add-on product

global last_ret -> symbol

return value of last step in the product adding workflow

global GetAbsoluteURL (string base_url, string url) -> string

Returns an absolute URL from base + relative url. Relative URL needs to start with 'reulrl://' othewise it is not considered being relative and it's returned as it is (just the relative_url parameter).

Parameters:
base_url
url
Return value:
absolute_url
Example

   AddOnProduct::GetAbsoluteURL (
     "http://www.example.org/some%20dir/another%20dir",
     "relurl://../AnotherProduct/"
   ) -> "http://www.example.org/some%20dir/AnotherProduct/"
   AddOnProduct::GetAbsoluteURL (
     "username:password@ftp://www.example.org/dir/",
     "relurl://./Product_CD1/"
   ) -> "username:password@ftp://www.example.org/dir/Product_CD1/"
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
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 repository 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
local patterns_preselected_by_addon -> map <integer, list <string> >

Every Add-On can preselect some patterns. Only patterns that are not selected/installed yet will be used.

Structure $[

   src_id : [
     "pattern_1", "pattern_2", "pattern_6"
   ]
 ]
local HandleProductPATTERNS (integer srcid) -> void

Function checks whether the product content file contains PATTERNS tag and pre-selects patterns listed there.

Parameters:
srcid
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 ID of the repository
Return value:
true on success
global Disintegrate (integer srcid) -> void

Opposite to Integrate()

Parameters:
srcid integer the ID of the repository
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 (usually add_on_products file)

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

Returns map describing all used add-ons.

Structure This is an XML file created from exported map:

 <add-on>
   <add_on_products config:type="list">
     <listentry>
       <media_url>ftp://server.name/.../</media_url>
       <product>NEEDS_TO_MATCH_"PRODUCT"_TAG_FROM_content_FILE!</product>
       <product_dir>/</product_dir>
     </listentry>
     ...
   </add_on_products>
 </add-on>
Return value:
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