3. AddOnProduct

This module provides integration of the add-on products

3.1. Authors

  • Jiri Srain <jsrain@suse.de>

  • Lukas Ocilka <locilka@suse.cz>

3.2. Summary of Module Globals

List of Global Functions

  • AcceptedLicenseAndInfoFile - 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.

  • AddOnMode - Returns whether add-on product got as parameter (source id) replaces some already installed add-on or whether it is a new installation. Repositories and target have to be initialized.

  • AddPreselectedAddOnProducts - Auto-integrate add-on products in specified file (usually add_on_products file)

  • Disintegrate - Opposite to Integrate()

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

  • Export - Returns map describing all used add-ons.

  • GetAbsoluteURL - 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).

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

  • PrepareForRegistration - 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.

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

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

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

  • RegisterAddOnProduct - Calls registration client if needed.

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

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

  • SetPreselectedAddOnProductsType - Sets an add_on_products file type ("plain" or "xml")

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

  • UpdateInstSys - Adapts the inst-sys from the tarball

List of Global Variables

  • add_on_products - List of all selected repositories

  • last_ret - return value of last step in the product adding workflow

  • src_id - ID of currently added repository for the add-on product

3.3. Global Functions

3.3.1. AcceptedLicenseAndInfoFile

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.

Function parameters

  • integer src_id

Return value

  • boolean - whether the license has been accepted

3.3.2. AddOnMode

Returns whether add-on product got as parameter (source id) replaces some already installed add-on or whether it is a new installation. Repositories and target have to be initialized.

Function parameters

  • integer source_id

Return value

  • string

3.3.3. AddPreselectedAddOnProducts

Auto-integrate add-on products in specified file (usually add_on_products file)

Function parameters

  • string filelist

Return value

  • boolean - true on exit

 Format of /add_on_products.xml file on media root:
 &lt;?xml version="1.0"?>
 <add_on_products xmlns="http://www.suse.com/1.0/yast2ns"
	xmlns:config="http://www.suse.com/1.0/configns">
	<product_items config:type="list">
		<product_item>
			&lt;!-- Product name visible in UI when offered to user (optional item) -->
			<name>Add-on Name to Display</name>
			&lt;!-- Product URL (mandatory item) -->
			<url>http://product.repository/url/</url>
			&lt;!-- Product path, default is "/" (optional item) -->
			<path>/relative/product/path</path>
			&lt;!--
				List of products to install from media, by default all products
				from media are installed (optional item)
			-->
			<install_products config:type="list">
				&lt;!--
					Product to install - matching the metadata product 'name'
					(mandatory to fully define 'install_products')
				-->
				<product>Product-ID-From-Repository</product>
				<product>...</product>
			</install_products>
			&lt;!--
				If set to 'true', user is asked whether to install this product,
				default is 'false' (optional)
			-->
			<ask_user config:type="boolean">true</ask_user>
			&lt;!--
				Connected to 'ask_user', sets the default status of product,
				default is 'false' (optional)
			-->
			<selected config:type="boolean">true</selected>
		</product_item>
		<product_item>
			...
		</product_item>
	</product_items>
 </add_on_products>

See also:

  • FATE #303675: Support several add-ons on standard medium

3.3.4. Disintegrate

Opposite to Integrate()

Function parameters

  • integer srcid

Return value

  • void

3.3.5. DoInstall

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

Return value

  • symbol - the result symbol from wizard sequencer

3.3.6. Export

Returns map describing all used add-ons.

Return value

  • map -

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>

3.3.7. GetAbsoluteURL

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

Function parameters

  • string base_url

  • string url

Return value

  • string - absolute_url

Example 1. 

   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/"


3.3.8. Integrate

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

Function parameters

  • integer srcid

Return value

  • boolean - true on success

3.3.9. PrepareForRegistration

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.

Function parameters

  • integer src_id

Return value

  • void

3.3.10. ProcessRegistration

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

Return value

  • boolean - if requested

3.3.11. ReIntegrateFromScratch

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

Return value

  • boolean

3.3.12. ReadTmpExportFilename

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

Return value

  • boolean

See also:

  • bugzilla #187558

3.3.13. RegisterAddOnProduct

Calls registration client if needed.

Function parameters

  • integer src_id

Return value

  • void

3.3.14. RemoveRegistrationFlag

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

Function parameters

  • integer src_id

Return value

  • void

3.3.15. RereadAllSCRAgents

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

Return value

  • void

See also:

  • bugzilla #239055, #245508

3.3.16. SetPreselectedAddOnProductsType

Sets an add_on_products file type ("plain" or "xml")

Function parameters

  • string type

Return value

  • void

See also:

  • FATE #303675

3.3.17. TmpExportFilename

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

Return value

  • string

See also:

  • bugzilla #187558

3.3.18. UpdateInstSys

Adapts the inst-sys from the tarball

Function parameters

  • string filename

Return value

  • boolean - true on success

3.4. Global Variables

3.4.1. add_on_products

List of all selected repositories

add_on_products = [
   $[
     "media" : 4, // ID of the source
     "product_dir" : "/",
     "product" : "openSUSE version XX.Y",
     "autoyast_product" : "'PRODUCT' tag for AutoYaST Export",
   ],
   ...
 ]

3.4.2. last_ret

return value of last step in the product adding workflow

3.4.3. src_id

ID of currently added repository for the add-on product

3.5. Module Requirements

3.5.1. Module Imports

  • Directory
  • FileUtils
  • FileUtils
  • Icon
  • InstShowInfo
  • Label
  • Language
  • Mode
  • Mode
  • PackageCallbacks
  • PackagesProposal
  • Popup
  • ProductControl
  • ProductFeatures
  • ProductLicense
  • Report
  • Stage
  • String
  • URL
  • Wizard
  • WorkflowManager
  • XML

3.5.2. Module Includes