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 filtered packages (["pkg1", "pkg2", ...] if names_only==true, ["pkg1 version release arch", "pkg1 version release arch", ... if names_only == false] if one of the first 3 parameters is set to true, it returns: byAuto: packages you get by dependencies, byApp: packages you get by selections, byUser: packages the user explicitly requested.
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
Return, if available, the filelist of package 'name'. Symbol 'which' specifies the package instance to query: `installed query the installed package `candidate query the candidate package `any query the candidate or the installed package (dependent on what's available)
Return the candidate packages license text. Returns an empty string if package is unknown or has no license.
Return a map
Get rpm group of a package
Select package for installation
Get file location of a package in the source
return names of sources in installation order
list
[ [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 !!
list
Set package to neutral (drop install/delete flags)
@param package name
@return Data about package location, source and which
media contains the package
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
Solve packages currently installed on target system. Packages status
remains unchanged, i.e. does not select/deselect any packages to
resolve failed dependencies.
only valid after a call of PkgSolve/PkgSolveCheckTargetOnly that returned false
return number of fails
Select source of package for installation
Get summary (aka label) of a package
Get version (better: edition) of a package
Reset most internal stuff on the package manager.
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)
If called with argument (true), it only checks the saved
against the current status and returns true if they differ.
save the current package selection status for later
retrieval via Pkg::RestoreState()
-> ["aaa_base", "k_deflt", ... ]
Get list of packages listed in a selection
selection = name of selection
to_delete = if false, return packages to be installed
if true, return packages to be deleted
language = if "" (empty), return only non-language specific packages
else return only packages machting the language
Returns an empty list if no matching selection found
Returns nil if called with wrong arguments
-> $["summary" : "This is a nice selection",
"category" : "Network",
"visible" : true,
"recommends" : ["sel1", "sel2", ...],
"suggests" : ["sel1", "sel2", ...],
"archivesize" : 12345678
"order" : "042",
"requires" : ["a", "b"],
"conflicts" : ["c"],
"provides" : ["d"],
"obsoletes" : ["e", "f"],
]
Get summary (aka label), category, visible, recommends, suggests, archivesize,
order attributes of a selection, requires, conflicts, provides and obsoletes.
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 the target located below 'dir'.
To be called at end of initial installation.
@param dir Root directory of target.
@return true
Change url of an InstSrc. Used primarely when re-starting during installation
and a cd-device changed from hdX to srX since ide-scsi was activated.
@param SrcId Specifies the InstSrc.
@param url The new url to use.
@return true
Load and enable all InstSrces found at media_url, i.e. all sources mentioned in /media.1/products.
If no /media.1/products is available, InstSrc is expected to be located directly below
media_url (product_dir: /).
If a product_dir is provided, only the InstSrc located at media_url/product_dir is loaded
and enabled.
@param url The media to scan.
@param product_dir Restrict scan to a certain InstSrc located in media_url/product_dir.
@return The source_id of the first InstSrc found on the media.
Delete an InsrSrc. The InsrSrc together with all metadata cached on disk
is removed. The SrcId passed becomes invalid (other SrcIds stay valid).
@param SrcId Specifies the InstSrc.
@return bool
Return a list of states for all known InstSources sorted according to the
source priority (highest first). A source state is a map:
@return list of source states (map)
Rearange known InstSrces rank and default state according to source_states
(highest priority first). Known InstSrces not mentioned in source_states
are deleted.
@param source_states List of source states. Same format as returned by
@ref SourceEditGet.
@return true
Disable an InsrSrc.
@param SrcId Specifies the InstSrc.
@return bool
Disable all InstSrces.
@return true
@param SrcId Specifies the InstSrc to query.
@return General data about the source as a map:
Return the list of all enabled InstSrc Ids.
@param enabled_only If true, or omitted, return the Ids of all enabled InstSrces.
If false, return the Ids of all known InstSrces.
@return list of SrcIds (integer)
Explicitly set an install order.
@param order_map A map of 'int order : int source_id'. source_ids are expected to
denote known and enabled sources.
@return true
Lower priority of source.
@param SrcId Specifies the InstSrc.
@return bool
@param SrcId Specifies the InstSrc to query.
@return Media data about the source as a map:
@param SrcId Specifies the InstSrc to query.
@return Product info as a map. See @ref Descr2Map
@param SrcId Specifies the InstSrc to query.
@return Product data about the source as a map:
Let an InstSrc provide some directory (make it available at the local filesystem) and
all the files within it (non recursive).
@param SrcId Specifies the InstSrc .
@param medianr Number of the media the file is located on ('1' for the 1st media).
@param dir Directoryname relative to the media root.
@return local path as string
Let an InstSrc provide some file (make it available at the local filesystem).
@param SrcId Specifies the InstSrc .
@param medianr Number of the media the file is located on ('1' for the 1st media).
@param file Filename relative to the media root.
@return local path as string
Raise priority of source.
@param SrcId Specifies the InstSrc.
@return bool
Save ranks to disk. Return true on success, false on error.
Load all InstSrces found at media_url, i.e. all sources mentioned in /media.1/products.
If no /media.1/products is available, InstSrc is expected to be located directly
below media_url (product_dir: /).
If a product_dir is provided, only the InstSrc located at media_url/product_dir is loaded.
In contrary to @ref SourceCreate, InstSrces are loaded into the InstSrcManager,
but not enabled (packages and selections are not provided to the PackageManager),
and the SrcIds of all InstSrces found are returned.
@param url The media to scan.
@param product_dir Restrict scan to a certain InstSrc located in media_url/product_dir.
@return list of SrcIds (integer).
Set the default activation state of an InsrSrc.
@param SrcId Specifies the InstSrc.
@param enabled Default activation state of source.
@return bool
In InstSys: Allow/prevent InstSrces from caching package metadata on ramdisk.
If no cache is used the media cannot be unmounted, i.e. no CD change possible.
Make sure the InstSrcManager is up, and return the list of SrcIds.
In fact nothing more than:
@param enabled_only If true, make sure all InstSrces are enabled according to
their default, and return the Ids of enabled InstSrces only. If false, return
the Ids of all known InstSrces.
@return list of SrcIds (integer)
Make sure the InstSrcManager is up and knows all available InstSrces.
Depending on the value of autoEnable, InstSources may be enabled on the
fly. It's safe to call this multiple times, and once the InstSources are
actually enabled, it's even cheap (enabling an InstSrc is expensive).
@param autoEnable If true, all InstSrces are enabled according to their default.
If false, InstSrces will be created in disabled state, and remain unchanged if
the InstSrcManager is already up.
@return true
return block size of partition at directory
return capacity of partition at directory
returns the (first) package
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
init DU calculation for given directories
parameter: [ $["name":"dir-without-leading-slash", "free":int_free, "used": int_used]
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
retrieve directory file listing all available patches
@return "" success
"url" url not valid
"login" login failed
"error" other error
get urls of patch servers
@param list(map) list of maps where results are stored. The maps have the following fields
set:
"url" URL of server.
"name" Descriptive name of server.
"directory" Directory file used to get list of patches.
@return "" success
"args" bad args
"get" error getting file from server
"write" error writing file to disk
"read" error reading file after download
Download and install patches.
remove downloaded packages.
retrieve patches
@param bool true if patches should be downloaded again
@param bool true if signatures should be checked.
@return "" success
"args" bad args
"media" media error
"sig" signature check failed
"abort" user aborted operation
"url" url not valid
"login" login failed
check for security updates
select patches based on types.
get map with status information
check for updates
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 !!
|
YaST2 Developers Documentation: Pkg:: built-in functions | ![]() |