From 4e3f122b9094f2e7c990207f7564ea575a455e07 Mon Sep 17 00:00:00 2001 From: Robert Schwebel Date: Fri, 5 Oct 2018 17:53:28 +0200 Subject: scripts: revert /etc/issue generation to pre-ptxdist-2018.10.0 variant The upstream rework of the banner generation from ptxdist commit f53889792197d93ca2f9bb7edc0d8e778c0ba9e2 is broken. Revert temporarily to the version from ptxdist-2018.09.0. Signed-off-by: Robert Schwebel --- scripts/lib/ptxd_make_xpkg_pkg.sh | 56 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 scripts/lib/ptxd_make_xpkg_pkg.sh diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh b/scripts/lib/ptxd_make_xpkg_pkg.sh new file mode 100644 index 0000000..f6ceb86 --- /dev/null +++ b/scripts/lib/ptxd_make_xpkg_pkg.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# +# Copyright (C) 2010 by Michael Olbrich +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# workaround for ptxdist-2018.10.0: override this function to the old +# variant from ptxdist-2018.09.0, as it is currently broken. +# + +export -fn ptxd_install_replace_figlet + +ptxd_install_replace_figlet() { + local dst="$1" + local placeholder="$2" + local value="$3" + local escapemode="$4" + local -a dirs ndirs pdirs sdirs ddirs + local mod_nfs mod_rw + + ptxd_install_setup && + echo "\ +install replace figlet: + file=${dst} + '${placeholder}' -> '\`figlet ${value}\`' +" && + + ptxd_exist "${dirs[@]/%/${dst}}" && + ptxd_figlet_helper() { + local value="$1" + 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 }' ;; + *) ;; + esac | \ + awk '{ if ($0 !~ "^ *$") printf("%s\\n", $0) }' # newlines for sed + } && + figlet="$(ptxd_figlet_helper "$value" "$escapemode")" && + sed -i -e "s#${placeholder}#${figlet}#g" "${dirs[@]/%/${dst}}" || + + ptxd_install_error "install_replace failed!" +} +export -f ptxd_install_replace_figlet + -- cgit v1.2.3