After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 607254 - Get rid of HAL
Get rid of HAL
Status: RESOLVED FIXED
Product: gnome-applets
Classification: Other
Component: battery
2.29.x
Other All
: Normal normal
: ---
Assigned To: gnome-applets Maintainers
gnome-applets Maintainers
Depends on:
Blocks: 593938
 
 
Reported: 2010-01-17 22:03 UTC by Javier Jardón (IRC: jjardon)
Modified: 2013-05-20 14:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Adding upower support to the battstat applet (24.68 KB, patch)
2010-07-05 19:49 UTC, Joachim Breitner
none Details | Review
Updated patch against git master (19.34 KB, patch)
2011-03-21 21:34 UTC, Josselin Mouette
none Details | Review
Updated patch to link against -lm (19.05 KB, patch)
2011-10-16 00:43 UTC, Michael Biebl
committed Details | Review

Description Javier Jardón (IRC: jjardon) 2010-01-17 22:03: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
Comment 1 André Klapper 2010-01-18 09:14:56 UTC
Where exactly in the code is it used?
Comment 2 Javier Jardón (IRC: jjardon) 2010-01-18 15:32:49 UTC
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
Comment 3 André Klapper 2010-01-18 15:36:08 UTC
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.
Comment 4 André Klapper 2010-01-23 20:57:39 UTC
NEEDINFO as per last comment
Comment 5 Javier Jardón (IRC: jjardon) 2010-01-24 00:53:14 UTC
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.
Comment 6 Joachim Breitner 2010-07-02 08:20:34 UTC
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
Comment 7 Joachim Breitner 2010-07-05 19:47:15 UTC
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.
Comment 8 Joachim Breitner 2010-07-05 19:49:40 UTC
Created attachment 165303 [details] [review]
Adding upower support to the battstat applet
Comment 9 Joachim Breitner 2010-07-05 19:54:37 UTC
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.
Comment 10 Enrico Minack 2011-01-03 06:24:40 UTC
Yes, "make" modifies tracked files in certain places of gnome-applets. I guess those changes can be ignored safely.
Comment 11 Josselin Mouette 2011-03-21 21:34:23 UTC
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).
Comment 12 Michael Biebl 2011-10-16 00:43:50 UTC
Created attachment 199096 [details] [review]
Updated patch to link against -lm

As battstat-upower.c uses flor(), we need to link against -lm