[Pkg-wmaker-commits] [wmbattery] 39/241: * Deal with acpi putting nothing but "Present: no" in the info file for the second battery of a thinkpad. This was with kernel 2.4.19-pre10. Closes: #149715 * Moved DEB_BUILD_OPTIONS out of makeinfo. * Updated to new autoconf.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Mon Aug 24 23:37:27 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository wmbattery.

commit 51e471129bb2c539d71d98cc78e96ad3fe24b269
Author: joey <joey at a4a2c43b-8ac3-0310-8836-e0e880c912e2>
Date:   Wed Jun 12 17:41:55 2002 +0000

       * Deal with acpi putting nothing but "Present: no" in the info file for the
         second battery of a thinkpad. This was with kernel 2.4.19-pre10.
         Closes: #149715
       * Moved DEB_BUILD_OPTIONS out of makeinfo.
       * Updated to new autoconf.
---
 Makefile                     |  2 +-
 acpi.c                       |  6 +++++-
 autoconf/makeinfo.in         |  5 -----
 configure.in => configure.ac |  0
 debian/changelog             | 10 ++++++++++
 debian/rules                 | 16 ++++++++++++++--
 6 files changed, 30 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index d80e36a..7774018 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,7 @@ wmbattery: wmbattery.o acpi.o sonypi.o
 
 wmbattery.o: wmbattery.c wmbattery.h
 
-configure: configure.in
+configure: configure.ac
 	autoconf
 
 config.status: configure
diff --git a/acpi.c b/acpi.c
index 04ffadf..e5ca2c3 100644
--- a/acpi.c
+++ b/acpi.c
@@ -88,7 +88,11 @@ char *get_acpi_value (const char *file, const char *key) {
 /* Returns the last full capacity of a battery. */
 int get_acpi_batt_capacity(int battery) {
 	int cap;
-	cap = atoi(get_acpi_value(acpi_batt_info[battery], "Last Full Capacity:"));
+	char *caps=get_acpi_value(acpi_batt_info[battery], "Last Full Capacity:");
+	if (caps == NULL)
+		cap=0; /* battery not present */
+	else
+		cap=atoi(caps);
 	/* This is ACPI's broken way of saying that there is no battery. */
 	if (cap == 655350)
 		return 0;
diff --git a/autoconf/makeinfo.in b/autoconf/makeinfo.in
index 32bfecb..37111ff 100644
--- a/autoconf/makeinfo.in
+++ b/autoconf/makeinfo.in
@@ -14,8 +14,3 @@ INSTALL_DATA	= @INSTALL_DATA@
 INSTALL_PROGRAM	= @INSTALL_PROGRAM@
 LDFLAGS		= @LDFLAGS@
 LIBS		= @LIBS@
-
-# DEB_BUILD_OPTIONS suport, to control binary stripping.
-ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
-INSTALL_PROGRAM += -s
-endif
diff --git a/configure.in b/configure.ac
similarity index 100%
rename from configure.in
rename to configure.ac
diff --git a/debian/changelog b/debian/changelog
index 15dceca..97b2b7a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+wmbattery (2.10) unstable; urgency=low
+
+  * Deal with acpi putting nothing but "Present: no" in the info file for the
+    second battery of a thinkpad. This was with kernel 2.4.19-pre10.
+    Closes: #149715
+  * Moved DEB_BUILD_OPTIONS out of makeinfo.
+  * Updated to new autoconf.
+
+ -- Joey Hess <joeyh at debian.org>  Tue, 11 Jun 2002 22:51:45 -0400
+
 wmbattery (2.09) unstable; urgency=low
 
   * Moved makefile stuff out of makeinfo, so it is just definitions.
diff --git a/debian/rules b/debian/rules
index fd3f1e2..78bd916 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,11 +1,22 @@
 #!/usr/bin/make -f
 
+# DEB_BUILD_OPTIONS suport
+INSTALL_PROGRAM=install
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+INSTALL_PROGRAM += -s
+endif
+
+CFLAGS=-O2 -Wall
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+CFLAGS += -g
+endif
+
 build: build-stamp
 build-stamp:
 	dh_testdir
 	autoconf
 	./configure --mandir=$(shell pwd)/debian/wmbattery/usr/share/man \
-		--prefix=/usr
+		--prefix=/usr CFLAGS="$(CFLAGS)"
 	$(MAKE)
 	touch build-stamp
 
@@ -21,7 +32,8 @@ install: build
 	dh_testroot
 	dh_clean -k
 	dh_installdirs
-	$(MAKE) prefix=debian/wmbattery/usr install
+	$(MAKE) prefix=debian/wmbattery/usr \
+		INSTALL_PROGRAM="$(INSTALL_PROGRAM)" install
 
 # Build architecture-independent files here.
 binary-indep: build install

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmbattery.git



More information about the Pkg-wmaker-commits mailing list