head 1.6; access; symbols pkgsrc-2013Q2:1.6.0.52 pkgsrc-2013Q2-base:1.6 pkgsrc-2012Q4:1.6.0.50 pkgsrc-2012Q4-base:1.6 pkgsrc-2011Q4:1.6.0.48 pkgsrc-2011Q4-base:1.6 pkgsrc-2011Q2:1.6.0.46 pkgsrc-2011Q2-base:1.6 pkgsrc-2009Q4:1.6.0.44 pkgsrc-2009Q4-base:1.6 pkgsrc-2008Q4:1.6.0.42 pkgsrc-2008Q4-base:1.6 pkgsrc-2008Q3:1.6.0.40 pkgsrc-2008Q3-base:1.6 cube-native-xorg:1.6.0.38 cube-native-xorg-base:1.6 pkgsrc-2008Q2:1.6.0.36 pkgsrc-2008Q2-base:1.6 pkgsrc-2008Q1:1.6.0.34 pkgsrc-2008Q1-base:1.6 pkgsrc-2007Q4:1.6.0.32 pkgsrc-2007Q4-base:1.6 pkgsrc-2007Q3:1.6.0.30 pkgsrc-2007Q3-base:1.6 pkgsrc-2007Q2:1.6.0.28 pkgsrc-2007Q2-base:1.6 pkgsrc-2007Q1:1.6.0.26 pkgsrc-2007Q1-base:1.6 pkgsrc-2006Q4:1.6.0.24 pkgsrc-2006Q4-base:1.6 pkgsrc-2006Q3:1.6.0.22 pkgsrc-2006Q3-base:1.6 pkgsrc-2006Q2:1.6.0.20 pkgsrc-2006Q2-base:1.6 pkgsrc-2006Q1:1.6.0.18 pkgsrc-2006Q1-base:1.6 pkgsrc-2005Q4:1.6.0.16 pkgsrc-2005Q4-base:1.6 pkgsrc-2005Q3:1.6.0.14 pkgsrc-2005Q3-base:1.6 pkgsrc-2005Q2:1.6.0.12 pkgsrc-2005Q2-base:1.6 pkgsrc-2005Q1:1.6.0.10 pkgsrc-2005Q1-base:1.6 pkgsrc-2004Q4:1.6.0.8 pkgsrc-2004Q4-base:1.6 pkgsrc-2004Q3:1.6.0.6 pkgsrc-2004Q3-base:1.6 pkgsrc-2004Q2:1.6.0.4 pkgsrc-2004Q2-base:1.6 pkgsrc-2004Q1:1.6.0.2 pkgsrc-2004Q1-base:1.6 pkgsrc-2003Q4:1.5.0.4 pkgsrc-2003Q4-base:1.5 netbsd-1-6-1:1.5.0.2 netbsd-1-6-1-base:1.5 buildlink2:1.3.0.2 buildlink2-base:1.4 netbsd-1-5-PATCH003:1.3 netbsd-1-5-PATCH001:1.1; locks; strict; comment @# @; 1.6 date 2004.02.15.13.14.25; author lukem; state dead; branches; next 1.5; 1.5 date 2002.12.31.22.47.06; author lukem; state Exp; branches; next 1.4; 1.4 date 2002.05.13.14.40.51; author lukem; state dead; branches; next 1.3; 1.3 date 2001.11.20.14.53.04; author lukem; state Exp; branches 1.3.2.1; next 1.2; 1.2 date 2001.09.28.04.37.28; author lukem; state dead; branches; next 1.1; 1.1 date 2001.03.11.16.22.08; author martin; state Exp; branches; next ; 1.3.2.1 date 2002.06.23.19.01.13; author jlam; state dead; branches; next ; desc @@ 1.6 log @Update to ups-nut 1.4.1. Many changes, including * various configuation file format changes * most UPS drivers enhanced * upsmon/upssched support a lockfile * chroot jails supported * various bugfixes (Refer to http://random.networkupstools.org/source/1.4/new-1.4.1.txt for more information) pkg update based on work sent in private email by Daniel Farrugia, with various fixes by me. @ text @$NetBSD: patch-af,v 1.5 2002/12/31 22:47:06 lukem Exp $ --- drivers/newapc.c.orig Mon Oct 7 14:35:35 2002 +++ drivers/newapc.c @@@@ -182,11 +182,16 @@@@ char * convert_ups2info (struct apc_cmdt case APC_F_CELCIUS: case APC_F_HEX: case APC_F_DEC: - case APC_F_SECONDS: - case APC_F_HOURS: case APC_F_LEAVE: /* All of these just pass through at present */ ptr = upsval; + break; + case APC_F_SECONDS: + case APC_F_HOURS: + /* Parse number */ + tval = strtol(upsval, NULL, 10); + sprintf(tmp, "%d", tval); + ptr = tmp; break; case APC_F_MINUTES: /* Convert to seconds - NUT standard time measurement */ @ 1.5 log @Convert back to supporting INFO_RUNTIME instead of INFO_BATT_RUNTIME. I *really* dislike how newapc changed from supporting INFO_RUNTIME (runtime in minutes, which is what the UPS actually reports) to INFO_BATT_RUNTIME (runtime in seconds, which is UPS result * 60), because the latter is much less useful as a realistic guess (IMHO), and because this broke my upslog format and ups monitoring stuff that used '%VAR runtime'. (Unfortunately, newapc is written in a way which precludes supporting multiple results from the same 'UPS status code' (in this case `j'), so we can't support both results at this time. I decided that INFO_RUNTIME is more useful, because '81' (minutes) is easier to "use" than '4860' (seconds)) @ text @d1 1 a1 1 $NetBSD$ @ 1.4 log @Update ups-nut from 0.45.3 to 0.45.5. Notable changes: - upsd.users(5) has changed formats. NOTE: you need to update your file for upsd(8) to function - upsmon can reload its configuration on the fly (with '-c reload') - upsdrvctl can power off UPS's in an orderly fashion - new drivers: - tripplite - Tripp-Lite SmartUPS models - newvictron - IMV/Victron hardware - bestferrups801-807 - Best FerrUPS 8.01-8.07 firmware - genericups type 14 - for Online P-series units - upsdrvctl now waits up to "maxstartdelay" (default 45) seconds for a driver to start before it gives up and goes to the next entry (refer to CHANGES in the distribution, or http://www.exploits.org/nut/release/new-0.45.4.txt and http://www.exploits.org/nut/release/new-0.45.5.txt for a detailed list) @ text @d1 1 a1 1 $NetBSD: patch-af,v 1.3 2001/11/20 14:53:04 lukem Exp $ d3 4 a6 3 --- models/newapc.c.orig Thu Oct 11 04:32:07 2001 +++ models/newapc.c @@@@ -185,11 +185,18 @@@@ d9 2 a10 3 case APC_F_SECONDS: - case APC_F_MINUTES: case APC_F_HOURS: d15 5 a19 6 + case APC_F_MINUTES: + strncpy(tmp, upsval, sizeof(tmp) - 1); + tmp[sizeof(tmp) - 1] = 0; + tval = strlen(tmp) - 1; + if (tmp[tval] == ':') /* cull trailing `:' */ + tmp[tval] = 0; d22 2 a23 2 default: /* Moan */ @ 1.3 log @newapc driver: chop any trailing `:'s off the end of APC_F_MINUTES fields; specifically the RUNTIME field on my SmartUPS-1400. @ text @d1 1 a1 1 $NetBSD$ @ 1.3.2.1 log @Merge from pkgsrc-current to buildlink2 branch. @ text @d1 1 a1 1 $NetBSD: patch-af,v 1.3 2001/11/20 14:53:04 lukem Exp $ @ 1.2 log @update from 0.44.3-pre5 to 0.45.1 (with an extra vendor patch). changes include: - ups info moved to ups.conf instead of upsd.conf - unified driver control between ups drivers - upsmon doesn't run as root by default any more; most of the work is done by an unprivileged child, with a parent only accepting shutdown messages - more model support: - AEG Proect S. - aeg - SMS Ltda (Brazillian) - sms - SOLA 620 - bestups - Ever UPS - everups - various other improvements and bugfixes see http://www.exploits.org/nut/release/new-0.45.1.txt for more details) @ text @d1 1 a1 1 $NetBSD: patch-af,v 1.1 2001/03/11 16:22:08 martin Exp $ d3 22 a24 11 --- clients/upslog.c.orig Tue Feb 27 05:27:32 2001 +++ clients/upslog.c Sun Mar 11 17:14:20 2001 @@@@ -222,7 +222,7 @@@@ else if (strncasecmp(cmpstr, "ETIME", 5) == 0) { char timebuf[16]; - snprintf (timebuf, sizeof(timebuf), "%ld", tod); + snprintf (timebuf, sizeof(timebuf), "%ld", (unsigned long)tod); strlcat(logbuffer, timebuf, sizeof(logbuffer)); logbufremain -= strlen(timebuf); } @ 1.1 log @Make this LP64 save. @ text @d1 1 a1 1 $NetBSD$ @