Base classes for backend implementations and helpers.
Base class for update-manager backends.
This class forms the public interface to Update Manager backends. All Backend implementations must subclass this class and implement all of its methods.
Note
The backend itself must ensure that two mutually exclusive operations are not happening at the same time.
Aborts the current fetch operation.
Acquire the package manager lock.
Downloads and installs the packages specified in selcted_updates (asynchronous).
Parameters: |
|
---|
Downloads the package lists (asynchronous).
Parameters: | download_progress_handler – ListProgressHandler implementation |
---|
Gets available updates (synchronous).
Parameters: | dist_upgrade – Defines whether to do a dist upgrade or not. |
---|---|
Returns: | PackageInfoStoreBase object |
Changed in version 0.200.0~exp1: Added dist_upgrade parameter.
Early initialization code. This method must not be overridden, unless some early backend initialization has to be done.
Parameters: | application – UpdateManager.Application.Application object. |
---|
Indicates whether the package manager lock has been acquired.
Parameters: | by_us – Defines whether to check if we hold the lock ourselves or for checking whether the lock is held by another process. |
---|
Release the package manager lock.
Reloads the package cache (asynchronous).
Parameters: | cache_progress_handler – CacheProgressHandler implementation |
---|
Specifies whether the backend requires root privileges to operate or not.
Returns: | True if root privileges are required, False otherwise. |
---|
Package info base class.
All PackageInfo implementations must subclass this class and override all its methods.
Return boolean indicating whether the repository we found the candidate in is trusted.
The candidate’s repository archive name.
The candidate’s repository component name.
The candidate’s repository origin label.
The candidate’s repository origin name.
Return the candidate uri.
The candidate’s version as a string.
Returns a list of conflicting packages.
Returns the package’s upgradable dependencies as a list of PackageInfoBase objects.
Return the package description.
The download size in bytes as an integer.
The currently installed version as a string.
Return the package name as a string.
Returns the packages that depend on this package as a list of PackageInfoBase objects.
Return the package’s source package name.
Returns the package’s upgradable strict dependencies as a list of PackageInfoBase objects.
Returns the packages that depend strictly on this package as a list of PackageInfoBase objects.
The package summary (aka. short description) as a string.
Returns a list of dependencies that are not installed.
The update’s category as an integer.
Returns whether the package is broken or not
Returns whether the package is already installed or not.
PackageInfo Store
Object to store PackageInfoBase objects.
Adds a package to the store.
Parameters: | pkg_info – PackageInfoBase object |
---|
Adds a package removal to the store.
Parameters: | pkg_info – PackageInfoBase object |
---|
New in version 0.200.0~exp1.
Returns the number of packages to be newly installed.
Returns: | list of PackageInfoBase objects |
---|
New in version 0.200.0~exp1.
Gets a package from the internal dictionary.
Returns: | PackageInfoBase object |
---|
Gets a list of packages.
Returns: | A list of PackageInfoBase objects. |
---|
Gets a dict of packages.
Returns: | A dict with category IDs as keys, containing a dict with package names as keys and PackageInfoBase objects as values. |
---|
Returns the number of packages marked for removal.
Returns: | list of PackageInfoBase objects |
---|
New in version 0.200.0~exp1.
Gets the packages marked for removal.
Returns: | list of PackageInfoBase objects |
---|
New in version 0.200.0~exp1.
Checks if a given package exists in the store.
Parameters: | package_name – The package’s name. |
---|
Gets number of packages in the store.
Returns: | Number of packages |
---|
Resolves dependencies of all packages.
Package dependency representation
Check if the candidate version of the package fulfills the dependency.
Parameters: | pkg_info_store – PackageInfoStoreBase object |
---|---|
Returns: | True if dependency is fulfilled, False otherwise |
Check if the currently installed version of the package fulfills the dependency.
Returns: | True if dependency is fulfilled, False otherwise |
---|
Returns whether the dependency is a strict one.
Strict dependencies depend on exactly one version of another package.
Cache (re-)opening progress handler
Begin notification
Failure notification
Parameters: | failure_message – Failure message |
---|
Finished notification
Handle an operation update (current operation changed)
Parameters: | operation – Current operation |
---|
Handle a progress update
Parameters: | progress – Either one of CACHE_PROGRESS (negative) or a percentage. |
---|
Package list downloading handler
List download operation was aborted
List download operation has started
List download operation has failed
Parameters: | failure_message – Failure message |
---|
List download operation has finished
Item download has started
Parameters: |
|
---|
Item download has finished
Parameters: | item_uri – Item uri |
---|
Item download progress update
Parameters: |
|
---|
List download operation progress update
Parameters: |
|
---|
Commit progress handler
Download operation was aborted
Download operation has started
Parameters: |
|
---|
Download operation has failed
Parameters: | failure_message – Failure message |
---|
Download operation has finished
Item download has started
Parameters: |
|
---|
Item download has finished
Parameters: | uri – Item uri |
---|
Item download update notification
Parameters: |
|
---|
Download operation update
Parameters: |
|
---|
Install operation has started
Install operation has failed
Parameters: | error_message – Error message |
---|
Install operation has finished
Install operation update
Parameters: |
|
---|
Commit preparation begins
New in version 0.200.0~exp1.
Commit operation requires removal or installation of packages.
Parameters: |
|
---|---|
Returns: | True if the operation should continue or False to abort. |
New in version 0.200.0~exp1.
Combination of CacheProgressHandler, ListProgressHandler and CommitProgressHandler for frontends implementing all of these in a single class.