<pre style='margin:0'>
Perry E. Metzger (pmetzger) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/67689d9749bc58f05ac26dd27628e32af4f33fcb">https://github.com/macports/macports-ports/commit/67689d9749bc58f05ac26dd27628e32af4f33fcb</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 67689d9749b apcupsd: add delay/retry start to handle ethernet connections
</span>67689d9749b is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 67689d9749bc58f05ac26dd27628e32af4f33fcb
</span>Author: Stephen Reay <stephen@koalephant.com>
AuthorDate: Mon Aug 14 14:50:14 2023 +0700
<span style='display:block; white-space:pre;color:#404040;'> apcupsd: add delay/retry start to handle ethernet connections
</span>---
sysutils/apcupsd/Portfile | 7 +++++--
sysutils/apcupsd/files/apcupsd-plist.diff | 11 -----------
sysutils/apcupsd/files/apcupsd-start.in.diff | 22 ++++++++++++++++++++++
.../files/org.apcupsd.apcupsd.plist.in.diff | 18 ++++++++++++++++++
4 files changed, 45 insertions(+), 13 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/sysutils/apcupsd/Portfile b/sysutils/apcupsd/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 9811e4cc6e0..5e159d832ab 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/sysutils/apcupsd/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/sysutils/apcupsd/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4,7 +4,7 @@ PortSystem 1.0
</span>
name apcupsd
version 3.14.14
<span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 2
</span> categories sysutils
license GPL-2
maintainers {@stephenreay koalephant.com:stephen} openmaintainer
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -26,7 +26,8 @@ configure.args --prefix=${prefix} \
</span>
patchfiles apcagent-makefile.diff \
darwin-makefile.diff \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- apcupsd-plist.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ org.apcupsd.apcupsd.plist.in.diff \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ apcupsd-start.in.diff
</span>
startupitem.autostart yes
startupitem.install yes
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -43,6 +44,8 @@ post-activate {
</span> if {![file exists ${prefix}/etc/apcupsd/apcupsd.conf]} {
file copy ${prefix}/etc/apcupsd/apcupsd.conf.sample ${prefix}/etc/apcupsd/apcupsd.conf
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Start the Agent so the LoginItem is added
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ system "open ${applications_dir}/apcagent.app"
</span> }
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/sysutils/apcupsd/files/apcupsd-plist.diff b/sysutils/apcupsd/files/apcupsd-plist.diff
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 127c28146bb..00000000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/sysutils/apcupsd/files/apcupsd-plist.diff
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,11 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- platforms/darwin/org.apcupsd.apcupsd.plist.in.orig 2023-07-02 17:40:35
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ platforms/darwin/org.apcupsd.apcupsd.plist.in 2023-07-02 17:40:39
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -13,7 +13,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- <key>ProgramArguments</key>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- <array>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- <string>/bin/sh</string>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- <string>-f/etc/apcupsd/apcupsd.conf</string>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ <string>-f@sysconfdir@/apcupsd.conf</string>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- <string>-b</string>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- </array>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- <key>KeepAlive</key>
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/sysutils/apcupsd/files/apcupsd-start.in.diff b/sysutils/apcupsd/files/apcupsd-start.in.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..b423887c7a8
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/sysutils/apcupsd/files/apcupsd-start.in.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,22 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- platforms/darwin/apcupsd-start.in.orig 2023-08-14 14:54:34
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ platforms/darwin/apcupsd-start.in 2023-08-14 16:30:32
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -3,4 +3,18 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rm -f /etc/apcupsd/powerfail
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rm -f /etc/nologin
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-@sbindir@/apcupsd $@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++log_dated() {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ printf -- '%s %s\n' "$(date +'%Y-%m-%d %H:%M:%S %z')" "$@" >&2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++i=1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++log_dated 'Attempting to connect to UPS'
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++while ! @sbindir@/apcupsd "$@"; do
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if [ "$i" -eq 30 ]; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ log_dated "Cannot connect after ${i} attempts, giving up"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ exit 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ log_dated "Cannot connect to UPS (attempt ${i}), retrying in 1 second"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ sleep 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ i=$((i + 1))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++done
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/sysutils/apcupsd/files/org.apcupsd.apcupsd.plist.in.diff b/sysutils/apcupsd/files/org.apcupsd.apcupsd.plist.in.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..3c7f31b979f
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/sysutils/apcupsd/files/org.apcupsd.apcupsd.plist.in.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,18 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- platforms/darwin/org.apcupsd.apcupsd.plist.in.orig 2022-05-09 11:44:10
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ platforms/darwin/org.apcupsd.apcupsd.plist.in 2023-08-14 15:51:50
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -8,12 +8,13 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <string>root</string>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <key>GroupName</key>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <string>wheel</string>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ <key>StandardErrorPath</key>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ <string>/var/log/apcupsd.events</string>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <key>Program</key>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <string>@sbindir@/apcupsd-start</string>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <key>ProgramArguments</key>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <array>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- <string>/bin/sh</string>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- <string>-f/etc/apcupsd/apcupsd.conf</string>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ <string>-f@sysconfdir@/apcupsd.conf</string>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <string>-b</string>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ </array>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <key>KeepAlive</key>
</span></pre><pre style='margin:0'>
</pre>