pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/ups-nut sysutils/ups-nut: Simplify upsdriver



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6087d3c09d95
branches:  trunk
changeset: 391328:6087d3c09d95
user:      gdt <gdt%pkgsrc.org@localhost>
date:      Sun Jan 08 01:32:54 2023 +0000

description:
sysutils/ups-nut: Simplify upsdriver

Drop option to specify driver and args manually.  upsdrvctl is now the
only approach.

(Raised to 3 usual suspects who have helped with nut, with 2
supporting the simplification.)

diffstat:

 sysutils/ups-nut/Makefile           |   4 ++--
 sysutils/ups-nut/files/upsdriver.sh |  36 ++++++++++--------------------------
 2 files changed, 12 insertions(+), 28 deletions(-)

diffs (69 lines):

diff -r 15c9ac8a7ee2 -r 6087d3c09d95 sysutils/ups-nut/Makefile
--- a/sysutils/ups-nut/Makefile Sun Jan 08 01:28:15 2023 +0000
+++ b/sysutils/ups-nut/Makefile Sun Jan 08 01:32:54 2023 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.69 2023/01/08 01:14:23 gdt Exp $
+# $NetBSD: Makefile,v 1.70 2023/01/08 01:32:54 gdt Exp $
 
-PKGREVISION= 4
+PKGREVISION= 5
 .include "Makefile.common"
 
 PKGNAME=               ups-${DISTNAME}
diff -r 15c9ac8a7ee2 -r 6087d3c09d95 sysutils/ups-nut/files/upsdriver.sh
--- a/sysutils/ups-nut/files/upsdriver.sh       Sun Jan 08 01:28:15 2023 +0000
+++ b/sysutils/ups-nut/files/upsdriver.sh       Sun Jan 08 01:32:54 2023 +0000
@@ -1,23 +1,15 @@
 #!@RCD_SCRIPTS_SHELL@
 #
-# $NetBSD: upsdriver.sh,v 1.11 2023/01/08 01:14:23 gdt Exp $
+# $NetBSD: upsdriver.sh,v 1.12 2023/01/08 01:32:55 gdt Exp $
 #
 # PROVIDE: upsdriver
 # REQUIRE: NETWORK syslogd mountcritremote
 # KEYWORD: shutdown
 #
-# The standard approach is to leave "upsdriver_type" unset, so that
-# upsdrvctl is used to start and stop the driver(s).  (Note that a
-# system might have more than one UPS, and upsdrvctl should support
-# this.)  See nutupsdrv(8), but upsdrvctl will invoke the driver
-# properly.
-#
-# An alternative is to set the driver type and flags.  This only works
-# for a single driver.  This approach is deprecated and may be removed.
-#
-# upsdriver=YES
-#      upsdriver_type="newapc"
-#      upsdriver_flags="-a smartups"
+# This script calls upsdrvctl to start and stop the driver(s).  (Note
+# that a system might have more than one UPS, and upsdrvctl should
+# support this.)  See nutupsdrv(8), but upsdrvctl will invoke the
+# driver properly.
 
 if [ -f /etc/rc.subr ]; then
        . /etc/rc.subr
@@ -30,19 +22,11 @@
        load_rc_config $name
 fi
 
-if [ "${upsdriver_type:-upsdrvctl}" = "upsdrvctl" ]; then
-       ctl_command="@PREFIX@/sbin/upsdrvctl"
-       required_files="@NUT_CONFDIR@/ups.conf"
-       start_cmd="${ctl_command} start"
-       stop_cmd="${ctl_command} stop"
-       # XXX implement status after upsdrvctl does
-else
-       command="@PREFIX@/libexec/nut/${upsdriver_type}"
-       # XXX Restructure upsname into variable, but really just
-       # delete this option.
-       #upsname=`echo $upsdriver_flags | sed -e 's/^-a //'
-       #pidfile="@NUT_STATEDIR@/${upsdriver_type}-${upsname}.pid"
-fi
+ctl_command="@PREFIX@/sbin/upsdrvctl"
+required_files="@NUT_CONFDIR@/ups.conf"
+start_cmd="${ctl_command} start"
+stop_cmd="${ctl_command} stop"
+# XXX implement status after upsdrvctl does
 
 if [ -f /etc/rc.subr ]; then
        run_rc_command "$1"



Home | Main Index | Thread Index | Old Index