hal: Branch 'master'

Danny Kukawka dkukawka at kemper.freedesktop.org
Thu Mar 6 12:35:22 PST 2008


 configure.in                                         |  125 ++++++++++---------
 fdi/information/10freedesktop/01-deprecated-keys.fdi |   37 +++++
 fdi/information/10freedesktop/Makefile.am            |    6 
 hald/freebsd/hf-computer.c                           |    4 
 hald/linux/device.c                                  |    4 
 hald/linux/osspec.c                                  |    6 
 6 files changed, 110 insertions(+), 72 deletions(-)

New commits:
commit 8e3c4d5a7eced8fed4405f65d855e28da0b203e5
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Thu Mar 6 21:35:02 2008 +0100

    remove readded deprecated keys from code and provide a fdi-file instead
    
    Instead of readd the deprecated and outdated keys back to the code, we should
    move them to a fdi-file. This would allow e.g. developers for testing or also
    distributions for their packages to use HAL without these keys without
    recompile HAL.

diff --git a/configure.in b/configure.in
index 6350601..35c4557 100644
--- a/configure.in
+++ b/configure.in
@@ -612,6 +612,15 @@ if test "x$enable_pci" != "xno"; then
  	AC_DEFINE(HAVE_PCI, [], [Set if we have PCI support])
 fi
 
+AC_ARG_WITH([deprecated-keys], AS_HELP_STRING([--with-deprecated-keys], [Add fdi-file to support deprecated/removed keys]))
+BUILD_DEPRECATED_KEYS=no
+if test "x$with_deprecated_keys" = "xyes"; then
+   BUILD_DEPRECATED_KEYS=yes
+else
+   BUILD_DEPRECATED_KEYS=no
+fi
+AM_CONDITIONAL(BUILD_DEPRECATED_KEYS, [test x$BUILD_DEPRECATED_KEYS = xyes])
+
 # D-Bus libs
 PKG_CHECK_MODULES(DBUS, [$dbus_module])
 AC_SUBST(DBUS_CFLAGS)
@@ -1011,63 +1020,65 @@ echo "
                     HAL $VERSION
                   ==============
 
-        prefix:                      ${prefix}
-        libdir:                      ${libdir}
-        libexecdir:                  ${libexecdir}
-        bindir:                      ${bindir}
-        sbindir:                     ${sbindir}
-        datadir:                     ${datadir}
-        sysconfdir:                  ${sysconfdir}
-        localstatedir:               ${localstatedir}
-        docdir:                      ${docdir}
-        dbus-1 system.d dir:         ${DBUS_SYS_DIR}
-        pci.ids dir:                 ${PCI_IDS_DIR}
-        usb.ids dir:                 ${USB_IDS_DIR}
-
-        compiler:                    ${CC}
-        cflags:                      ${CFLAGS}
-        ldflags:                     ${LDFLAGS}
-        cppflags:                    ${CPPFLAGS}
-        xmlto:                       ${XMLTO}
-	xmllint:                     ${XMLLINT}
-        User for HAL:                ${HAL_USER}
-        Group for HAL:               ${HAL_GROUP}
-        hald pidfile:                ${HALD_PID_FILE}
-        hald socket dir:             ${HALD_SOCKET_DIR}
-        eject program:               ${EJECT_PROGRAM}
-
-        OS backend:                  ${HALD_BACKEND}
-
-        use acpi kernel interface:   ${acpi_proc}
-        use acpid interface:         ${acpi_acpid}
-        use libusb:                  ${USE_LIBUSB}
-        use libpci:                  ${USE_LIBPCI}
-        use libparted:               ${USE_PARTED}
-        use gperf:                   ${have_gperf}
-        use PolicyKit:               ${msg_polkit}
-        use ConsoleKit:              ${msg_conkit}
-        use ACL management:          ${msg_aclmgmt}
-        use umount.hal helper:       ${msg_umount_hal}
-        use ACPI:                    ${msg_acpi}
-        use PMU:                     ${msg_pmu}
-        use APM:                     ${msg_apm}
-        use Sony PIC:                ${msg_sonypic}
-
-        Macbook backlight support:   ${BUILD_MACBOOK} (Linux only, x86 only, requires libpci)
-        Macbook Pro utils:           ${BUILD_MACBOOKPRO} (Linux only, x86 only, requires libpci)
-        OMAP utils:                  ${BUILD_OMAP} (Linux only, arm only)
-        CPU frequency scaling:       ${BUILD_CPUFREQ} (Linux only)
-        Re-map multimedia keys:      ${BUILD_KEYMAPS} (Linux only, requires gperf)
-        Forward IBM ACPI events:     ${BUILD_ACPI_IBM} (Linux only)
-        Forward Toshiba ACPI events: ${BUILD_ACPI_TOSHIBA} (Linux only)
-	USB wireless mouse power:    ${BUILD_USBCSR} (Linux only, requires libusb)
-	Dell Backlight:              ${BUILD_DELL} (Linux only, requires libsmbios >= 0.13.4)
-
-        Maintainer mode:             ${USE_MAINTAINER_MODE}
-        Building verbose mode:       ${enable_verbose_mode}
-        Building api docs:           ${enable_gtk_doc}
-        Building docs:               ${enable_docbook_docs}
-        Building man pages:          ${enable_man_pages}
+        prefix:                           ${prefix}
+        libdir:                           ${libdir}
+        libexecdir:                       ${libexecdir}
+        bindir:                           ${bindir}
+        sbindir:                          ${sbindir}
+        datadir:                          ${datadir}
+        sysconfdir:                       ${sysconfdir}
+        localstatedir:                    ${localstatedir}
+        docdir:                           ${docdir}
+        dbus-1 system.d dir:              ${DBUS_SYS_DIR}
+        pci.ids dir:                      ${PCI_IDS_DIR}
+        usb.ids dir:                      ${USB_IDS_DIR}
+
+        compiler:                         ${CC}
+        cflags:                           ${CFLAGS}
+        ldflags:                          ${LDFLAGS}
+        cppflags:                         ${CPPFLAGS}
+        xmlto:                            ${XMLTO}
+        xmllint:                          ${XMLLINT}
+        User for HAL:                     ${HAL_USER}
+        Group for HAL:                    ${HAL_GROUP}
+        hald pidfile:                     ${HALD_PID_FILE}
+        hald socket dir:                  ${HALD_SOCKET_DIR}
+        eject program:                    ${EJECT_PROGRAM}
+
+        OS backend:                       ${HALD_BACKEND}
+
+        use acpi kernel interface:        ${acpi_proc}
+        use acpid interface:              ${acpi_acpid}
+        use libusb:                       ${USE_LIBUSB}
+        use libpci:                       ${USE_LIBPCI}
+        use libparted:                    ${USE_PARTED}
+        use gperf:                        ${have_gperf}
+        use PolicyKit:                    ${msg_polkit}
+        use ConsoleKit:                   ${msg_conkit}
+        use ACL management:               ${msg_aclmgmt}
+        use umount.hal helper:            ${msg_umount_hal}
+        use ACPI:                         ${msg_acpi}
+        use PMU:                          ${msg_pmu}
+        use APM:                          ${msg_apm}
+        use Sony PIC:                     ${msg_sonypic}
+
+        Macbook backlight support:        ${BUILD_MACBOOK} (Linux only, x86 only, requires libpci)
+        Macbook Pro utils:                ${BUILD_MACBOOKPRO} (Linux only, x86 only, requires libpci)
+        OMAP utils:                       ${BUILD_OMAP} (Linux only, arm only)
+        CPU frequency scaling:            ${BUILD_CPUFREQ} (Linux only)
+        Re-map multimedia keys:           ${BUILD_KEYMAPS} (Linux only, requires gperf)
+        Forward IBM ACPI events:          ${BUILD_ACPI_IBM} (Linux only)
+        Forward Toshiba ACPI events:      ${BUILD_ACPI_TOSHIBA} (Linux only)
+	USB wireless mouse power:         ${BUILD_USBCSR} (Linux only, requires libusb)
+	Dell Backlight:                   ${BUILD_DELL} (Linux only, requires libsmbios >= 0.13.4)
+
+	Support deprecated(removed) keys: ${BUILD_DEPRECATED_KEYS} (via a FDI-file)
+
+        Maintainer mode:                  ${USE_MAINTAINER_MODE}
+        Building verbose mode:            ${enable_verbose_mode}
+        Building api docs:                ${enable_gtk_doc}
+        Building docs:                    ${enable_docbook_docs}
+        Building man pages:               ${enable_man_pages}
 "
 
 if test x$BUILD_ACPI_IBM = xyes; then
diff --git a/fdi/information/10freedesktop/01-deprecated-keys.fdi b/fdi/information/10freedesktop/01-deprecated-keys.fdi
new file mode 100644
index 0000000..79337ae
--- /dev/null
+++ b/fdi/information/10freedesktop/01-deprecated-keys.fdi
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deviceinfo version="0.2">
+  <device>
+
+    <!-- 
+	 Note: This fdi-file contains several deprecated keys, which get removed 12 months
+               after they get marked as deprecated in the HAL spec. 
+               For backward compability of some unported tools this file can contain for a 
+	       short time some already finally removed keys. 
+     -->
+
+    <!-- temporary readded keys -->
+      <!-- *.physical_device - finally removed: 2008-03-03 -->
+      <!-- readd net.physical_device to prevent problems with NM -->
+      <match key="net.originating_device" exists="true">
+        <merge key="net.physical_device" type="copy_property">net.originating_device</merge>
+      </match>
+
+      <!-- info.bus - finally removed: 2008-03-03 -->
+      <!-- readd info.bus for usb/usb_device to prevent problems with (lib)gphoto2 and libmtp -->
+      <match key="info.subsystem" contains="usb">
+        <merge key="info.bus" type="copy_property">info.subsystem</merge>
+      </match>
+    
+    <!-- keys which are deprecated, but not removed finally -->
+      <!-- power_management.can_suspend_to_ram - planed remove: 2007-05-01 -->
+      <match key="power_management.can_suspend" exists="true">
+	<merge key="power_management.can_suspend_to_ram" type="copy_property">power_management.can_suspend</merge>
+      </match>
+      <!-- power_management.can_suspend_to_disk - planed remove: 2007-05-01 -->
+      <match key="power_management.can_hibernate" exists="true">
+	<merge key="power_management.can_suspend_to_disk" type="copy_property">power_management.can_hibernate</merge>
+      </match>
+
+  </device>
+</deviceinfo>
diff --git a/fdi/information/10freedesktop/Makefile.am b/fdi/information/10freedesktop/Makefile.am
index 08f8971..932f9b7 100644
--- a/fdi/information/10freedesktop/Makefile.am
+++ b/fdi/information/10freedesktop/Makefile.am
@@ -1,7 +1,11 @@
 
 fdidir = $(datadir)/hal/fdi/information/10freedesktop
 
-dist_fdi_DATA = 
+dist_fdi_DATA = 		
+
+if BUILD_DEPRECATED_KEYS
+dist_fdi_DATA += 01-deprecated-keys.fdi 
+endif
 
 check:
 	for f in $(dist_fdi_DATA); do \
diff --git a/hald/freebsd/hf-computer.c b/hald/freebsd/hf-computer.c
index 3f3205f..9e7aac4 100644
--- a/hald/freebsd/hf-computer.c
+++ b/hald/freebsd/hf-computer.c
@@ -165,10 +165,6 @@ hf_computer_device_add (void)
   hal_device_property_set_bool(device, "power_management.can_suspend", can_suspend_to_ram);
   hal_device_property_set_bool(device, "power_management.can_hibernate", can_suspend_to_disk);
 
-  /* XXX: These following two keys are deprecated. */
-  hal_device_property_set_bool(device, "power_management.can_suspend_to_ram", can_suspend_to_ram);
-  hal_device_property_set_bool(device, "power_management.can_suspend_to_disk", can_suspend_to_disk);
-
   if (hf_device_preprobe(device))
     {
       if (should_decode_dmi)
diff --git a/hald/linux/device.c b/hald/linux/device.c
index 8a9ed15..9b35eba 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -511,7 +511,6 @@ net_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *parent_de
 	hal_device_add_capability (d, "net");
 
 	hal_device_property_set_string (d, "net.originating_device", hal_device_get_udi (parent_dev));
-	hal_device_property_set_string (d, "net.physical_device", hal_device_get_udi (parent_dev));
 
 	ifname = hal_util_get_last_element (sysfs_path);
 	hal_device_property_set_string (d, "net.interface", ifname);
@@ -1709,7 +1708,6 @@ usb_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *parent_de
 		gint bmAttributes;
 
 		hal_device_property_set_string (d, "info.subsystem", "usb_device");
-		hal_device_property_set_string (d, "info.bus", "usb_device");
 
 		hal_util_set_driver (d, "info.linux.driver", sysfs_path);
 
@@ -1796,7 +1794,6 @@ usb_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *parent_de
 
 	} else {
 		hal_device_property_set_string (d, "info.subsystem", "usb");
-		hal_device_property_set_string (d, "info.bus", "usb");
 
 		/* take all usb_device.* properties from parent and make them usb.* on this object */
 		if (parent_dev != NULL)
@@ -3574,7 +3571,6 @@ virtio_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *parent
 	d = hal_device_new ();
 	hal_device_property_set_string (d, "linux.sysfs_path", sysfs_path);
 	hal_device_property_set_string (d, "info.subsystem", "virtio");
-	hal_device_property_set_string (d, "info.bus", "virtio");
 	if (parent_dev != NULL) {
 		hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent_dev));
 	} else {
diff --git a/hald/linux/osspec.c b/hald/linux/osspec.c
index 266453b..fb7f436 100644
--- a/hald/linux/osspec.c
+++ b/hald/linux/osspec.c
@@ -656,12 +656,6 @@ out:
 	hal_device_property_set_bool (d, "power_management.can_suspend", can_suspend);
 	hal_device_property_set_bool (d, "power_management.can_suspend_hybrid", FALSE);
 	hal_device_property_set_bool (d, "power_management.can_hibernate", can_hibernate);
-
-	/* WARNING: These keys are depreciated and power_management.can_suspend
-	 * and power_management.can_hibernate should be used instead.
-	 * These properties will be removed, but not before May 1st 2007. */
-	hal_device_property_set_bool (d, "power_management.can_suspend_to_ram", can_suspend);
-	hal_device_property_set_bool (d, "power_management.can_suspend_to_disk", can_hibernate);
 }
 
 static void


More information about the hal-commit mailing list