xbmc/xbmc — pull request #2230 by cptspiff (2013-02-13 22:29:32+00:00)
Title: Install system package add-ons from within the xbmc GUI

This is a cowboy attempt at making system package add-ons, e.g. pvr add-ons, be installable from inside the xbmc gui. And it works - sort of. As such, don't bother commenting on cosmetics, splitting etc.

The idea is to allow repositories have scripts that handle installation. these are called like normal plugins with predefined parameters, e.g. ?action=install&package=foo&version=bar. This is in my experience (see https://github.com/xbmc/xbmc/pull/109) the cleanest way to handle this with most flexibility and least impact.

I have (really!) cowboy'd an example installer using python-aptdaemon. it works, i can update, install and remove packages (only one operation per run though; you have to restart *xbmc* between - the script has a BIG hat). it includes some paths on my filesystem for the addons.xml etc. the files are in the git but you'd have to adapt the paths.

this depends on polkit for auth. polkit still only allows one handler, and it will be taken by the desktop environment if you run in such a session. it seems to be handled quite nice in quantal+xfce at least; when you run in fullscreen, it will go windowed, get your password input then go fullscreen again.

when we control the session, we can register our own. we can also play with polkit policies, e.g. http://askubuntu.com/questions/3/how-can-i-set-the-software-center-to-install-software-for-non-root-users

or even more evil hackery should you want to do that (chmod u+s or whatever).

i have already found some monkeys up in them tree's.

1) the system package versions do not seem to correspond to the add-on versions.
2) the system package version includes the distro version. will probably complicate things a bit.

another question is how to handle different versions of the same distro. the sanest option here is probably to demand that the add-ons compile on a sane subset and be done with it.

now, i already worked on this 2 years ago but got stuck, so i don't want to continue work on this if there is no interest. but we are already one step closer with the packages for the pvr add-ons.

if so, here are some tasks;
1) shake down the spotted monkeys
2) write a proper installer script
3) write a polkit auth handler
4) add granularity to the platforms so we can target specific distros (currently the add-on is flagged as 'linux')