[Goodies-commits] r5210 - in xfce4-sensors-plugin/trunk: . panel-plugin
Fabian Nowak
timystery at xfce.org
Thu Aug 7 22:30:48 CEST 2008
Author: timystery
Date: 2008-08-07 20:30:48 +0000 (Thu, 07 Aug 2008)
New Revision: 5210
Modified:
xfce4-sensors-plugin/trunk/INSTALL
xfce4-sensors-plugin/trunk/panel-plugin/acpi.c
Log:
- fixed battery path for acpi like reported by debian users
- fixed fan state handling like reported by debian users and pretty similar to their suggested patch - added an else path to have both paths properly free()!!!
Modified: xfce4-sensors-plugin/trunk/INSTALL
===================================================================
--- xfce4-sensors-plugin/trunk/INSTALL 2008-08-07 17:20:24 UTC (rev 5209)
+++ xfce4-sensors-plugin/trunk/INSTALL 2008-08-07 20:30:48 UTC (rev 5210)
@@ -1,8 +1,8 @@
Installation Instructions
*************************
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
-Software Foundation, Inc.
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006, 2007 Free Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
@@ -10,7 +10,10 @@
Basic Installation
==================
-These are generic installation instructions.
+Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package. The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
@@ -23,9 +26,9 @@
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring. (Caching is
+the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
-cache files.)
+cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
@@ -35,20 +38,17 @@
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'. You only need
-`configure.ac' if you want to change it or regenerate `configure' using
-a newer version of `autoconf'.
+`configure' by a program called `autoconf'. You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
- `./configure' to configure the package for your system. If you're
- using `csh' on an old version of System V, you might need to type
- `sh ./configure' instead to prevent `csh' from trying to execute
- `configure' itself.
+ `./configure' to configure the package for your system.
- Running `configure' takes awhile. While running, it prints some
- messages telling which features it is checking for.
+ Running `configure' might take a while. While running, it prints
+ some messages telling which features it is checking for.
2. Type `make' to compile the package.
@@ -67,6 +67,9 @@
all sorts of other programs in order to regenerate files that came
with the distribution.
+ 6. Often, you can also type `make uninstall' to remove the installed
+ files again.
+
Compilers and Options
=====================
@@ -78,7 +81,7 @@
by setting variables in the command line or in the environment. Here
is an example:
- ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
+ ./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
@@ -87,17 +90,15 @@
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
-own directory. To do this, you must use a version of `make' that
-supports the `VPATH' variable, such as GNU `make'. `cd' to the
+own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
- If you have to use a `make' that does not support the `VPATH'
-variable, you have to compile the package for one architecture at a
-time in the source code directory. After you have installed the
-package for one architecture, use `make distclean' before reconfiguring
-for another architecture.
+ With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory. After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
Installation Names
==================
@@ -190,12 +191,12 @@
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
-overridden in the site shell script). Here is a another example:
+overridden in the site shell script).
- /bin/bash ./configure CONFIG_SHELL=/bin/bash
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug. Until the bug is fixed you can use this workaround:
-Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
-configuration-related scripts to be executed by `/bin/bash'.
+ CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
Modified: xfce4-sensors-plugin/trunk/panel-plugin/acpi.c
===================================================================
--- xfce4-sensors-plugin/trunk/panel-plugin/acpi.c 2008-08-07 17:20:24 UTC (rev 5209)
+++ xfce4-sensors-plugin/trunk/panel-plugin/acpi.c 2008-08-07 20:30:48 UTC (rev 5210)
@@ -445,7 +445,7 @@
void
refresh_acpi (gpointer chip_feature, gpointer data)
{
- char *file, *zone;
+ char *file, *zone, *state;
t_chipfeature *cf;
TRACE ("enters refresh_acpi");
@@ -464,17 +464,29 @@
break;
case ENERGY:
- zone = g_strdup_printf ("%s/%s", ACPI_DIR_BATTERY, cf->devicename);
- cf->raw_value = get_battery_zone_value (zone);
- g_free (zone);
+ /* zone = g_strdup_printf ("%s/%s", ACPI_DIR_BATTERY, cf->devicename); */
+ cf->raw_value = get_battery_zone_value (cf->devicename); /* zone */
+ /* g_free (zone); */
/* g_free (cf->formatted_value);
cf->formatted_value = g_strdup_printf (_("%.0f mWh"), cf->raw_value); */
break;
case STATE:
- file = g_strdup_printf ("%s/%s/state", ACPI_DIR_FAN, cf->devicename);
- cf->raw_value = strcmp(get_acpi_value(file), "on")==0 ? 1.0 : 0.0;
+ file = g_strdup_printf ("%s/%s/%s/state", ACPI_PATH, ACPI_DIR_FAN, cf->devicename);
+
+ state = get_acpi_value(file);
+ if (state==NULL)
+ {
+ DBG("Could not determine fan state.");
+ cf->raw_value = 0.0;
+ }
+ else
+ {
+ cf->raw_value = strncmp(state, "on", 2)==0 ? 1.0 : 0.0;
+ /* g_free (state); Anyone with a fan state please check that, should be necessary to free this string as well */
+ }
g_free (file);
+
/* g_free (cf->formatted_value);
cf->formatted_value = g_strdup_printf (_("%.0f"), cf->raw_value); */
break;
@@ -544,6 +556,11 @@
}
+/**
+ * Get the value from inside an acpi's file.
+ * @param filename An absolute filename, most likely starting with /proc/acpi...
+ * @return value found inside as a character
+ */
char *
get_acpi_value (char *filename)
{
More information about the Goodies-commits
mailing list