Backends
Spawn Introduction
Backends are typically open-programmable, which means we can define a
standard for what goes on stdin, stdout and stderr to try and maximise
the common code between the backends.
The following section will explain the convention used on
backends/conary and backends/yum.
If you are unable to write scripts that conform to these specifications
then just launch a PkSpawn object in the compiled helper with stdout and
stderr callbacks and then try to do screenscraping in the backend.
This screenscraping is least popular for obvious reasons.
Backends scripts are run with arguments and data is sent to standard out
and standard error asyncronously so that PackageKit can proxy this to DBUS.
A method has command line arguments seporated with tabs, and data is also
seporated with tabs.
Methods
The following methods are mapped from the helper to comand line programs
in the compile helper.
Method
File
Search Name
search-name.*
Search Group
search-group.*
Search Details
search-details.*
Search File
search-file.*
Install Package
install.*
Install File
install-file.*
Remove Package
remove.*
Get Depends
get-depends.*
Resolve
resolve.*
Get Requires
get-requires.*
Get Update Detail
get-update-detail.*
Get Description
get-description.*
Get Files
get-files.*
Update Package
update.*
Update System
update-system.*
Get Updates
get-updates.*
Refresh Cache
refresh-cache.*
Get Repo List
get-repo-list.*
Repo Enable
repo-enable.*
Repo Set Data
repo-set-data.*
Common function outputs
The following commands echoed to standard error will
automatically make the backend-launcher do the correct action in the
compiled helper.
Method
Data
File
Percentage
percentage[tab]value
stderr
Subpercentage
subpercentage[tab]value
stderr
NoPercentageUpdates
no-percentage-updates
stderr
Error
error[tab]enum[tab]description
stderr
Status
status[tab]state
stderr
RequireRestart
requirerestart[tab]type[tab]details
stderr
AllowUpdate
allow-interrupt[tab]enabled
stderr
Package
package_id[tab]status[tab]summary
stdout
Description
description[tab]package_id[tab]group[tab]detail[tab]url[tab]size_in_bytes
stdout
Files
files[tab]package_id[tab]file_list
stdout
UpdateDetail
package_id[tab]updates[tab]obsoletes[tab]url[tab]restart[tab]update_text
stdout
ChangeTransactionData
change-transaction-data[tab]data
stdout
RepoSignatureRequired
repository_name[tab]key_url[tab]key_userid[tab]key_id[tab]key_fingerprint[tab]key_timestamp[tab]type
stdout
RepoDetail
repo-detail[tab]repo_id[tab]description[tab]enabled
stdout