| YaST2 Developers Documentation: Pkg:: built-in functions | ![]() |
![]() |
Pkg:: built-in functions
Activate all selected selections To be called when user is done with selections and wants to continue on the package level (or finish) This will transfer the selection status to package status
return true if any packages are to be installed
clear a saved state (to reduce memory consumption)
Clear a selected selection
whether to create package backups during install or removal
Provides (read: installs) a list of tags to the system tag can be a package name, a string from requires/provides or a file name (since a package implictly provides all its files) returns a map of tag,reason pairs if tags could not be provided. Usually this map should be empty (all required packages are installed) If tags could not be provided (due to package install failures or conflicts), the tag is listed as a key and the value describes the reason for the failure (as an already translated string).
Removes a list of tags from the system tag can be a package name, a string from requires/provides or a file name (since a package implictly provides all its files) returns a map of tag,reason pairs if tags could not be removed. Usually this map should be empty (all required packages are removed) If a tag could not be removed (because other packages still require it), the tag is listed as a key and the value describes the reason for the failure (as an already translated string).
return list of additional locales
get current path for update backup of rpm config files
get the currently preferred locale
return list of packages (["pkg1", "pkg2", ..."] if names_only==true, ["pkg1 version release arch", "pkg1 version release arch", ... if names_only == false] 'which' defines which packages are returned: `installed all installed packages `selected all selected but not yet installed packages `available all available packages (from the installation source)
returns a list of selection names matching the status symbol and the category. If category == "base", base selections are returned If category == "", addon selections are returned else selections matching the given category are returned
status can be:
Set packagemanager to "inst-sys" mode - dont use local caches (ramdisk!) !!!!!!!!!! CAUTION !!!!!!!!!!! Can only be called ONCE MUST be called before any other function !!!!!!!!!! CAUTION !!!!!!!!!!!
returns a 'true' if the tag is available on any of the currently active installation sources. (i.e. it is installable) tag can be a package name, a string from requires/provides or a file name (since a package implictly provides all its files)
return true if the original list of packages (since the last Pkg::SetSelection()) was changed.
returns a 'true' if the tag is provided in the installed system tag can be a package name, a string from requires/provides or a file name (since a package implictly provides all its files)
returns a 'true' if the tag is selected for installation tag can be a package name, a string from requires/provides or a file name (since a package implictly provides all its files)
return true if any packages are to be deleted
Commit package changes (actually install/delete packages) the 'successful' value will be negative, if installation was aborted ! if medianr == 0, all packages regardless of media are installed if medianr > 0, only packages from this media are installed
Select package for deletion
Get rpm group of a package
Select package for installation
return names of sources in installation order
[ [src1_media_1_size, src1_media_2_size, ...], [src2_media_1_size, src2_media_2_size, ...], ...] return cumulated sizes (in bytes !) to be installed from different sources and media Returns the install size, not the archivesize !!
Set package to neutral (drop install/delete flags)
Get (installed) size of a package
Optional: Pkg::PkgSolve (true) to filter all conflicts with installed packages (installed packages will be preferred) Solve current package dependencies
return number of fails
Get summary (aka label) of a package
Get version (better: edition) of a package
restore the package selection status from a former call to Pkg::SaveState() Returns false if there is no saved state (no Pkg::SaveState() called before)
save the current package selection status for later retrieval via Pkg::RestoreState()
-> $["summary" : "This is a nice selection", "category" : "Network", "visible" : true, "recommends" : ["sel1", "sel2", ...], "suggests" : ["sel1", "sel2", ...], "archivesize" : 12345678 "order" : "042"] Get summary (aka label), category, visible, recommends, suggests, archivesize, and order attributes of a selection Returns an empty list if no selection found Returns nil if called with wrong arguments
set list of
set current path for update backup of rpm config files
set the given locale as the "preferred" locale
Set a new selection If the selection is a base selection, this effetively resets the current package selection to the packages of the newly selected base selection Usually returns true Returns false if the given string does not match a known selection.
copy cache data of all installation sources to 'dir' to be called at end of initial installation with the target root dir.
change url of source used primarely when re-starting during installation and a cd-device changed from hdX to srX since ide-scsi was activated returns false if source_id doesn't exists or the url is malformed
creates a *NEW* package source under the given url if product_dir is _not_ given or empty, creates sources for all products and returns the id of the first product source This is only needed at initial installation or in the source manager. Normal code should rely on the cached sources. @see SourceStartCache
Delete source. Return true, if successful, false, if not. This function invalidates all source_ids. Use SourceGetCurrent to get the new list of source_ids.
disables source
disables all known source
returns general data about the source as a map: $[ "default_activate" : bool, "product_dir" : string, "url" : string, // also in SourceMediaData "type" : string ];
return all currently known and enabled sources
set installation order order_map = map of 'int order : int source_id', with order 1 == highest
Raise priority of source. Return true on success, false on error. This function invalidates all source_ids. Use SourceGetCurrent to get the new list of source_ids.
returns media data about the source as a map: $[ "media_count" : string, "media_id" : bool, "media_vendor" : string, "url" : string // also in SourceGeneralData ];
return $["product" : string, "vendor" : string ]
returns product data about the source as a map: $[ "productname" : string, "productversion" : string, "baseproductname" : string, "baseproductversion" : string, "vendor" : string, "defaultbase" : string, "architectures" : list (string), "requires" : string, "linguas" : list (string), "label" : string, "labelmap" : map (string lang, string label), "language" : string, "timezone" : string, "descrdir" : string, "datadir" : string ];
provide directory from source to local path @param source source id from SourceStartCache() @param medianr should be 0 (let the packagemanager decide about the media) @param dir pathname relative to source (i.e. CD) root path
provide file from source to local path @param source source id from SourceStartCache() @param medianr should be 0 (let the packagemanager decide about the media) @param file filename relative to source (i.e. CD) root path
Raise priority of source. Return true on success, false on error. This function invalidates all source_ids. Use SourceGetCurrent to get the new list of source_ids.
Save ranks to disk. Return true on success, false on error.
Set default activation state of source. Return true, if successful, false, if not.
enable/disable caching data on ramdisk (source is mounted, use data directly from source instead)
Start cached sources return list of known (and enabled) source id's This starts the packagemanager from it's cache of known sources
Starts the InstSrcManager. @param
init DU calculation for given directories parameter: [ $["name":"dir-without-leading-slash", "free":int_free, "used": int_used]
return block size of partition at directory
return capacity of partition at directory
finish target usage
return current DU calculations $[ "dir" : [ total, used, pkgusage ], .... ] total == total size for this partition used == current used size on target pkgusage == future used size on target based on current package selection
initialized target system with root-directory if new == true, initialize new rpm database
install rpm package by filename the filename must be an absolute path to a file which can be accessed by the package manager. !! uses callbacks !! You should do an 'import "PackageCallbacks"' before !
init logfile for target
return list of maps of all installed products in reverse installation order (product installed last comes first)
call "rpm --rebuilddb"
install package by name !! uses callbacks !! You should do an 'import "PackageCallbacks"' before !
return content of update.inf (usually
return usage of partition at directory
attach source of patches
Try to login to update server.
@param string server url
@param string registration code
@param string password
@return "ok" success
"args" bad args
"error_login" authorization failed
"url_invalid" invalid url
"url_not_found" url not found
"error" other error
get information about first selected patch.
download current patch.
@param bool true if signatures should be checked.
@return "" success
"args" bad args
"media" media error
"sig" signature check failed
retrieve package data belonging to patches
retrieve patches
@param string url of patch server.
@param bool true if signatures should be checked.
@return "" success
"args" bad args
"media" media error
"sig" signature check failed
"url" url not valid
get urls of patch servers
@param list(string) list of strings where results are stored.
@return "" success
"args" bad args
"get" error getting file from server
"read" error reading file after download
install current patch.
install retrieved patches
get information about next patch to be installed.
remove downloaded packages.
select patches based on types.
get map with status information
mark all packages for installation which are installed and have
an available candidate.
@return [ integer affected, integer unknown ]
This will mark packages for installation *and* for deletion (if a
package provides/obsoletes another package)
!!! DOES NOT SOLVE !!
mark all packages for installation which are installed and have
an available candidate. if 'only_newer' == true, only affect
packages which are newer, else affect all packages
@return number of packages affected
This will mark packages for installation *and* for deletion (if a
package provides/obsoletes another package)
|
| YaST2 Developers Documentation: Pkg:: built-in functions | ![]() |