summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRobert Schwebel <r.schwebel@pengutronix.de>2018-10-05 23:40:07 +0200
committerRobert Schwebel <r.schwebel@pengutronix.de>2018-10-05 23:40:07 +0200
commit78f0dbfdcddee0b2e987854746c8c74567229a81 (patch)
tree143ce09341dba7317e000cc7eb4f30a75d80f06e /scripts
parent2b9f01802b00af863a163504bc6d735cdac472b2 (diff)
downloadDistroKit-78f0dbfdcddee0b2e987854746c8c74567229a81.tar.gz
DistroKit-78f0dbfdcddee0b2e987854746c8c74567229a81.tar.xz
scripts: backport bugfix for /etc/issue generation
In 4e3f122b9094f2e7c990207f7564ea575a455e07, the /etc/issue banner generation was ported back to the version from ptxdist-2018.09.0. It turned out that there is a bug in ptxdist-2018.10.0 (missing ,g in regular expression), so we go back to that version, with the missing ,g added. The fix should go into ptxdist-2018.11.0, so we can remove this local override afterwards. Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/ptxd_make_xpkg_pkg.sh15
1 files changed, 8 insertions, 7 deletions
diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh b/scripts/lib/ptxd_make_xpkg_pkg.sh
index f6ceb86..b75690b 100644
--- a/scripts/lib/ptxd_make_xpkg_pkg.sh
+++ b/scripts/lib/ptxd_make_xpkg_pkg.sh
@@ -36,13 +36,13 @@ install replace figlet:
local escapemode="$2"
figlet -d "${PTXDIST_SYSROOT_HOST}/share/figlet" -- "${value}" | \
case "$escapemode" in
- # a lot of leaning toothpicks because we need to escape a literal
- # '\' with '\\' on multiple levels:
- # - one level for the string inside awk: \\\\\\\\\\\\\\\\ -> \\\\\\\\
- # - one level for the shell string after sed -e: -> \\\\
- # - one level for the s expression inside sed: -> \\
- # - and finally, one level for /etc/issue: -> \
- etcissue) awk '{ gsub("\\\\", "\\\\\\\\\\\\\\\\"); print }' ;;
+ # /etc/issue needs each backslash quoted by another backslash. As
+ # the string is interpreted by the shell once more below, another
+ # level of quoting is needed such that every \ in the output of
+ # figlet needs to be replaced by \\\\. As a \ in sed needs to be
+ # quoted, too, this results in eight backslashes in the replacement
+ # string.
+ etcissue) sed 's,\\,\\\\\\\\,g';;
*) ;;
esac | \
awk '{ if ($0 !~ "^ *$") printf("%s\\n", $0) }' # newlines for sed
@@ -52,5 +52,6 @@ install replace figlet:
ptxd_install_error "install_replace failed!"
}
+
export -f ptxd_install_replace_figlet