diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2018-09-19 10:43:36 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2018-09-27 10:28:56 +0200 |
commit | f53889792197d93ca2f9bb7edc0d8e778c0ba9e2 (patch) | |
tree | bc9209c0e99f6663b76b1031de333e28fce64bec /rules | |
parent | a01211f648e7d40821797a9be293f978317d1c7b (diff) | |
download | ptxdist-f53889792197d93ca2f9bb7edc0d8e778c0ba9e2.tar.gz ptxdist-f53889792197d93ca2f9bb7edc0d8e778c0ba9e2.tar.xz |
ptxd_install_replace_figlet: Use sed instead of awk to quote backslashes
TL;DR: awk and backslashes in the replacement argument of gsub is ugly.
With GNU Awk 4.0.2 we have:
$ echo '\' | awk '{ gsub("\\\\", "\\\\\\\\\\\\\\\\"); print }'
\\\\\\\\
and with GNU Awk 4.1.4 (and newer) we have:
$ echo '\' | awk '{ gsub("\\\\", "\\\\\\\\\\\\\\\\"); print }'
\\\\
This results in too much backslashes in /etc/issues for users of the
former version.
For the glory details I recommend reading through
https://www.gnu.org/software/gawk/manual/html_node/Gory-Details.html
https://bugs.debian.org/909147
As it's awkward to come up with an expression that does the same on both
versions (e.g. using --posix) use sed instead.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'rules')
0 files changed, 0 insertions, 0 deletions