AddOnProduct |
AddOnProduct.ycp |
| This module provides integration of the add-on products | |
|
|
|
This module has an unstable interface. |
Imports
StructuresGlobal VariablesGlobal Functions
Local Variables
Local Functions |
ID for cache in the inst-sys
System proposals have already been prepared for merging?
System workflows have already been prepared for merging?
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",
],
...
]
ID of currently added repository for the add-on product
return value of last step in the product adding workflow
Returns the current add-on installation mode.
- Return value:
-
current mode
- See
-
SetMode()
Sets internal add-on installation mode to either "installation" or "update". Mode is used later when deciding which part of the installation.xml to use.
- Parameters:
-
new_mode
- See
-
GetMode();
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.
- Parameters:
-
source_id
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/"
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
New add-on product might add also new agents. Functions Rereads all available agents.
Remove the /y2update directory from the system
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
Contains list of repository IDs that request registration
Returns whether registration is requested by at least one of used Add-On products.
- Return value:
-
if requested
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
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
Calls registration client if needed.
- Parameters:
-
src_id
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
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"
]
]
Function checks whether the product content file contains PATTERNS tag and pre-selects patterns listed there.
- Parameters:
-
srcid
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
Opposite to Integrate()
- Parameters:
-
srcid integer the ID of the repository
Some product(s) were removed, reintegrating their control files from scratch.
Sets an add_on_products file type ("plain" or "xml")
- Parameters:
-
type
- See
-
FATE #303675
Reads temporary add_on_products file, parses supported products, merges base URL if products use relative URL and returns list of maps defining additional products to add.
[
// product defined with URL and additional path (typically "/")
$["url":(string) url, "path":(string) path]
// additional list of products to install
// media URL can contain several products at once
$["url":(string) url, "path":(string) path, "install_products":(list <string>) pti]
]
- Parameters:
-
parse_file base_url
- Return value:
-
of products to add
- See
-
FATE #303675
Auto-integrate add-on products in specified file (usually add_on_products file)
Format of /add_on_products.xml file on media root: <?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> <!-- Product name visible in UI when offered to user (optional item) --> <name>Add-on Name to Display</name> <!-- Product URL (mandatory item) --> <url>http://product.repository/url/</url> <!-- Product path, default is "/" (optional item) --> <path>/relative/product/path</path> <!-- List of products to install from media, by default all products from media are installed (optional item) --> <install_products config:type="list"> <!-- Product to install - matching the metadata product 'name' (mandatory to fully define 'install_products') --> <product>Product-ID-From-Repository</product> <product>...</product> </install_products> <!-- If set to 'true', user is asked whether to install this product, default is 'false' (optional) --> <ask_user config:type="boolean">true</ask_user> <!-- 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>
- Parameters:
-
filelist string a file containing a list of add-on products to integrate
- Return value:
-
true on exit
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:
-
Returns the path where Add-Ons configuration is stored during the fist stage installation. This path reffers to the installed system.
- See
-
bugzilla #187558
Reads the Add-Ons configuration stored on disk during the first stage installation.
- See
-
bugzilla #187558