Revert commit on wrong branchdiff -r1.67.2.1 -r1.67.2.2 pkgsrc/sysutils/ups-nut/Makefile
(gdt)
@@ -1,16 +1,16 @@ | @@ -1,16 +1,16 @@ | |||
1 | # $NetBSD: Makefile,v 1.67.2.1 2023/01/07 16:07:58 gdt Exp $ | 1 | # $NetBSD: Makefile,v 1.67.2.2 2023/01/07 16:09:38 gdt Exp $ | |
2 | 2 | |||
3 | PKGREVISION= 3 | 3 | PKGREVISION= 2 | |
4 | .include "Makefile.common" | 4 | .include "Makefile.common" | |
5 | 5 | |||
6 | PKGNAME= ups-${DISTNAME} | 6 | PKGNAME= ups-${DISTNAME} | |
7 | COMMENT= Network UPS Tools | 7 | COMMENT= Network UPS Tools | |
8 | 8 | |||
9 | SUBST_CLASSES+= man-so | 9 | SUBST_CLASSES+= man-so | |
10 | SUBST_MESSAGE.man-so= Fixing manpage .so references. | 10 | SUBST_MESSAGE.man-so= Fixing manpage .so references. | |
11 | SUBST_STAGE.man-so= pre-build | 11 | SUBST_STAGE.man-so= pre-build | |
12 | SUBST_FILES.man-so= docs/man/*.[0-9] | 12 | SUBST_FILES.man-so= docs/man/*.[0-9] | |
13 | SUBST_SED.man-so= -e 's,^\.so \([^/]*\)\.\([0-9]\)$$,.so man\2/\1.\2,' | 13 | SUBST_SED.man-so= -e 's,^\.so \([^/]*\)\.\([0-9]\)$$,.so man\2/\1.\2,' | |
14 | SUBST_NOOP_OK.man-so= yes | 14 | SUBST_NOOP_OK.man-so= yes | |
15 | 15 | |||
16 | # Don't regenerate any files in tools/. | 16 | # Don't regenerate any files in tools/. |
@@ -1,51 +1,55 @@ | @@ -1,51 +1,55 @@ | |||
1 | #!@RCD_SCRIPTS_SHELL@ | 1 | #!@RCD_SCRIPTS_SHELL@ | |
2 | # | 2 | # | |
3 | # $NetBSD: ups.sh,v 1.10.158.1 2023/01/07 16:07:59 gdt Exp $ | 3 | # $NetBSD: ups.sh,v 1.10.158.2 2023/01/07 16:09:38 gdt Exp $ | |
4 | # | 4 | # | |
5 | # KEYWORD: nostart | 5 | # KEYWORD: nostart | |
6 | 6 | |||
7 | # NB: This file is not intended to be run automaticlally at boot. It | 7 | if [ -f /etc/rc.subr ] | |
8 | # is a convenience script for humans to start or stop all 4 nut-ups | 8 | then | |
9 | # daemons as a group. | |||
10 | ||||
11 | if [ -f /etc/rc.subr ]; then | |||
12 | . /etc/rc.subr | 9 | . /etc/rc.subr | |
13 | fi | 10 | fi | |
14 | 11 | |||
15 | rcd_dir=`@DIRNAME@ $0` | 12 | rcd_dir=`@DIRNAME@ $0` | |
16 | 13 | |||
17 | # NOTE: run_rc_command sets $rc_arg | 14 | # NOTE: run_rc_command sets $rc_arg | |
18 | # | 15 | # | |
19 | forward_commands() | 16 | forward_commands() | |
20 | { | 17 | { | |
18 | # Backward compat with NetBSD <1.6: | |||
19 | [ -z "$rc_arg" ] && rc_arg=$_arg | |||
20 | ||||
21 | for file in $COMMAND_LIST; do | 21 | for file in $COMMAND_LIST; do | |
22 | $rcd_dir/$file $rc_arg | 22 | $rcd_dir/$file $rc_arg | |
23 | done | 23 | done | |
24 | } | 24 | } | |
25 | 25 | |||
26 | reverse_commands() | 26 | reverse_commands() | |
27 | { | 27 | { | |
28 | # Backward compat with NetBSD <1.6: | |||
29 | [ -z "$rc_arg" ] && rc_arg=$_arg | |||
30 | ||||
28 | REVCOMMAND_LIST= | 31 | REVCOMMAND_LIST= | |
29 | for file in $COMMAND_LIST; do | 32 | for file in $COMMAND_LIST; do | |
30 | REVCOMMAND_LIST="$file $REVCOMMAND_LIST" | 33 | REVCOMMAND_LIST="$file $REVCOMMAND_LIST" | |
31 | done | 34 | done | |
32 | for file in $REVCOMMAND_LIST; do | 35 | for file in $REVCOMMAND_LIST; do | |
33 | $rcd_dir/$file $rc_arg | 36 | $rcd_dir/$file $rc_arg | |
34 | done | 37 | done | |
35 | } | 38 | } | |
36 | 39 | |||
37 | COMMAND_LIST="upsdriver upsd upsmon upslog" | 40 | COMMAND_LIST="upsdriver upsd upsmon upslog" | |
38 | 41 | |||
39 | name="ups" | 42 | name="ups" | |
40 | start_cmd="forward_commands" | 43 | start_cmd="forward_commands" | |
41 | stop_cmd="reverse_commands" | 44 | stop_cmd="reverse_commands" | |
42 | status_cmd="forward_commands" | 45 | status_cmd="forward_commands" | |
43 | extra_commands="status" | 46 | extra_commands="status" | |
44 | 47 | |||
45 | if [ -f /etc/rc.subr ]; then | 48 | if [ -f /etc/rc.subr ] | |
49 | then | |||
46 | run_rc_command "$1" | 50 | run_rc_command "$1" | |
47 | else | 51 | else | |
48 | @ECHO@ -n " ${name}" | 52 | @ECHO@ -n " ${name}" | |
49 | rc_arg="$1" | 53 | _arg="$1" | |
50 | ${start_cmd} | 54 | ${start_cmd} | |
51 | fi | 55 | fi |
@@ -1,26 +1,28 @@ | @@ -1,26 +1,28 @@ | |||
1 | #!@RCD_SCRIPTS_SHELL@ | 1 | #!@RCD_SCRIPTS_SHELL@ | |
2 | # | 2 | # | |
3 | # $NetBSD: upsd.sh,v 1.7.134.1 2023/01/07 16:07:59 gdt Exp $ | 3 | # $NetBSD: upsd.sh,v 1.7.134.2 2023/01/07 16:09:38 gdt Exp $ | |
4 | # | 4 | # | |
5 | # PROVIDE: upsd | 5 | # PROVIDE: upsd | |
6 | # REQUIRE: upsdriver | 6 | # REQUIRE: upsdriver | |
7 | # BEFORE: upsmon | 7 | # BEFORE: upsmon | |
8 | # KEYWORD: shutdown | 8 | # KEYWORD: shutdown | |
9 | 9 | |||
10 | if [ -f /etc/rc.subr ]; then | 10 | if [ -f /etc/rc.subr ] | |
11 | then | |||
11 | . /etc/rc.subr | 12 | . /etc/rc.subr | |
12 | fi | 13 | fi | |
13 | 14 | |||
14 | name="upsd" | 15 | name="upsd" | |
15 | rcvar=$name | 16 | rcvar=$name | |
16 | command="@PREFIX@/sbin/${name}" | 17 | command="@PREFIX@/sbin/${name}" | |
17 | required_files="@NUT_CONFDIR@/${name}.conf" | 18 | required_files="@NUT_CONFDIR@/${name}.conf" | |
18 | pidfile="@NUT_STATEDIR@/${name}.pid" | 19 | pidfile="@NUT_STATEDIR@/${name}.pid" | |
19 | 20 | |||
20 | if [ -f /etc/rc.subr ]; then | 21 | if [ -f /etc/rc.subr ] | |
22 | then | |||
21 | load_rc_config $name | 23 | load_rc_config $name | |
22 | run_rc_command "$1" | 24 | run_rc_command "$1" | |
23 | else | 25 | else | |
24 | @ECHO@ -n " ${name}" | 26 | @ECHO@ -n " ${name}" | |
25 | ${command} ${upsd_flags} ${command_args} | 27 | ${command} ${upsd_flags} ${command_args} | |
26 | fi | 28 | fi |
@@ -1,25 +1,26 @@ | @@ -1,25 +1,26 @@ | |||
1 | #!@RCD_SCRIPTS_SHELL@ | 1 | #!@RCD_SCRIPTS_SHELL@ | |
2 | # | 2 | # | |
3 | # $NetBSD: upsmon.sh,v 1.7.134.1 2023/01/07 16:07:59 gdt Exp $ | 3 | # $NetBSD: upsmon.sh,v 1.7.134.2 2023/01/07 16:09:38 gdt Exp $ | |
4 | # | 4 | # | |
5 | # PROVIDE: upsmon | 5 | # PROVIDE: upsmon | |
6 | # BEFORE: SERVERS | |||
7 | # KEYWORD: shutdown | 6 | # KEYWORD: shutdown | |
8 | 7 | |||
9 | if [ -f /etc/rc.subr ]; then | 8 | if [ -f /etc/rc.subr ] | |
9 | then | |||
10 | . /etc/rc.subr | 10 | . /etc/rc.subr | |
11 | fi | 11 | fi | |
12 | 12 | |||
13 | name="upsmon" | 13 | name="upsmon" | |
14 | rcvar="${name}" | 14 | rcvar="${name}" | |
15 | command="@PREFIX@/sbin/${name}" | 15 | command="@PREFIX@/sbin/${name}" | |
16 | pidfile="@NUT_STATEDIR@/${name}.pid" | 16 | pidfile="@NUT_STATEDIR@/${name}.pid" | |
17 | required_files="@NUT_CONFDIR@/${name}.conf" | 17 | required_files="@NUT_CONFDIR@/${name}.conf" | |
18 | 18 | |||
19 | if [ -f /etc/rc.subr ]; then | 19 | if [ -f /etc/rc.subr ] | |
20 | then | |||
20 | load_rc_config $name | 21 | load_rc_config $name | |
21 | run_rc_command "$1" | 22 | run_rc_command "$1" | |
22 | else | 23 | else | |
23 | @ECHO@ -n " ${name}" | 24 | @ECHO@ -n " ${name}" | |
24 | ${command} ${upsmon_flags} ${command_args} | 25 | ${command} ${upsmon_flags} ${command_args} | |
25 | fi | 26 | fi |
@@ -1,55 +1,58 @@ | @@ -1,55 +1,58 @@ | |||
1 | #!@RCD_SCRIPTS_SHELL@ | 1 | #!@RCD_SCRIPTS_SHELL@ | |
2 | # | 2 | # | |
3 | # $NetBSD: upsdriver.sh,v 1.9.34.1 2023/01/07 16:07:59 gdt Exp $ | 3 | # $NetBSD: upsdriver.sh,v 1.9.34.2 2023/01/07 16:09:38 gdt Exp $ | |
4 | # | 4 | # | |
5 | # PROVIDE: upsdriver | 5 | # PROVIDE: upsdriver | |
6 | # REQUIRE: NETWORK syslogd mountcritremote | 6 | # REQUIRE: NETWORK syslogd mountcritremote | |
7 | # | 7 | # | |
8 | # The standard approach is to leave "upsdriver_type" unset, so that | 8 | # You will need to set some variables in /etc/rc.conf to start the UPS | |
9 | # upsdrvctl is used to start and stop the driver(s). (Note that a | 9 | # driver(s) properly, e.g. | |
10 | # system might have more than one UPS, and upsdrvctl should support | |||
11 | # this.) See nutupsdrv(8), but upsdrvctl will invoke the driver | |||
12 | # properly. | |||
13 | # | |||
14 | # An alternative is to set the driver type and flags. This only works | |||
15 | # for a single driver. This approach is deprecated and may be removed. | |||
16 | # | 10 | # | |
17 | # upsdriver=YES | 11 | # upsdriver=YES | |
18 | # upsdriver_type="newapc" | 12 | # upsdriver_type="newapc" | |
19 | # upsdriver_flags="-a smartups" | 13 | # upsdriver_flags="-a smartups" | |
14 | # | |||
15 | # If "upsdriver_type" is unset, then use "upsdrvctl" to control the UPS | |||
16 | # drivers. Please refer to nutupsdrv(8) for more information about the | |||
17 | # arguments to pass to the UPS drivers. | |||
20 | 18 | |||
21 | if [ -f /etc/rc.subr ]; then | 19 | if [ -f /etc/rc.subr ] | |
20 | then | |||
22 | . /etc/rc.subr | 21 | . /etc/rc.subr | |
23 | fi | 22 | fi | |
24 | 23 | |||
25 | name="upsdriver" | 24 | name="upsdriver" | |
26 | rcvar=$name | 25 | rcvar=$name | |
27 | 26 | |||
28 | if [ -f /etc/rc.subr ]; then | 27 | if [ -f /etc/rc.subr ] | |
28 | then | |||
29 | load_rc_config $name | 29 | load_rc_config $name | |
30 | fi | 30 | fi | |
31 | 31 | |||
32 | if [ "${upsdriver_type:-upsdrvctl}" = "upsdrvctl" ]; then | 32 | if [ "${upsdriver_type:-upsdrvctl}" = "upsdrvctl" ] | |
33 | then | |||
33 | ctl_command="@PREFIX@/sbin/upsdrvctl" | 34 | ctl_command="@PREFIX@/sbin/upsdrvctl" | |
34 | required_files="@NUT_CONFDIR@/ups.conf" | 35 | required_files="@NUT_CONFDIR@/ups.conf" | |
35 | start_cmd="${ctl_command} start" | 36 | start_cmd="${ctl_command} start" | |
36 | stop_cmd="${ctl_command} stop" | 37 | stop_cmd="${ctl_command} stop" | |
37 | # XXX implement status after upsdrvctl does | |||
38 | else | 38 | else | |
39 | command="@PREFIX@/libexec/nut/${upsdriver_type}" | 39 | command="@PREFIX@/libexec/nut/${upsdriver_type}" | |
40 | # XXX Restructure upsname into variable, but really just | 40 | # | |
41 | # delete this option. | 41 | # XXX - We need a way to easily determine the pidfile, which is of | |
42 | #upsname=`echo $upsdriver_flags | sed -e 's/^-a //' | 42 | # XXX - the form @NUT_STATEDIR@/${updriver_type}-${tty}.pid | |
43 | #pidfile="@NUT_STATEDIR@/${upsdriver_type}-${upsname}.pid" | 43 | # | |
44 | #pidfile="@NUT_STATEDIR@/${upsdriver_type}-${tty}.pid" | |||
44 | fi | 45 | fi | |
45 | 46 | |||
46 | if [ -f /etc/rc.subr ]; then | 47 | if [ -f /etc/rc.subr ] | |
48 | then | |||
47 | run_rc_command "$1" | 49 | run_rc_command "$1" | |
48 | else | 50 | else | |
49 | @ECHO@ -n " ${name}" | 51 | @ECHO@ -n " ${name}" | |
50 | if [ -n "${start_cmd}" ]; then | 52 | if [ -n "${start_cmd}" ] | |
53 | then | |||
51 | ${start_cmd} | 54 | ${start_cmd} | |
52 | else | 55 | else | |
53 | ${command} ${upsdriver_flags} ${command_args} | 56 | ${command} ${upsdriver_flags} ${command_args} | |
54 | fi | 57 | fi | |
55 | fi | 58 | fi |
@@ -1,33 +1,34 @@ | @@ -1,33 +1,34 @@ | |||
1 | #!@RCD_SCRIPTS_SHELL@ | 1 | #!@RCD_SCRIPTS_SHELL@ | |
2 | # | 2 | # | |
3 | # $NetBSD: upslog.sh,v 1.6.154.1 2023/01/07 16:07:59 gdt Exp $ | 3 | # $NetBSD: upslog.sh,v 1.6.154.2 2023/01/07 16:09:38 gdt Exp $ | |
4 | # | 4 | # | |
5 | # PROVIDE: upslog | 5 | # PROVIDE: upslog | |
6 | # REQUIRE: upsd DAEMON | 6 | # REQUIRE: upsd | |
7 | # BEFORE: LOGIN | |||
8 | # | 7 | # | |
9 | # You will need to set some variables in /etc/rc.conf to start upslog | 8 | # You will need to set some variables in /etc/rc.conf to start upslog | |
10 | # properly, e.g. | 9 | # properly, e.g. | |
11 | # | 10 | # | |
12 | # upslog=YES | 11 | # upslog=YES | |
13 | # upslog_flags="smartups@localhost /var/log/ups 60" | 12 | # upslog_flags="smartups@localhost /var/log/ups 60" | |
14 | # | 13 | # | |
15 | # Please refer to upslog(8) for more information about the arguments to pass | 14 | # Please refer to upslog(8) for more information about the arguments to pass | |
16 | # to upslog. | 15 | # to upslog. | |
17 | 16 | |||
18 | if [ -f /etc/rc.subr ]; then | 17 | if [ -f /etc/rc.subr ] | |
18 | then | |||
19 | . /etc/rc.subr | 19 | . /etc/rc.subr | |
20 | fi | 20 | fi | |
21 | 21 | |||
22 | name="upslog" | 22 | name="upslog" | |
23 | rcvar="${name}" | 23 | rcvar="${name}" | |
24 | command="@PREFIX@/bin/${name}" | 24 | command="@PREFIX@/bin/${name}" | |
25 | pidfile="@NUT_STATEDIR@/${name}.pid" | 25 | pidfile="@NUT_STATEDIR@/${name}.pid" | |
26 | 26 | |||
27 | if [ -f /etc/rc.subr ]; then | 27 | if [ -f /etc/rc.subr ] | |
28 | then | |||
28 | load_rc_config $name | 29 | load_rc_config $name | |
29 | run_rc_command "$1" | 30 | run_rc_command "$1" | |
30 | else | 31 | else | |
31 | @ECHO@ -n " ${name}" | 32 | @ECHO@ -n " ${name}" | |
32 | ${command} ${upslog_flags} ${command_args} | 33 | ${command} ${upslog_flags} ${command_args} | |
33 | fi | 34 | fi |