Package Source 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
Read all source-manager settings
- Return value:
-
true on success
Commit changed sources
Write all source-manager settings
- Return value:
-
true on success
Get all source-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 source-manager settings to a single map (For use by autoinstallation.)
- Return value:
-
Dumped settings (later acceptable by Import ())
Get Source ID by index
- Parameters:
-
idx
Set current used source URL by index
- Parameters:
-
idx
Get Source ID when only URL is known
- Parameters:
-
url
Gather Source Metadata
- Parameters:
-
source
Create a Source from an URL
- Parameters:
-
url
Delete Source by Source ID
- Parameters:
-
SrcId
Delete Source by Source Index
- Parameters:
-
idx
Delete Source by Source URL
- Parameters:
-
url
Create Summary Item
- Parameters:
-
index source
Create Source Item for Overview
- Parameters:
-
index source
Handle Multiple source 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'
- 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 installation source 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 source database. #170113 The calls may be nested.
Other processes may access the source database again
Checks whether ZMD is running, starts it when isn't. Checks whether a ZYPP source is listed in the ZMD services, adds one if it is missing. Everything is done via the .background agent with timeout (number in seconds).
- Return value:
-
whether the syncing succeeds
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"]
- Return value:
-
For existing sources, get a mapping from the alias to the id
Extract an alias parameter from the URL and check whether we have such a source already.
- Parameters:
-
url a source with an alias parameter (actually optional) alias_to_id a premade mapping, @see get_alias_to_id
- Return value:
-
the source 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 update sources to add
- Return value:
-
a list of added URLs