Created attachment 207890 [details]
sysrc.subr patch obtained from https://github.com/freebsd/poudriere/pull/708#issuecomment-526753174
Currently, with sysrc, if the file to be modified does not exist, an error message is displayed.
In this case, there is no /etc/rc.conf:
root@test:~ # sysrc hostname="test.example.com"
awk: can't open file /etc/rc.conf
source line number 1
hostname: -> test.example.com
The patch fixes this situation.
This patch was created by @dteske, obtained from https://github.com/freebsd/poudriere/pull/708#issuecomment-526753174
A commit references this bug:
Date: Mon Dec 2 05:24:17 UTC 2019
New revision: 355280
Fix spurious error from sysrc
When using sysrc to modify a file, the file should be created silently.
However, with the introduction of SVN r335280, an error of "No such file
or directory" would appear despite everything else working as-expected.
The nature of this spurious error is that SVN r335280 did not check if
the file exists first, before trying to fixup the line-endings in the
file just prior to modification.
Reported by: Jose Luis Duran
MFC after: 3 days