pkgsrc-Changes archive

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

CVS commit: [pkgsrc-2022Q3] pkgsrc/sysutils/ups-nut



Module Name:    pkgsrc
Committed By:   gdt
Date:           Sat Jan  7 16:09:38 UTC 2023

Modified Files:
        pkgsrc/sysutils/ups-nut [pkgsrc-2022Q3]: Makefile
        pkgsrc/sysutils/ups-nut/files [pkgsrc-2022Q3]: ups.sh upsd.sh
            upsdriver.sh upslog.sh upsmon.sh

Log Message:
Revert commit on wrong branch


To generate a diff of this commit:
cvs rdiff -u -r1.67.2.1 -r1.67.2.2 pkgsrc/sysutils/ups-nut/Makefile
cvs rdiff -u -r1.10.158.1 -r1.10.158.2 pkgsrc/sysutils/ups-nut/files/ups.sh
cvs rdiff -u -r1.7.134.1 -r1.7.134.2 pkgsrc/sysutils/ups-nut/files/upsd.sh \
    pkgsrc/sysutils/ups-nut/files/upsmon.sh
cvs rdiff -u -r1.9.34.1 -r1.9.34.2 pkgsrc/sysutils/ups-nut/files/upsdriver.sh
cvs rdiff -u -r1.6.154.1 -r1.6.154.2 pkgsrc/sysutils/ups-nut/files/upslog.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.67.2.1 pkgsrc/sysutils/ups-nut/Makefile:1.67.2.2
--- pkgsrc/sysutils/ups-nut/Makefile:1.67.2.1   Sat Jan  7 16:07:58 2023
+++ pkgsrc/sysutils/ups-nut/Makefile    Sat Jan  7 16:09:38 2023
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.67.2.1 2023/01/07 16:07:58 gdt Exp $
+# $NetBSD: Makefile,v 1.67.2.2 2023/01/07 16:09:38 gdt Exp $
 
-PKGREVISION= 3
+PKGREVISION= 2
 .include "Makefile.common"
 
 PKGNAME=               ups-${DISTNAME}

Index: pkgsrc/sysutils/ups-nut/files/ups.sh
diff -u pkgsrc/sysutils/ups-nut/files/ups.sh:1.10.158.1 pkgsrc/sysutils/ups-nut/files/ups.sh:1.10.158.2
--- pkgsrc/sysutils/ups-nut/files/ups.sh:1.10.158.1     Sat Jan  7 16:07:59 2023
+++ pkgsrc/sysutils/ups-nut/files/ups.sh        Sat Jan  7 16:09:38 2023
@@ -1,14 +1,11 @@
 #!@RCD_SCRIPTS_SHELL@
 #
-# $NetBSD: ups.sh,v 1.10.158.1 2023/01/07 16:07:59 gdt Exp $
+# $NetBSD: ups.sh,v 1.10.158.2 2023/01/07 16:09:38 gdt Exp $
 #
 # KEYWORD: nostart
 
-# NB: This file is not intended to be run automaticlally at boot.  It
-# is a convenience script for humans to start or stop all 4 nut-ups
-# daemons as a group.
-
-if [ -f /etc/rc.subr ]; then
+if [ -f /etc/rc.subr ]
+then
        . /etc/rc.subr
 fi
 
@@ -18,6 +15,9 @@ rcd_dir=`@DIRNAME@ $0`
 #
 forward_commands()
 {
+       # Backward compat with NetBSD <1.6:
+       [ -z "$rc_arg" ] && rc_arg=$_arg
+
        for file in $COMMAND_LIST; do
                $rcd_dir/$file $rc_arg
        done
@@ -25,6 +25,9 @@ forward_commands()
 
 reverse_commands()
 {
+       # Backward compat with NetBSD <1.6:
+       [ -z "$rc_arg" ] && rc_arg=$_arg
+
        REVCOMMAND_LIST=
        for file in $COMMAND_LIST; do
                REVCOMMAND_LIST="$file $REVCOMMAND_LIST"
@@ -42,10 +45,11 @@ stop_cmd="reverse_commands"
 status_cmd="forward_commands"
 extra_commands="status"
 
-if [ -f /etc/rc.subr ]; then
+if [ -f /etc/rc.subr ]
+then
         run_rc_command "$1"
 else
         @ECHO@ -n " ${name}"
-       rc_arg="$1"
+       _arg="$1"
        ${start_cmd}
 fi

Index: pkgsrc/sysutils/ups-nut/files/upsd.sh
diff -u pkgsrc/sysutils/ups-nut/files/upsd.sh:1.7.134.1 pkgsrc/sysutils/ups-nut/files/upsd.sh:1.7.134.2
--- pkgsrc/sysutils/ups-nut/files/upsd.sh:1.7.134.1     Sat Jan  7 16:07:59 2023
+++ pkgsrc/sysutils/ups-nut/files/upsd.sh       Sat Jan  7 16:09:38 2023
@@ -1,13 +1,14 @@
 #!@RCD_SCRIPTS_SHELL@
 #
-# $NetBSD: upsd.sh,v 1.7.134.1 2023/01/07 16:07:59 gdt Exp $
+# $NetBSD: upsd.sh,v 1.7.134.2 2023/01/07 16:09:38 gdt Exp $
 #
 # PROVIDE: upsd
 # REQUIRE: upsdriver
 # BEFORE: upsmon
 # KEYWORD: shutdown
 
-if [ -f /etc/rc.subr ]; then
+if [ -f /etc/rc.subr ]
+then
        . /etc/rc.subr
 fi
 
@@ -17,7 +18,8 @@ command="@PREFIX@/sbin/${name}"
 required_files="@NUT_CONFDIR@/${name}.conf"
 pidfile="@NUT_STATEDIR@/${name}.pid"
 
-if [ -f /etc/rc.subr ]; then
+if [ -f /etc/rc.subr ]
+then
        load_rc_config $name
        run_rc_command "$1"
 else
Index: pkgsrc/sysutils/ups-nut/files/upsmon.sh
diff -u pkgsrc/sysutils/ups-nut/files/upsmon.sh:1.7.134.1 pkgsrc/sysutils/ups-nut/files/upsmon.sh:1.7.134.2
--- pkgsrc/sysutils/ups-nut/files/upsmon.sh:1.7.134.1   Sat Jan  7 16:07:59 2023
+++ pkgsrc/sysutils/ups-nut/files/upsmon.sh     Sat Jan  7 16:09:38 2023
@@ -1,12 +1,12 @@
 #!@RCD_SCRIPTS_SHELL@
 #
-# $NetBSD: upsmon.sh,v 1.7.134.1 2023/01/07 16:07:59 gdt Exp $
+# $NetBSD: upsmon.sh,v 1.7.134.2 2023/01/07 16:09:38 gdt Exp $
 #
 # PROVIDE: upsmon
-# BEFORE: SERVERS
 # KEYWORD: shutdown
 
-if [ -f /etc/rc.subr ]; then
+if [ -f /etc/rc.subr ]
+then
        . /etc/rc.subr
 fi
 
@@ -16,7 +16,8 @@ command="@PREFIX@/sbin/${name}"
 pidfile="@NUT_STATEDIR@/${name}.pid"
 required_files="@NUT_CONFDIR@/${name}.conf"
 
-if [ -f /etc/rc.subr ]; then
+if [ -f /etc/rc.subr ]
+then
        load_rc_config $name
        run_rc_command "$1"
 else

Index: pkgsrc/sysutils/ups-nut/files/upsdriver.sh
diff -u pkgsrc/sysutils/ups-nut/files/upsdriver.sh:1.9.34.1 pkgsrc/sysutils/ups-nut/files/upsdriver.sh:1.9.34.2
--- pkgsrc/sysutils/ups-nut/files/upsdriver.sh:1.9.34.1 Sat Jan  7 16:07:59 2023
+++ pkgsrc/sysutils/ups-nut/files/upsdriver.sh  Sat Jan  7 16:09:38 2023
@@ -1,53 +1,56 @@
 #!@RCD_SCRIPTS_SHELL@
 #
-# $NetBSD: upsdriver.sh,v 1.9.34.1 2023/01/07 16:07:59 gdt Exp $
+# $NetBSD: upsdriver.sh,v 1.9.34.2 2023/01/07 16:09:38 gdt Exp $
 #
 # PROVIDE: upsdriver
 # REQUIRE: NETWORK syslogd mountcritremote
 #
-# 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.
+# You will need to set some variables in /etc/rc.conf to start the UPS
+# driver(s) properly, e.g.
 #
 # upsdriver=YES
 #      upsdriver_type="newapc"
 #      upsdriver_flags="-a smartups"
+#
+# If "upsdriver_type" is unset, then use "upsdrvctl" to control the UPS
+# drivers.  Please refer to nutupsdrv(8) for more information about the
+# arguments to pass to the UPS drivers.
 
-if [ -f /etc/rc.subr ]; then
+if [ -f /etc/rc.subr ]
+then
        . /etc/rc.subr
 fi
 
 name="upsdriver"
 rcvar=$name
 
-if [ -f /etc/rc.subr ]; then
+if [ -f /etc/rc.subr ]
+then
        load_rc_config $name
 fi
 
-if [ "${upsdriver_type:-upsdrvctl}" = "upsdrvctl" ]; then
+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"
+       #
+       # XXX - We need a way to easily determine the pidfile, which is of
+       # XXX - the form @NUT_STATEDIR@/${updriver_type}-${tty}.pid
+       #
+       #pidfile="@NUT_STATEDIR@/${upsdriver_type}-${tty}.pid"
 fi
 
-if [ -f /etc/rc.subr ]; then
+if [ -f /etc/rc.subr ]
+then
        run_rc_command "$1"
 else
        @ECHO@ -n " ${name}"
-       if [ -n "${start_cmd}" ]; then
+       if [ -n "${start_cmd}" ]
+       then
                ${start_cmd}
        else
                ${command} ${upsdriver_flags} ${command_args}

Index: pkgsrc/sysutils/ups-nut/files/upslog.sh
diff -u pkgsrc/sysutils/ups-nut/files/upslog.sh:1.6.154.1 pkgsrc/sysutils/ups-nut/files/upslog.sh:1.6.154.2
--- pkgsrc/sysutils/ups-nut/files/upslog.sh:1.6.154.1   Sat Jan  7 16:07:59 2023
+++ pkgsrc/sysutils/ups-nut/files/upslog.sh     Sat Jan  7 16:09:38 2023
@@ -1,10 +1,9 @@
 #!@RCD_SCRIPTS_SHELL@
 #
-# $NetBSD: upslog.sh,v 1.6.154.1 2023/01/07 16:07:59 gdt Exp $
+# $NetBSD: upslog.sh,v 1.6.154.2 2023/01/07 16:09:38 gdt Exp $
 #
 # PROVIDE: upslog
-# REQUIRE: upsd DAEMON
-# BEFORE: LOGIN
+# REQUIRE: upsd
 #
 # You will need to set some variables in /etc/rc.conf to start upslog
 # properly, e.g.
@@ -15,7 +14,8 @@
 # Please refer to upslog(8) for more information about the arguments to pass
 # to upslog.
 
-if [ -f /etc/rc.subr ]; then
+if [ -f /etc/rc.subr ]
+then
        . /etc/rc.subr
 fi
 
@@ -24,7 +24,8 @@ rcvar="${name}"
 command="@PREFIX@/bin/${name}"
 pidfile="@NUT_STATEDIR@/${name}.pid"
 
-if [ -f /etc/rc.subr ]; then
+if [ -f /etc/rc.subr ]
+then
        load_rc_config $name
        run_rc_command "$1"
 else



Home | Main Index | Thread Index | Old Index