packagekit/helpers
2007-08-23 11:24:09 +01:00
..
.gitignore use helper and export dummy install percentage 2007-08-16 15:17:47 +01:00
Makefile.am add yum get updates module 2007-08-22 22:29:27 +01:00
README detect and send internally required-restart 2007-08-23 11:24:09 +01:00
yum-description.py add proper header to yum helpers 2007-08-22 22:09:05 +01:00
yum-get-deps.py add proper header to yum helpers 2007-08-22 22:09:05 +01:00
yum-get-description.py add unit test framework 2007-08-22 23:26:59 +01:00
yum-get-updates.py add yum get updates module 2007-08-22 22:29:27 +01:00
yum-install.py include more dummy code from seth 2007-08-23 09:39:52 +01:00
yum-refresh-cache.py more abstraction and some more documentation 2007-08-23 01:35:53 +01:00
yum-remove.py add proper header to yum helpers 2007-08-22 22:09:05 +01:00
yum-search-details.py make the stdout data follow a tab convention 2007-08-23 10:01:54 +01:00
yum-search-name.py make the stdout data follow a tab convention 2007-08-23 10:01:54 +01:00
yum-update-system.py add proper header to yum helpers 2007-08-22 22:09:05 +01:00

External Backends

Right, so you've not got a C or C++ binding for your package system.
You are in the right place.

PackageKit executes scripts written in pretty much any language
(perl,java,python) and watches on the standard out and standard error.

This means we need a standard for what goes on stdin, stdout and stderr to
try and maximise the common code between the backends.

If you are unable to write scripts that conform to these specifications then
just launch a PkSpawn object with stdout and stderr callbacks and then try to
do screenscraping in the backend. This option is least popular.

The following are guidelines. Feel free to break the rules if you have to,
you have a compiled backend to use if you need it.

========= Find Packages ========= 

FILENAME	{backend}-search-name.*

STDIN		$options $search_term
		options:	One of "installed", "available", "all".
		search_term:	Single word search term with no wildcard chars.

STDERR		percentage<tab>$value
		value:		Percentage complete of the entire transaction
		notes:		This is optional. Backends should send the DBUS
				signal NoPercentageUpdates or use no-percentage-updates
				if the remaining position cannot be calculated.

STDERR		no-percentage-updates
		notes:		This is optional and signifies that the helper
				is no longer able to send percentage updates.

STDERR		error<tab>$enum<tab>description
		enum:		Enumerated type, e.g. "no-network",
				"not-supported" or "internal-error"
		description:	Long description or error
		notes:		Errors should only be send on fatal abortion.

STDOUT		package<tab>$status<tab>$package_name<tab>$summary
		$status:	"1" if installed, "0" if not
		$package_name:	The package name, e.g. openoffice-clipart
		$summary:	The one line package summary, e.g. "Clipart for OpenOffice"

NOTES:		Do not refresh the package cache. This should be fast.

========= Refresh Cache =========

FILENAME	{backend}-refresh-cache.*

STDIN		<none>

STDERR		percentage<tab>$value
		value:		Percentage complete of the entire transaction
		notes:		This is optional. Backends should send the signal
				NoPercentageUpdates if these are not expected.

STDERR		subpercentage<tab>$value
		$value:		Percentage complete of the sub-transaction.
		notes:		This is optional.

STDERR		error<tab>$enum<tab>description
		enum:		Enumerated type, e.g. "no-network",
				"not-supported" or "internal-error"
		description:	Long description or error
		notes:		Errors should only be send on fatal abortion.

STDOUT		<none>

========= Install Packages ========= 

FILENAME	{backend}-install.*

STDIN		$package
		package:	Single word package with no wildcard chars.

STDERR		percentage<tab>$value
		value:		Percentage complete of the entire transaction
		notes:		This is optional. Backends should send the signal
				NoPercentageUpdates if these are not expected.

STDERR		subpercentage<tab>$value
		$value:		Percentage complete of the sub-transaction
		notes:		This is optional.

STDERR		status<tab>$state
		$state:		One of "download", "install", "update", "remove"
		notes:		This is optional.

STDERR		data<tab>$current_data
		$current_data:	The current worked on package
		notes:		This is optional, but allows the UI to show what
				package is being installed on for that sub-transaction.

STDERR		error<tab>$enum<tab>description
		enum:		Enumerated type, e.g. "no-network",
				"not-supported" or "internal-error"
		description:	Long description or error
		notes:		Errors should only be send on fatal abortion.

STDOUT		package<tab>$status<tab>$package_name<tab>$summary
		$status:	Always "1"
		$package_name:	The package name, e.g. openoffice-clipart
		$summary:	The one line package summary, e.g. "Clipart for OpenOffice"
		NOTE:		As packages are installed then emit them to the screen.
				This allows a summary to be presented after the transaction.

========= Remove Packages ========= 

FILENAME	{backend}-install.*

STDIN		$allowdeps $package
		allowdeps:	Either "yes" or "no". If yes allow other packages
				to be removed with the package, but "no" should
				cause the script to abort if other packages are
				dependant on the package.
		package:	Single word package with no wildcard chars.

STDERR		percentage<tab>$value
		value:		Percentage complete of the entire transaction
		notes:		This is optional. Backends should send the signal
				NoPercentageUpdates if these are not expected.

STDERR		subpercentage<tab>$value
		$value:		Percentage complete of the sub-transaction
		notes:		This is optional.

STDERR		data<tab>$current_data
		$current_data:	The current worked on package
		notes:		This is optional, but allows the UI to show what
				package is being installed on for that sub-transaction.

STDERR		error<tab>$enum<tab>description
		enum:		Enumerated type, e.g. "no-network",
				"not-supported" or "internal-error"
		description:	Long description or error
		notes:		Errors should only be send on fatal abortion.

STDOUT		package<tab>$status<tab>$package_name<tab>$summary
		$status:	Always "1"
		$package_name:	The package name, e.g. openoffice-clipart
		$summary:	The one line package summary, e.g. "Clipart for OpenOffice"
		NOTE:		as packages are installed then emit them to the screen.
				This allows a summary to be presented after the transaction.

========= Get Dependancies ========= 

FILENAME	{backend}-get-deps.*

STDIN		$package
		package:	Single word package with no wildcard chars.

STDERR		percentage<tab>$value
		value:		Percentage complete of the entire transaction
		notes:		This is optional. Backends should send the signal
				NoPercentageUpdates if these are not expected.

STDERR		error<tab>$enum<tab>description
		enum:		Enumerated type, e.g. "no-network",
				"not-supported" or "internal-error"
		description:	Long description or error
		notes:		Errors should only be send on fatal abortion.

STDOUT		package<tab>$status<tab>$package_name<tab>$summary
		$status:	Always "1"
		$package_name:	The package name, e.g. openoffice-clipart
		$summary:	The one line package summary.

========= Update System ========= 

FILENAME	{backend}-update-system.*

STDIN		<none>

STDERR		percentage<tab>$value
		value:		Percentage complete of the entire transaction
		notes:		This is optional. Backends should send the signal
				NoPercentageUpdates if these are not expected.

STDERR		subpercentage<tab>$value
		$value:		Percentage complete of the sub-transaction
		notes:		This is optional.

STDERR		error<tab>$enum<tab>description
		enum:		Enumerated type, e.g. "no-network",
				"not-supported" or "internal-error"
		description:	Long description or error
		notes:		Errors should only be send on fatal abortion.

STDERR		requirerestart<tab>$type<tab>$details
		type:		Enumerated type, e.g. "system", "application", "session"
		details:	Optional details about the restart
		notes:		This can be sent as many times as needed by the
				backend script. PackageKit will always choose
				the 'worst' method in the UI notification.

STDOUT		package<tab>$status<tab>$package_name<tab>$summary
		$status:	Always "1"
		$package_name:	The package name, e.g. openoffice-clipart
		$summary:	The one line package summary.
		NOTE:		As packages are updated then emit them to the screen.
				This allows a summary to be presented after the transaction.

========= Get Description ========= 

FILENAME	{backend}-get-description.*

STDIN		$package
		package:	Single word package with no wildcard chars.

STDERR		error<tab>$enum<tab>description
		enum:		Enumerated type, e.g. "no-network",
				"not-supported" or "internal-error"
		description:	Long description or error
		notes:		Errors should only be send on fatal abortion.

STDOUT		description<tab>$package_name<tab>$version<tab>$detail<tab>$url
		$package_name:	The package name, e.g. openoffice-clipart
		$version:	The full distro package version
		$detail:	The multi line package description.
		$url:		The upstream project homepage