mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-07 00:50:50 +00:00
/etc/rc.d/motd: Update to accommodate changes in uname(1) and newvers.sh
The recent changes to the uname(1) command removed trailing spaces for better POSIX conformance, but it broke the regular expression used by the motd script which expected it. This commit addresses this by removing the requirement, as it is no longer present. Additionally, a recent change in newvers.sh introduced a new format for uname -v, which omited the build number and build dates to improve reproducible build support. This commit adds support for this new format. Reported-by: Jamie Landeg-Jones <jamie@catflap.org> Reviewed-by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D40225
This commit is contained in:
parent
5a9c724847
commit
634a770a5e
|
@ -45,7 +45,8 @@ motd_start()
|
|||
fi
|
||||
|
||||
T=`mktemp -t motd`
|
||||
uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > ${T}
|
||||
uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\)$,\1 (\3) #\2,' \
|
||||
-e 's,^\([^ ]*\) \([^ ]*\) \([^ ]*\) \([^ ]*\)$,\1 \2 (\4) \3,' > ${T}
|
||||
cat "${TEMPLATE}" >> ${T}
|
||||
|
||||
install -C -o root -g wheel -m "${PERMS}" "$T" "${TARGET}"
|
||||
|
|
Loading…
Reference in a new issue