summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Kukawka <danny.kukawka@web.de>2009-05-24 17:48:19 +0200
committerDanny Kukawka <danny.kukawka@web.de>2009-05-24 17:48:19 +0200
commit7e8c2e7467a48179238342de47f42bf0894ba9f8 (patch)
tree19b761cb385d34a555cd7db6d13a88d75af7e58d
parentb35bf1fbfc000749010a27f3f35a95ddf6bb0b07 (diff)
added new properties: org.freedesktop.Hal.version(.*)
Added new properties to root device object (/org/freedesktop/Hal/devices/computer) to enable to query the HAL version from a fdi file. This allow to handle new keys/ properties, deprecated key or API changes in the hal-info package of needed. The new properties are: - org.freedesktop.Hal.version (string) - org.freedesktop.Hal.version.major (int) - org.freedesktop.Hal.version.minor (int) - org.freedesktop.Hal.version.micro (int)
-rw-r--r--doc/spec/hal-spec-properties.xml59
-rw-r--r--hald/freebsd/hf-computer.c11
-rw-r--r--hald/linux/osspec.c11
-rw-r--r--hald/solaris/devinfo_misc.c11
4 files changed, 92 insertions, 0 deletions
diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml
index db7abee2..69413542 100644
--- a/doc/spec/hal-spec-properties.xml
+++ b/doc/spec/hal-spec-properties.xml
@@ -12,6 +12,64 @@
can catch.
</para>
+ <sect1 id="device-properties-hal">
+ <title>
+ org.freedesktop.Hal namespace
+ </title>
+ <para>
+ The <literal>org.freedesktop.Hal</literal> namespace contain properties that
+ can be considered metadata about HAL itself and not about device objects. They
+ are only available at the root object (<literal>/org/freedesktop/Hal/devices/computer</literal>)
+ and allow to query information about HAL from fdi files.
+ </para>
+ <informaltable>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Key (type)</entry>
+ <entry>Values</entry>
+ <entry>Mandatory</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>
+ <literal>org.freedesktop.Hal.version</literal> (string)
+ </entry>
+ <entry>example: 0.5.13</entry>
+ <entry>Yes</entry>
+ <entry>The version number of the running HAL daemon.</entry>
+ </row>
+ <row>
+ <entry>
+ <literal>org.freedesktop.Hal.version.major</literal> (int)
+ </entry>
+ <entry>example: 0</entry>
+ <entry>Yes</entry>
+ <entry>The major version number of the running HAL daemon.</entry>
+ </row>
+ <row>
+ <entry>
+ <literal>org.freedesktop.Hal.version.minor</literal> (int)
+ </entry>
+ <entry>example: 5</entry>
+ <entry>Yes</entry>
+ <entry>The minor version number of the running HAL daemon.</entry>
+ </row>
+ <row>
+ <entry>
+ <literal>org.freedesktop.Hal.version.micro</literal> (int)
+ </entry>
+ <entry>example: 13</entry>
+ <entry>Yes</entry>
+ <entry>The micro version number of the running HAL daemon.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </sect1>
+
<sect1 id="properties-general">
<title>General Properties</title>
<para>
@@ -19,6 +77,7 @@
physical or functional characteristics of what the device
object represents.
</para>
+
<sect2 id="device-properties-info">
<title>
info namespace
diff --git a/hald/freebsd/hf-computer.c b/hald/freebsd/hf-computer.c
index 9e7aac48..7e9b9de1 100644
--- a/hald/freebsd/hf-computer.c
+++ b/hald/freebsd/hf-computer.c
@@ -130,6 +130,17 @@ hf_computer_device_add (void)
hal_device_property_set_string(device, "info.subsystem", "unknown");
hal_device_property_set_string(device, "info.product", "Computer");
+ if (PACKAGE_VERSION) {
+ int major, minor, micro;
+
+ hal_device_property_set_string (root, "org.freedesktop.Hal.version", PACKAGE_VERSION);
+ if ( sscanf( PACKAGE_VERSION, "%d.%d.%d", &major, &minor, &micro ) == 3 ) {
+ hal_device_property_set_int (root, "org.freedesktop.Hal.version.major", major);
+ hal_device_property_set_int (root, "org.freedesktop.Hal.version.minor", minor);
+ hal_device_property_set_int (root, "org.freedesktop.Hal.version.micro", micro);
+ }
+ }
+
if (uname(&un) == 0)
{
hal_device_property_set_string(device, "system.kernel.name", un.sysname);
diff --git a/hald/linux/osspec.c b/hald/linux/osspec.c
index f721b987..998ae79f 100644
--- a/hald/linux/osspec.c
+++ b/hald/linux/osspec.c
@@ -841,6 +841,17 @@ osspec_probe (void)
hal_device_property_set_string (root, "info.product", "Computer");
hal_device_set_udi (root, "/org/freedesktop/Hal/devices/computer");
+ if (PACKAGE_VERSION) {
+ int major, minor, micro;
+
+ hal_device_property_set_string (root, "org.freedesktop.Hal.version", PACKAGE_VERSION);
+ if ( sscanf( PACKAGE_VERSION, "%d.%d.%d", &major, &minor, &micro ) == 3 ) {
+ hal_device_property_set_int (root, "org.freedesktop.Hal.version.major", major);
+ hal_device_property_set_int (root, "org.freedesktop.Hal.version.minor", minor);
+ hal_device_property_set_int (root, "org.freedesktop.Hal.version.micro", micro);
+ }
+ }
+
if (uname (&un) >= 0) {
hal_device_property_set_string (root, "system.kernel.name", un.sysname);
hal_device_property_set_string (root, "system.kernel.version", un.release);
diff --git a/hald/solaris/devinfo_misc.c b/hald/solaris/devinfo_misc.c
index dafffd26..5f6daee2 100644
--- a/hald/solaris/devinfo_misc.c
+++ b/hald/solaris/devinfo_misc.c
@@ -74,6 +74,17 @@ devinfo_computer_add(HalDevice *parent, di_node_t node, char *devfs_path, char *
hal_device_set_udi (d, "/org/freedesktop/Hal/devices/computer");
hal_device_property_set_string (d, "solaris.devfs_path", devfs_path);
+ if (PACKAGE_VERSION) {
+ int major, minor, micro;
+
+ hal_device_property_set_string (root, "org.freedesktop.Hal.version", PACKAGE_VERSION);
+ if ( sscanf( PACKAGE_VERSION, "%d.%d.%d", &major, &minor, &micro ) == 3 ) {
+ hal_device_property_set_int (root, "org.freedesktop.Hal.version.major", major);
+ hal_device_property_set_int (root, "org.freedesktop.Hal.version.minor", minor);
+ hal_device_property_set_int (root, "org.freedesktop.Hal.version.micro", micro);
+ }
+ }
+
if (uname (&un) >= 0) {
hal_device_property_set_string (d, "system.kernel.name", un.sysname);
hal_device_property_set_string (d, "system.kernel.version", un.release);