Packages management overview

Purpose

Domogik is delivered without any plugin since the 0.2.0 version. This allows to make evolutions and bugfixes on Domogik core while having no dependencies to th plugins. From Domoweb administration you can install packages (plugins, ...) that are availables on online repositories.

Activating “package mode”

By default, with a “developper” installation, there is no packages management : all plugins and other functionnalities are available from Domogik sources. The package mode is activated when installing Domogik as “install” installation. To test (or develop) features for packages management from a “developper” installation, you need to uncomment the property “package_path” from ~/.domogik/domogik.cfg

Repositories

The list of repositories is configured in ~/.domogik/sources.list/. The format is : “<priority> <url>”. Example:

500          http://repo.domogik.org/repository/stable/
400          http://repo.domogik.org/repository/testing/

If a package exists in 2 repositories for a given version, the one with the higher priority will be installed.

Cache update (/package/update-cache)

The cache contains the list of available packages on the repositories. It is storen on main host in /var/cache/domogik/ The cache update consist in :

This is actually a bit long to refresh cache : there are no threads used for the moment. In the future we may get a .tgz with all xml and icons from the repositories to go quickly.

List installed packages (/package/installed/<host>/<type>)

At startup, each manager (if multiple hosts) sends the list of the installed package (xpl-trig). Each time a package is installed/uninstalled/enabled/disabled, the manager sends an update of the list (xpl-trig). When starting, REST sends a request to get the list of the installed packages on all the hosts (xpl-cmnd). When receiving this, each manager sends the list (xl-trig) Rest keeps in memory the list of installed packages on each host. This allows REST to answer immediatly to the UI and to avoid useless xpl dialogs.

To make the list a manager checks for the packages xml descriptions files in ~/.domogik/packages/plugins|externals

For each installed package we try to look if updates are available for the package in the repositories. If so, they are added to the informations given by Rest.

List available packages (/package/available/<host>/<type>)

The list of the available packages is made from the list of the xml files in the cache folder ~/.domogik/cache/. Each of these xml files contains the url of the associated package online and its repository. For each available package, a check is made : is the package already installed on the host for which we request the list. If so, the package is exclude from the list.

Install (/package/install/<host>/<type>/<id>/<release>)

The installation of a package is made in two times:

* Main host part : the files needed by the main host are installed on it : xml, ...
* Secondary host part : the files needed on the secondary hosts are installed on them : python, ...

Each part of the installation is requested by a separate command (xpl-cmnd). internet connection, the package is first downloaded by Rest and Rest give access to it with a /package/download url. This url is sent by Rest to managers in the command messages, so the managers of the main and secondary hosts can get the package from the LAN on Rest. Notice : the main host is also a secondary host from rest and manager point of view.

Uninstall (/package/uninstall/<host>/<type>/<id>

Actually we can’t properly uninstall a package : there may be some common files between 2 packages (share/domogik/stats|url2xpl), so if we try to delete a package, we may have an issue with another one. This issue may be resolved with the “v2 model”. So, actually, to uninstall a package we just remove the xml description file in ~/.domogik/packages/plugins|externals.

!!Enable (/plugin/enable/<host>/<id>)

After installing a plugin, it is disabled. It needs to be enabled. Actually this is specific for packages’s type = plugin. This will call the dmgenplug tool.

Disable (/plugin/disable/<host>/<id>)

Disable a plugin with the dmgdisplug tool.

Check dependencies (/package/check-dependencies/...)

This allows to check if a package has dependencies and if they are installed on target host :

  • python : if not installed, the command line for installing the dependendy will be given to the user
  • plugin : if not installed, the names of the needed packages will be given
  • other : will inform if a dependency like owfs, heyu is needed

This feature is called (by UI because it is not mandatory) just before installing a package to notify the user if dependencies are needed.