hal: Branch 'master' - 5 commits
Danny Kukawka
dkukawka at kemper.freedesktop.org
Sun May 24 13:47:52 PDT 2009
doc/spec/hal-spec-properties.xml | 59 +++++++++++++++++++++++++++++++++++++++
hald/freebsd/hf-computer.c | 11 +++++++
hald/linux/coldplug.c | 2 -
hald/linux/osspec.c | 11 +++++++
hald/solaris/devinfo_misc.c | 11 +++++++
tools/hal-storage-mount.c | 14 ++++-----
6 files changed, 100 insertions(+), 8 deletions(-)
New commits:
commit 5acd56d404820123619320bb11f9f6466c7442d1
Merge: af75c7a... 5ea1c2a...
Author: Danny Kukawka <danny.kukawka at web.de>
Date: Sun May 24 18:28:37 2009 +0200
Merge branch 'master' of ssh://dkukawka@git.freedesktop.org/git/hal
commit af75c7ad59dcc8945cc7c92874b484d7519c1b7a
Author: Danny Kukawka <danny.kukawka at web.de>
Date: Sun May 24 18:19:36 2009 +0200
cleaned up hal-storage-mount code
Cleaned up hal-storage-mount code. Don't call libhal_volume_get_fstype()
again and again for each possible fstype, reuse result of first call.
diff --git a/tools/hal-storage-mount.c b/tools/hal-storage-mount.c
index 78e0160..9471706 100644
--- a/tools/hal-storage-mount.c
+++ b/tools/hal-storage-mount.c
@@ -786,13 +786,13 @@ handle_mount (LibHalContext *hal_ctx,
/* don't consider uid= on vfat, iso9660, hfs and udf change-uid for the purpose of policy
* (since these doesn't contain uid/gid bits)
*/
- if (libhal_volume_get_fstype (volume) != NULL &&
- strcmp (libhal_volume_get_fstype (volume), "vfat") != 0 &&
- strcmp (libhal_volume_get_fstype (volume), "ntfs") != 0 &&
- strcmp (libhal_volume_get_fstype (volume), "ntfs-3g") != 0 &&
- strcmp (libhal_volume_get_fstype (volume), "iso9660") != 0 &&
- strcmp (libhal_volume_get_fstype (volume), "hfs") != 0 &&
- strcmp (libhal_volume_get_fstype (volume), "udf") != 0) {
+ const char *v_fstype;
+
+ v_fstype = libhal_volume_get_fstype (volume);
+ if (v_fstype != NULL &&
+ strcmp (v_fstype, "vfat") != 0 && strcmp (v_fstype, "ntfs") != 0 &&
+ strcmp (v_fstype, "ntfs-3g") != 0 && strcmp (v_fstype, "iso9660") != 0 &&
+ strcmp (v_fstype, "hfs") != 0 && strcmp (v_fstype, "udf") != 0) {
pol_change_uid = wants_to_change_uid;
}
}
commit 9c7cfc5861e939574c2a3b8d0881108d3e796c61
Merge: 60d87c8... e4ac5de...
Author: Danny Kukawka <danny.kukawka at web.de>
Date: Sun May 24 18:06:13 2009 +0200
Merge branch 'master' of ssh://dkukawka@git.freedesktop.org/git/hal
commit 60d87c82f29c485baf3d6a51b6535919a73c5ab2
Author: Danny Kukawka <danny.kukawka at web.de>
Date: Sun May 24 17:58:18 2009 +0200
fixed compiler warning
Fixed compiler warning: "passing argument 2 of âhal_util_decode_escapeâ
discards qualifiers from pointer target type"
diff --git a/hald/linux/coldplug.c b/hald/linux/coldplug.c
index 276382d..5f5b4f7 100644
--- a/hald/linux/coldplug.c
+++ b/hald/linux/coldplug.c
@@ -256,7 +256,7 @@ hal_util_init_sysfs_to_udev_map (void)
} else if (strncmp(line, "E: ID_FS_LABEL_ENC=", 19) == 0) {
len = strlen (&line[15]);
info->fslabel = g_malloc0 (len + 1);
- hal_util_decode_escape (&line[19], info->fslabel, len + 1);
+ hal_util_decode_escape (&line[19], (char *)info->fslabel, len + 1);
}
}
commit 7e8c2e7467a48179238342de47f42bf0894ba9f8
Author: Danny Kukawka <danny.kukawka at web.de>
Date: Sun May 24 17:48:19 2009 +0200
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)
diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml
index db7abee..6941354 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 9e7aac4..7e9b9de 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, µ ) == 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 f721b98..998ae79 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, µ ) == 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 dafffd2..5f6daee 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, µ ) == 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);
More information about the hal-commit
mailing list