Bug 248632 - x11/mons: libshlist doesn't work with BSD sed
Summary: x11/mons: libshlist doesn't work with BSD sed
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords: needs-patch, needs-qa
Depends on:
Blocks:
 
Reported: 2020-08-12 18:06 UTC by Conrad Meyer
Modified: 2021-01-20 02:34 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Conrad Meyer freebsd_committer freebsd_triage 2020-08-12 18:06:29 UTC
mons installs a helper library called libshlist.  Its list_insert operation does not work with BSD sed 'i'.

$ echo 1 2 3 | sed '1ifoobar'    # BSD sed
sed: 1: "1ifoobar": command i expects \ followed by text

$ echo 1 2 3 | gsed '1ifoobar'   # GNU sed
foobar
1 2 3

$ echo 1 2 3 | sed '1i\
foobar '                         # BSD sed again
foobar 1 2 3

Aliasing sed to gsed on FreeBSD (and adding a port dependency on gsed) fixes it; currently I've hacked in a:

sed() {
  gsed "$@"
}

definition to my copy of mons so that it works.

(This manifests as "mons" producing the sed error message above ("command i expects \ followed by text"), and then printing Monitors: 0 and some gibberish.)
Comment 1 Robert James Hernandez 2020-08-15 01:20:45 UTC
Im seeing this as well, Ill work on getting an update to the port to fix this since I still very much enjoy using this tool.

For others reference there is an open issue on github as well: https://github.com/Ventto/mons/issues/30
Comment 2 Conrad Meyer freebsd_committer freebsd_triage 2020-08-15 01:30:35 UTC
Awesome, thanks Robert.
Comment 3 Robert James Hernandez 2020-08-21 03:21:46 UTC
Submitted a PR for fixing the sed issue: https://github.com/Ventto/libshlist/pull/2 and included a small set of tests to make sure we can easily validate this for changes in the future. Once thats merged well update mons and its refs in the port.
Comment 4 Robert James Hernandez 2020-08-21 03:52:24 UTC
Also has an issue with the "command -pv xrandr" for mons so I opened this related issue as well: https://github.com/Ventto/mons/pull/44
Comment 5 Conrad Meyer freebsd_committer freebsd_triage 2020-08-21 04:32:25 UTC
Thanks!
Comment 6 Robert James Hernandez 2021-01-20 02:34:04 UTC
Should we just generate the patches for mons since upstream the maintainer seems to be unresponsive? Seems to be our best option until gets around to review it.