Bug#770984: [apcupsd] apcaccess may not work on ARM

2015-04-14 Thread Emanuele Rocca
NMU diff attached.
diff -u apcupsd-3.14.12/debian/changelog apcupsd-3.14.12/debian/changelog
--- apcupsd-3.14.12/debian/changelog
+++ apcupsd-3.14.12/debian/changelog
@@ -1,3 +1,11 @@
+apcupsd (3.14.12-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * src/apcaccess.c: declare "ch" as int to match getopt return type. Fixes
+apcaccess on ARM. (Closes: #770984)
+
+ -- Emanuele Rocca   Tue, 14 Apr 2015 09:14:33 +0200
+
 apcupsd (3.14.12-1) unstable; urgency=low
 
   * [84a0ea2] Imported Upstream version 3.14.12
diff -u apcupsd-3.14.12/debian/patches/series apcupsd-3.14.12/debian/patches/series
--- apcupsd-3.14.12/debian/patches/series
+++ apcupsd-3.14.12/debian/patches/series
@@ -4,0 +5 @@
+05-apcaccess-arm.patch
only in patch2:
unchanged:
--- apcupsd-3.14.12.orig/debian/patches/05-apcaccess-arm.patch
+++ apcupsd-3.14.12/debian/patches/05-apcaccess-arm.patch
@@ -0,0 +1,13 @@
+Declare "ch" as int to match getopt return type. Fix apcaccess behavior on
+arm.
+--- a/src/apcaccess.c
 b/src/apcaccess.c
+@@ -146,7 +146,7 @@
+ #endif
+ 
+// Process standard options
+-   char ch;
++   int ch;
+while ((ch = getopt(argc, argv, "f:h:p:u")) != -1)
+{
+   switch (ch)


Bug#770984: [apcupsd] apcaccess may not work on ARM

2015-04-10 Thread Emanuele Rocca
Hi,

On 25/11 07:15, Adrien Grellier wrote:
> apcaccess is not working on raspberry pi : it always respond as if -h
> option was given.

I can confirm that the issue is reproducible on asachi.debian.org (armhf):

(sid_armhf-dchroot)ema@asachi:~$ /sbin/apcaccess 
Usage: apcaccess [-f ] [-h [:]] [-p 
] [-u] [] [[:]]

 -f  Load default host,port from given conf file (default: 
/etc/apcupsd/apcupsd.conf)
 -h  Connect to host and port (supercedes conf file)
 -p  Return only the value of the named parameter rather than all 
parameters and values
 -u  Strip unit labels

Supported commands: 'status' (default)
Trailing host/port spec overrides -h and conf file.

And that the proposed patch fixes the bug:

(sid_armhf-dchroot)ema@asachi:~$ ./x/sbin/apcaccess 
APC  : 001,017,0437
DATE : 2015-04-10 20:51:16 +  
HOSTNAME : asachi
[...]


--- apcupsd-3.14.12.orig/src/apcaccess.c
+++ apcupsd-3.14.12/src/apcaccess.c
@@ -146,7 +146,7 @@
 #endif
 
// Process standard options
-   char ch;
+   int ch;
while ((ch = getopt(argc, argv, "f:h:p:u")) != -1)
{
   switch (ch)


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#770984: [apcupsd] apcaccess may not work on ARM

2014-11-25 Thread Adrien Grellier
Package: apcupsd
Version: 3.14.12-1
Severity: important

Hi,

apcaccess is not working on raspberry pi : it always respond as if -h option 
was given. 

I have test with raspbian on a raspberry pi (jessie repository), not directly 
Debian, but I think it will give the same result in a pure Debian.

Fortunatelly, this bug has already been reported for Archlinux:
https://github.com/archlinuxarm/PKGBUILDs/issues/886

and a simple patch is available:
https://github.com/archlinuxarm/PKGBUILDs/commit/80909d88d1b26b615ea447baa9bc87cfce918ae3

+--- a/branches/Branch-3_14/src/apcaccess.c
 b/branches/Branch-3_14/src/apcaccess.c
+@@ -146,7 +146,7 @@
+ #endif
+
+ // Process standard options
+- char ch;
++ int ch;
+ while ((ch = getopt(argc, argv, "f:h:p:u")) != -1)
+ {
+ switch (ch)


Could you please apply it for jessie ?

Kind Regards,

Adrien

--- System information. ---
Architecture: amd64
Kernel:   Linux 3.16.0-4-amd64

Debian Release: jessie/sid
  500 unstableftp.fr.debian.org 
  500 testing-updates ftp.fr.debian.org 
  500 testing security.debian.org 
  500 testing ftp.fr.debian.org 
1 experimentalftp.fr.debian.org 

--- Package information. ---
Package's Depends field is empty.

Package's Recommends field is empty.

Package's Suggests field is empty.

signature.asc
Description: This is a digitally signed message part.