Tue Nov 10 08:52:38 2015 UTC ()
s/long// (leaving "unsigned") in some code that fails when long is
anything but 32 bits (and unsigned is 32 bits in pretty much all
modern platforms.)

this allows ups-nut-usb to work on sparc64 for me, otherwise the
hidparser fails.

bump pkg revision for ups-nut-usb, as that pkg changes (at least
for big endian platforms.)


(mrg)
diff -r1.29 -r1.30 pkgsrc/sysutils/ups-nut/distinfo
diff -r1.4 -r1.5 pkgsrc/sysutils/ups-nut-usb/Makefile
diff -r0 -r1.1 pkgsrc/sysutils/ups-nut/patches/patch-drivers_hidparser.c

cvs diff -r1.29 -r1.30 pkgsrc/sysutils/ups-nut/distinfo (expand / switch to unified diff)

--- pkgsrc/sysutils/ups-nut/distinfo 2015/11/04 01:32:34 1.29
+++ pkgsrc/sysutils/ups-nut/distinfo 2015/11/10 08:52:38 1.30
@@ -1,8 +1,9 @@ @@ -1,8 +1,9 @@
1$NetBSD: distinfo,v 1.29 2015/11/04 01:32:34 agc Exp $ 1$NetBSD: distinfo,v 1.30 2015/11/10 08:52:38 mrg Exp $
2 2
3SHA1 (nut-2.6.5.tar.gz) = 320debe11df91f04e32824694d0c89a020677f71 3SHA1 (nut-2.6.5.tar.gz) = 320debe11df91f04e32824694d0c89a020677f71
4RMD160 (nut-2.6.5.tar.gz) = d6e6acd4696e3c3f8c0ecd998f8676a8625decb9 4RMD160 (nut-2.6.5.tar.gz) = d6e6acd4696e3c3f8c0ecd998f8676a8625decb9
5SHA512 (nut-2.6.5.tar.gz) = f1c76e6280057dc558d53451e7de2bdc7f37a0f175b1c52c27e7dcb83deeb78f6885007ad188a7a3a19e411eba87e03eb2246310bd7a5a5bb6fa3ad2bebd49d8 5SHA512 (nut-2.6.5.tar.gz) = f1c76e6280057dc558d53451e7de2bdc7f37a0f175b1c52c27e7dcb83deeb78f6885007ad188a7a3a19e411eba87e03eb2246310bd7a5a5bb6fa3ad2bebd49d8
6Size (nut-2.6.5.tar.gz) = 2038832 bytes 6Size (nut-2.6.5.tar.gz) = 2038832 bytes
7SHA1 (patch-aa) = 48110f378518edb43a653753eb4ef6ea28344c62 7SHA1 (patch-aa) = 48110f378518edb43a653753eb4ef6ea28344c62
8SHA1 (patch-ab) = 44988118570714ab2c3fffdd75909c2255b94fa6 8SHA1 (patch-ab) = 44988118570714ab2c3fffdd75909c2255b94fa6
 9SHA1 (patch-drivers_hidparser.c) = c71d84bbf3140db1f82ef155fdf5afec79cbd38d

cvs diff -r1.4 -r1.5 pkgsrc/sysutils/ups-nut-usb/Makefile (expand / switch to unified diff)

--- pkgsrc/sysutils/ups-nut-usb/Makefile 2012/10/23 19:51:28 1.4
+++ pkgsrc/sysutils/ups-nut-usb/Makefile 2015/11/10 08:52:38 1.5
@@ -1,18 +1,19 @@ @@ -1,18 +1,19 @@
1# $NetBSD: Makefile,v 1.4 2012/10/23 19:51:28 asau Exp $ 1# $NetBSD: Makefile,v 1.5 2015/11/10 08:52:38 mrg Exp $
2 2
3.include "../../sysutils/ups-nut/Makefile.common" 3.include "../../sysutils/ups-nut/Makefile.common"
4 4
5PKGNAME= ${DISTNAME:S/nut/ups-nut-usb/} 5PKGNAME= ${DISTNAME:S/nut/ups-nut-usb/}
 6PKGREVISION= 1
6COMMENT= Network UPS Tools USB drivers 7COMMENT= Network UPS Tools USB drivers
7 8
8DEPENDS+= ups-nut-2.*:../../sysutils/ups-nut 9DEPENDS+= ups-nut-2.*:../../sysutils/ups-nut
9 10
10INSTALLATION_DIRS+= ${PREFIX}/libexec/nut 11INSTALLATION_DIRS+= ${PREFIX}/libexec/nut
11INSTALLATION_DIRS+= ${PREFIX}/${PKGMANDIR}/man8 12INSTALLATION_DIRS+= ${PREFIX}/${PKGMANDIR}/man8
12 13
13BUILD_DEFS+= NUT_STATEDIR 14BUILD_DEFS+= NUT_STATEDIR
14 15
15CONFIGURE_ARGS+= --with-usb --with-drvpath=${NUT_DRVDIR:Q} 16CONFIGURE_ARGS+= --with-usb --with-drvpath=${NUT_DRVDIR:Q}
16 17
17do-install: 18do-install:
18 for f in usbhid-ups bcmxcp_usb tripplite_usb blazer_usb richcomm_usb;\ 19 for f in usbhid-ups bcmxcp_usb tripplite_usb blazer_usb richcomm_usb;\

File Added: pkgsrc/sysutils/ups-nut/patches/Attic/patch-drivers_hidparser.c
$NetBSD: patch-drivers_hidparser.c,v 1.1 2015/11/10 08:52:38 mrg Exp $

work around horrible big-endian code that assumes "long" is 32 bits.
enables usb-nut-ups to work on sparc64.


--- drivers/hidparser.c.orig	2012-07-31 10:38:59.000000000 -0700
+++ drivers/hidparser.c	2015-11-10 00:30:11.000000000 -0800
@@ -163,7 +163,7 @@
 #if WORDS_BIGENDIAN
 			{
 				int	i;
-				unsigned long	valTmp = 0;
+				unsigned valTmp = 0;
 
 				for (i = 0; i < ItemSize[pParser->Item & SIZE_MASK]; i++) {
 					memcpy(&valTmp, &pParser->ReportDesc[(pParser->Pos)+i], 1);