summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorlukem <lukem@pkgsrc.org>2002-12-31 22:47:05 +0000
committerlukem <lukem@pkgsrc.org>2002-12-31 22:47:05 +0000
commitc81681ad85ae55338152c65e96b9b0b7c3e7d8e3 (patch)
tree80515157499c92fbbc2a14bfb32a719ea39a25a3 /sysutils
parent831fb6d83e7a2fd7f0d4183bf811ea8e25722b6c (diff)
downloadpkgsrc-c81681ad85ae55338152c65e96b9b0b7c3e7d8e3.tar.gz
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))
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/ups-nut/Makefile3
-rw-r--r--sysutils/ups-nut/distinfo4
-rw-r--r--sysutils/ups-nut/patches/patch-af23
-rw-r--r--sysutils/ups-nut/patches/patch-ag13
4 files changed, 41 insertions, 2 deletions
diff --git a/sysutils/ups-nut/Makefile b/sysutils/ups-nut/Makefile
index 5253b6e8e5a..5f7cb4822bb 100644
--- a/sysutils/ups-nut/Makefile
+++ b/sysutils/ups-nut/Makefile
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.25 2002/12/13 04:23:17 lukem Exp $
+# $NetBSD: Makefile,v 1.26 2002/12/31 22:47:05 lukem Exp $
#
DISTNAME= nut-1.2.1
PKGNAME= ups-nut-1.2.1
+PKGREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= http://www.exploits.org/nut/release/1.2/
diff --git a/sysutils/ups-nut/distinfo b/sysutils/ups-nut/distinfo
index ab54fce274a..1ae802e747b 100644
--- a/sysutils/ups-nut/distinfo
+++ b/sysutils/ups-nut/distinfo
@@ -1,7 +1,9 @@
-$NetBSD: distinfo,v 1.16 2002/12/13 04:23:17 lukem Exp $
+$NetBSD: distinfo,v 1.17 2002/12/31 22:47:06 lukem Exp $
SHA1 (nut-1.2.1.tar.gz) = db55b0165ef594ad1cf73bf5d3d9336a0ac0fb93
Size (nut-1.2.1.tar.gz) = 444256 bytes
SHA1 (patch-ab) = 6f9ca3c1faa4cb20598116f602596f43d1e07199
SHA1 (patch-ad) = 56b1b50affe7615b7ecc5e5db0305303ac2cd078
+SHA1 (patch-af) = bc79381000992169074f6be02fcee7bbc2495ec9
+SHA1 (patch-ag) = df3cab5fafe985af9b8cbd0879b8e7c88b4e35b3
SHA1 (patch-ah) = 8a6e0ce86a30bb2009654f4b1c5fcb25af22e7db
diff --git a/sysutils/ups-nut/patches/patch-af b/sysutils/ups-nut/patches/patch-af
new file mode 100644
index 00000000000..9936162ecec
--- /dev/null
+++ b/sysutils/ups-nut/patches/patch-af
@@ -0,0 +1,23 @@
+$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 */
diff --git a/sysutils/ups-nut/patches/patch-ag b/sysutils/ups-nut/patches/patch-ag
new file mode 100644
index 00000000000..d769060b17e
--- /dev/null
+++ b/sysutils/ups-nut/patches/patch-ag
@@ -0,0 +1,13 @@
+$NetBSD: patch-ag,v 1.7 2002/12/31 22:47:07 lukem Exp $
+
+--- drivers/newapc.h.orig Tue Aug 20 17:06:26 2002
++++ drivers/newapc.h
+@@ -119,7 +119,7 @@ struct apc_cmdtab_t {
+ {INFO_MINUTIL, 0, 0, APC_POLL|APC_F_VOLT, NULL, NULL, 'N'},
+ {INFO_OUTVOLT, 0, 0, APC_POLL|APC_F_VOLT, NULL, NULL, 'O'},
+ {INFO_SLFTSTRES,0, 0, APC_POLL, NULL, NULL, 'X'},
+- {INFO_BATT_RUNTIME,0, 0, APC_POLL|APC_F_MINUTES, NULL, NULL, 'j'},
++ {INFO_RUNTIME, 0, 0, APC_POLL|APC_F_SECONDS, NULL, NULL, 'j'},
+ {INFO_MFRDATE, 0, 0, 0, NULL, NULL, 'm'},
+ {INFO_TEMPMAX, 0, 0, APC_F_CELCIUS, NULL, NULL, '['},
+ {INFO_TEMPMIN, 0, 0, APC_F_CELCIUS, NULL, NULL, ']'},