YaST2 Developers Documentation: Package Repository Management

Package Repository Management

modules/SourceManager.ycp
SourceManager settings, input and output functions
  • Anas Nashif
  • Lukas Ocilka
  • Martin Vidner
  • Status: Work in Progress

This module has an unstable interface.

Representation of the configuration of source-manager. Input and output routines.

Imports

  • HTML
  • Installation
  • Label
  • Linuxrc
  • Mode
  • Popup
  • Progress
  • Report
  • String
  • Summary
  • URL

Global Variables

Global Functions

Local Functions

global Modified () -> boolean

Prototypes

global modified -> boolean

Data was modified?

global proposal_valid -> boolean

global AbortFunction () -> boolean

Abort function return boolean return true if abort

global Abort () -> boolean

Abort function

Return value:
return true if abort
global Modified () -> boolean

Data was modified?

Return value:
true if modified
global Read () -> boolean

Read all source-manager settings

Return value:
true on success
global CommitSources () -> boolean

Commit changed repositories

global Write () -> boolean

Write all repository-manager settings

Return value:
true on success
global Import (map settings) -> boolean

Get all repository-manager settings from the first parameter (For use by autoinstallation.)

Parameters:
settings The YCP structure to be imported.
Return value:
True on success
global Export () -> map

Dump the repository-manager settings to a single map (For use by autoinstallation.)

Return value:
Dumped settings (later acceptable by Import ())
global GetSrcIdByIndex (integer idx) -> integer

Get Repository ID by index

Parameters:
idx
global SetUrlByIndex (integer idx) -> void

Set current used repository URL by index

Parameters:
idx
global getSourceId (string url) -> integer

Get Repository ID when only URL is known

Parameters:
url
global SourceData (integer source) -> map

Gather Repository Metadata

Parameters:
source
global createSource (string url) -> symbol

Create a repository from an URL

Parameters:
url
global deleteSourceBySrcId (integer SrcId) -> void

Delete repository by Repository ID

Parameters:
SrcId
global deleteSourceByIndex (integer idx) -> void

Delete Repository by the repository index

Parameters:
idx
global deleteSourceByUrl (string url) -> void

Delete Repository by repository URL

Parameters:
url
local createItem (integer index, map source) -> string

Create Summary Item

Parameters:
index
source
local createOverviewItem (integer index, map source) -> term

Create Repository Item for Overview

Parameters:
index
source
local HandleMultipleSources (string url) -> boolean

Handle Multiple repositories URLs (order/instorder)

Parameters:
url
global Summary () -> list

Create a textual summary and a list of unconfigured cards

Return value:
summary of the current configuration
global Overview () -> list

Create an overview table with all configured cards

Return value:
table items
Info:

Obsoleted (empty implementation), ZMD (ZLM7.3) on sle11 supports only HTTP and FTP repositories, sync would fail for other types. See bnc#480845 for more details.

Parameters:
added_src_ids dummy parameter
deleted_src_ids dummy parameter
Return value:
success - always true
local ParseUrlQuery (string query) -> map<string, string>

Parse a URL query (already unescaped) to a map. If no equal sign, the value will be nil.

Parameters:
query foo=bar&baz=qux
Return value:
$["foo": "bar", "baz": "qux"]
local get_attr_to_id (string attr) -> map<string,integer>

Parameters:
attr SourceGeneralData item
Return value:
For existing repositories, get a mapping from an attribute to the id
local get_alias_to_id () -> map<string,integer>

Return value:
For existing repositories, get a mapping from the alias to the id
local get_url_to_id () -> map<string,integer>

Return value:
For existing repositories, get a mapping from the URL to the id
local SourceByAliasOrUrl (string url, map<string,integer> alias_to_id, map<string,integer> url_to_id) -> integer

Extract an alias parameter from the URL and check whether we have such a repository already.

Parameters:
url a repository with an alias parameter (actually optional)
alias_to_id a premade mapping, @see get_alias_to_id
url_to_id
Return value:
the repository id or -1
global AddUpdateSources (list<string> urls) -> list<string>

Used by registration. ZMD sync has been disabled - ZLM7.3 on sle11 supports only HTTP and FTP repositories, sync would fail for other types. See bnc#480845 for more details.

Parameters:
urls URLs to add
Return value:
a list of added URLs
global AskForCD (string message) -> map<string,any>

Parameters:
message
global InstallationSourceOnPartition () -> string

Function returns the partiton name which is used as a repository for the installation (IF any partition is used as a repository for installation, of course). Otherwise it returns an empty string "". See bugzilla #208222 for more information.

Return value:
partition name
global InstInitSourceMoveDownloadArea () -> void

Finds the biggest temporary directory and uses it as packager download area.