GNOME Bugzilla – Bug 607254
Get rid of HAL
Last modified: 2013-05-20 14:31:27 UTC
Hal is deprecated, see http://www.freedesktop.org/wiki/Software/hal "HAL is in maintenance mode - no new features are added. All future development focuses on Software/DeviceKit-disks, Software/DeviceKit-power, NetworkManager, PulseAudio, udev (gudev), ..." So, we can use DeviceKit-power here to get rid of HAL
Where exactly in the code is it used?
In the battstat/battstat-hal.c file, which is used in battstat/power-management.c: $ git grep HAVE_HAL battstat/battstat-hal.c:#ifdef HAVE_HAL battstat/battstat-hal.c:#endif /* HAVE_HAL */ battstat/power-management.c:#ifdef HAVE_HAL battstat/power-management.c:#undef HAVE_HAL battstat/power-management.c:#ifdef HAVE_HAL battstat/power-management.c:#ifdef HAVE_HAL battstat/power-management.c:#ifdef HAVE_HAL battstat/power-management.c:#ifdef HAVE_HAL
So it's ifdef'ed. In case HAL is not available, what happens? If it's code that also offers using udev (or whatever is currently the status), I don't see any reason to remove compatibility code and this is INVALID.
NEEDINFO as per last comment
Ops, sorry Andre. Seems that It uses ACPI as a fallback. I'm not very sure if HAL/acpi code should be ported to upower, but if not, feel free to close this bug report.
The applet was completely disabled in GNOME in order to remove the HAL dependency. I asked re-enabling using the fallback code, but maybe upower support would be cleaner: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=580429
I looked into it and creating a upower interface was not too hard. Here is a patch that supports it. The documentation is updated as well, but no screenshot is generated (there is one showing HAL support). You might want to consider disabling the HAL code by default or removing it completely, avoiding bit-rot. At least eventually.
Created attachment 165303 [details] [review] Adding upower support to the battstat applet
Hmm, the changes to battstat/docs/de/battstat.xml battstat/docs/eu/battstat.xml were not intentional. Does "make" modify files that are also tracked by git? I guess you’ll know whether to apply these or not.
Yes, "make" modifies tracked files in certain places of gnome-applets. I guess those changes can be ignored safely.
Created attachment 184008 [details] [review] Updated patch against git master The patch needed some fixes against git master. Furthermore it had a very serious bug in error handling (filling a char * with sprintf).
Created attachment 199096 [details] [review] Updated patch to link against -lm As battstat-upower.c uses flor(), we need to link against -lm