Package Repository Management |
modules/SourceManager.ycp |
SourceManager settings, input and output functions | |
|
|
This module has an unstable interface. |
Prototypes
Data was modified?
Abort function return boolean return true if abort
Abort function
- Return value:
-
return true if abort
Data was modified?
- Return value:
-
true if modified
Return ZMD synchronization flag.
- Return value:
-
true/false = ZMD sync is enabled/disabled, nil = unknown (not configured/read)
Read ZMD sync flag from the persistent store (/var/lib/YaST2/inst_source_config.ycp)
- Return value:
-
true = success, false = read/parse error or the file doesn't exist
Set ZMD synchronization flag.
- Parameters:
-
sync_enabled true/false = enable/disable ZMD sync, nil = unknown (not configured/read)
Write ZMD sync flag to the persistent store
- Return value:
-
true = success
Read all source-manager settings
- Return value:
-
true on success
Commit changed repositories
Write all repository-manager settings
- Return value:
-
true on success
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
Dump the repository-manager settings to a single map (For use by autoinstallation.)
- Return value:
-
Dumped settings (later acceptable by Import ())
Get Repository ID by index
- Parameters:
-
idx
Set current used repository URL by index
- Parameters:
-
idx
Get Repository ID when only URL is known
- Parameters:
-
url
Gather Repository Metadata
- Parameters:
-
source
Create a repository from an URL
- Parameters:
-
url
Delete repository by Repository ID
- Parameters:
-
SrcId
Delete Repository by the repository index
- Parameters:
-
idx
Delete Repository by repository URL
- Parameters:
-
url
Create Summary Item
- Parameters:
-
index source
Create Repository Item for Overview
- Parameters:
-
index source
Handle Multiple repositories URLs (order/instorder)
- Parameters:
-
url
Create a textual summary and a list of unconfigured cards
- Return value:
-
summary of the current configuration
Create an overview table with all configured cards
- Return value:
-
table items
Runs a bash command with timeout.
Structure Returns map $[
"exit" : int_return_code, "stdout" : [ "script", "stdout", "lines" ], "stderr" : [ "script", "stderr", "lines" ], ]
- Parameters:
-
run_command what to run log_command what to log (passwords masked) script_time_out in sec.
- Return value:
-
with out, err and ret_code
Run - with a timeout - on dumb terminal to disable colors etc - using 'exit $?' because of buggy behavior '.background vs. ZMD' (FIXME still needed???)
- Parameters:
-
command a command log_command a command to log seconds timeout
- Return value:
-
with out, err and ret_code
Run with a long timeout
- Parameters:
-
command a command log_command a command to log
- Return value:
-
with out, err and ret_code
Run with a long timeout
- Parameters:
-
command a command
- Return value:
-
with out, err and ret_code
path to ZMD CLI
Detect whether ZMD is running
Force calling rug on next IsUrlKnownToZMD
Update the cache after a successful rug service-{add,delete} call
- Parameters:
-
adding add url or delete it url what
Whether the URL is known to rug service-list. The known services are cached, the caller should use ResetKnownServiceCache if appropriate (each time when coming from outside this module at least)
- Parameters:
-
url
- Return value:
-
or nil if determining the status failed
Get a ZMD preference
- Parameters:
-
pref see "rug get-prefs"
Set a ZMD preference
- Parameters:
-
pref value
Adds a ZYPP service into ZMD
- Parameters:
-
src_id repository id adding
- Return value:
-
success
Start ZMD if it was not running Report::Error on failure
- Return value:
-
an opaque handle
- Parameters:
-
zmd_handle what ZMDStart returned
- Return value:
-
can we work with ZMD now
Restore the status before ZMDStart Report::Error on failure
- Parameters:
-
zmd_handle what ZMDStart returned
Start a section where other processes (such as ZMD helpers) should not access the repository database. #170113 The calls may be nested.
Other processes may access the repository database again
Checks whether ZMD is running, starts it when isn't. Checks whether a ZYPP repository is listed in the ZMD services, adds one if it is missing. Everything is done via the .process agent with timeout (number in seconds).
- Return value:
-
whether the syncing succeeds
Sync the changed repositories to ZENworks
- Parameters:
-
added_src_ids ids of repositories that were added deleted_src_ids ids of repositories that were deleted
- Return value:
-
success
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"]
- Parameters:
-
attr SourceGeneralData item
- Return value:
-
For existing repositories, get a mapping from an attribute to the id
- Return value:
-
For existing repositories, get a mapping from the alias to the id
- Return value:
-
For existing repositories, get a mapping from the URL to the id
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
Used by registration. This is really hairy because we simultaneously add them to zypp and ZENworks, but not if they are not signed. (thus being better than inst_source)
- Parameters:
-
urls URLs to add
- Return value:
-
a list of added URLs
- Parameters:
-
message
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
Finds the biggest temporary directory and uses it as packager download area.