Bug 233083 - sysutils/nut -- fix nut_upslog rc script parameter expansion default
Summary: sysutils/nut -- fix nut_upslog rc script parameter expansion default
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Cy Schubert
URL:
Keywords: easy, needs-qa
Depends on:
Blocks:
 
Reported: 2018-11-09 08:30 UTC by elij
Modified: 2018-11-09 13:49 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (cy)
koobs: merge-quarterly?


Attachments
sysutils-nut.diff (979 bytes, patch)
2018-11-09 08:44 UTC, elij
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description elij 2018-11-09 08:30:14 UTC
rc script for nut_upslog not using proper Parameter Expansion.

--- nut_upslog.old	2018-11-09 00:25:56.647672000 -0800
+++ nut_upslog	2018-11-09 00:26:18.729312000 -0800
@@ -31,6 +31,6 @@
 required_dirs="/var/db/nut"
 command="${nut_upslog_prefix}/bin/upslog"
 pidfile="/var/db/nut/upslog.pid"
-nut_upslog_flags=${nut_upslog_flags-"-s ${nut_upslog_ups} -l ${nut_upslog_logfile} -i ${nut_upslog_interval}"}
+nut_upslog_flags=${nut_upslog_flags:-"-s ${nut_upslog_ups} -l ${nut_upslog_logfile} -i ${nut_upslog_interval}"}
 
 run_rc_command "$1"
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2018-11-09 08:37:44 UTC
Thank you elij

Could you please provide the change/diff included in comment 0 as an attachment please
Comment 2 elij 2018-11-09 08:38:59 UTC
Sure. I found another similar missing colon in nut_upsmon rc script too.
I'll include them both.
Comment 3 elij 2018-11-09 08:44:29 UTC
Created attachment 199091 [details]
sysutils-nut.diff

added diff/patch file (p1 required to apply I guess?)
Comment 4 Mateusz Piotrowski freebsd_committer freebsd_triage 2018-11-09 12:29:40 UTC
While here, shouldn't we use "command_args" here instead of "${name}_flags"?
Comment 5 Cy Schubert freebsd_committer freebsd_triage 2018-11-09 13:36:10 UTC
(In reply to elij from comment #3)
The patch fails: a) wrong filename and b) it generally fails to apply.
Comment 6 commit-hook freebsd_committer freebsd_triage 2018-11-09 13:48:00 UTC
A commit references this bug:

Author: cy
Date: Fri Nov  9 13:47:52 UTC 2018
New revision: 484513
URL: https://svnweb.freebsd.org/changeset/ports/484513

Log:
  Fix incorrect script default parameter expansion.

  PR:		233083

Changes:
  head/sysutils/nut/Makefile
  head/sysutils/nut/files/nut_upslog.in
  head/sysutils/nut/files/nut_upsmon.in