246. SourceManager

SourceManager settings, input and output functions

246.1. Summary of Module Globals

List of Global Functions

  • Abort - Abort function

  • AbortFunction - Abort function return boolean return true if abort

  • AddUpdateSources - 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)

  • AskForCD -

  • CommitSources - Commit changed repositories

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

  • GetSrcIdByIndex - Get Repository ID by index

  • GetSyncFlag - Return ZMD synchronization flag.

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

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

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

  • Lock - Start a section where other processes (such as ZMD helpers) should not access the repository database. #170113 The calls may be nested.

  • Modified - Prototypes

  • Modified - Data was modified?

  • Overview - Create an overview table with all configured cards

  • Read - Read all source-manager settings

  • ReadSyncFlag - Read ZMD sync flag from the persistent store (/var/lib/YaST2/inst_source_config.ycp)

  • RunCommandWithTimeout - Runs a bash command with timeout.

  • RunDumbTimeout - Run - with a timeout - on dumb terminal to disable colors etc - using 'exit $?' because of buggy behavior '.background vs. ZMD' (FIXME still needed???)

  • SetSyncFlag - Set ZMD synchronization flag.

  • SetUrlByIndex - Set current used repository URL by index

  • SourceData - Gather Repository Metadata

  • Summary - Create a textual summary and a list of unconfigured cards

  • SyncAddedAndDeleted - Sync the changed repositories to ZENworks

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

  • Unlock - Other processes may access the repository database again

  • Write - Write all repository-manager settings

  • WriteSyncFlag - Write ZMD sync flag to the persistent store

  • createSource - Create a repository from an URL

  • deleteSourceByIndex - Delete Repository by the repository index

  • deleteSourceBySrcId - Delete repository by Repository ID

  • deleteSourceByUrl - Delete Repository by repository URL

  • getSourceId - Get Repository ID when only URL is known

List of Global Variables

246.2. Global Functions

246.2.1. Abort

Abort function

Return value

  • boolean - return true if abort

246.2.2. AbortFunction

Abort function return boolean return true if abort

Return value

  • boolean

246.2.3. AddUpdateSources

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)

Function parameters

  • list<string> urls

Return value

  • list<string> - a list of added URLs

246.2.4. AskForCD

Function parameters

  • string message

Return value

  • boolean

246.2.5. CommitSources

Commit changed repositories

Return value

  • boolean

246.2.6. Export

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

Return value

  • map - Dumped settings (later acceptable by Import ())

246.2.7. GetSrcIdByIndex

Get Repository ID by index

Function parameters

  • integer idx

Return value

  • integer

246.2.8. GetSyncFlag

Return ZMD synchronization flag.

Return value

  • boolean - true/false = ZMD sync is enabled/disabled, nil = unknown (not configured/read)

246.2.9. Import

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

Function parameters

  • map settings

Return value

  • boolean - True on success

246.2.10. InstInitSourceMoveDownloadArea

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

Return value

  • void

246.2.11. InstallationSourceOnPartition

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

  • string - partition name

246.2.12. Lock

Start a section where other processes (such as ZMD helpers) should not access the repository database. #170113 The calls may be nested.

Return value

  • void

246.2.13. Modified

Prototypes

Return value

  • boolean

246.2.14. Modified

Data was modified?

Return value

  • boolean - true if modified

246.2.15. Overview

Create an overview table with all configured cards

Return value

  • list - table items

246.2.16. Read

Read all source-manager settings

Return value

  • boolean - true on success

246.2.17. ReadSyncFlag

Read ZMD sync flag from the persistent store (/var/lib/YaST2/inst_source_config.ycp)

Return value

  • boolean - true = success, false = read/parse error or the file doesn't exist

246.2.18. RunCommandWithTimeout

Runs a bash command with timeout.

Function parameters

  • string run_command

  • string log_command

  • integer script_time_out

Return value

  • map - with out, err and ret_code

Returns map $[
     "exit" : int_return_code,
     "stdout"  : [ "script", "stdout", "lines" ],
     "stderr"  : [ "script", "stderr", "lines" ],
 ]

246.2.19. RunDumbTimeout

Run - with a timeout - on dumb terminal to disable colors etc - using 'exit $?' because of buggy behavior '.background vs. ZMD' (FIXME still needed???)

Function parameters

  • string command

  • string log_command

  • integer seconds

Return value

  • map - with out, err and ret_code

246.2.20. SetSyncFlag

Set ZMD synchronization flag.

Function parameters

  • boolean sync_enabled

Return value

  • void

246.2.21. SetUrlByIndex

Set current used repository URL by index

Function parameters

  • integer idx

Return value

  • void

246.2.22. SourceData

Gather Repository Metadata

Function parameters

  • integer source

Return value

  • map

246.2.23. Summary

Create a textual summary and a list of unconfigured cards

Return value

  • list - summary of the current configuration

246.2.24. SyncAddedAndDeleted

Sync the changed repositories to ZENworks

Function parameters

  • list<integer> added_src_ids

  • list<integer> deleted_src_ids

Return value

  • boolean - success

246.2.25. SyncYaSTInstSourceWithZMD

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

  • boolean - whether the syncing succeeds

246.2.26. Unlock

Other processes may access the repository database again

Return value

  • void

246.2.27. Write

Write all repository-manager settings

Return value

  • boolean - true on success

246.2.28. WriteSyncFlag

Write ZMD sync flag to the persistent store

Return value

  • boolean - true = success

246.2.29. createSource

Create a repository from an URL

Function parameters

  • string url

Return value

  • symbol

246.2.30. deleteSourceByIndex

Delete Repository by the repository index

Function parameters

  • integer idx

Return value

  • void

246.2.31. deleteSourceBySrcId

Delete repository by Repository ID

Function parameters

  • integer SrcId

Return value

  • void

246.2.32. deleteSourceByUrl

Delete Repository by repository URL

Function parameters

  • string url

Return value

  • void

246.2.33. getSourceId

Get Repository ID when only URL is known

Function parameters

  • string url

Return value

  • integer

246.3. Global Variables

246.3.1. modified

Data was modified?

246.3.2. proposal_valid

246.4. Module Requirements

246.4.1. Module Imports

  • Arch
  • FileUtils
  • HTML
  • InstURL
  • Installation
  • Label
  • Linuxrc
  • Message
  • Mode
  • Popup
  • Progress
  • Report
  • Stage
  • String
  • String
  • SuSEFirewall
  • Summary
  • URL

246.4.2. Module Includes