pkgsrc-Changes archive

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

CVS commit: pkgsrc/sysutils/ups-nut



Module Name:    pkgsrc
Committed By:   gdt
Date:           Sun Jan  8 01:32:55 UTC 2023

Modified Files:
        pkgsrc/sysutils/ups-nut: Makefile
        pkgsrc/sysutils/ups-nut/files: upsdriver.sh

Log Message:
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.)


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 pkgsrc/sysutils/ups-nut/Makefile
cvs rdiff -u -r1.11 -r1.12 pkgsrc/sysutils/ups-nut/files/upsdriver.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/sysutils/ups-nut/Makefile
diff -u pkgsrc/sysutils/ups-nut/Makefile:1.69 pkgsrc/sysutils/ups-nut/Makefile:1.70
--- pkgsrc/sysutils/ups-nut/Makefile:1.69       Sun Jan  8 01:14:23 2023
+++ pkgsrc/sysutils/ups-nut/Makefile    Sun Jan  8 01:32:54 2023
@@ -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}

Index: pkgsrc/sysutils/ups-nut/files/upsdriver.sh
diff -u pkgsrc/sysutils/ups-nut/files/upsdriver.sh:1.11 pkgsrc/sysutils/ups-nut/files/upsdriver.sh:1.12
--- pkgsrc/sysutils/ups-nut/files/upsdriver.sh:1.11     Sun Jan  8 01:14:23 2023
+++ pkgsrc/sysutils/ups-nut/files/upsdriver.sh  Sun Jan  8 01:32:55 2023
@@ -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 @@ if [ -f /etc/rc.subr ]; then
        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