summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2011-09-02 14:43:42 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2011-09-03 16:01:23 +0200
commit9ef3729c1fa1d4aca87d4fe94fd18f56d817109e (patch)
treec56d4be2011b0a741b40d31d8d8b390b97bf3779
parent539cab92c08696f73235ed2a68f1d64c7c165fd5 (diff)
downloadptxdist-9ef3729c1fa1d4aca87d4fe94fd18f56d817109e.tar.gz
ptxdist-9ef3729c1fa1d4aca87d4fe94fd18f56d817109e.tar.xz
install_replace_figlet: added
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--rules/post/install.make20
-rw-r--r--scripts/lib/ptxd_make_xpkg_pkg.sh24
2 files changed, 44 insertions, 0 deletions
diff --git a/rules/post/install.make b/rules/post/install.make
index 93f37ee57..0fc4b3b3e 100644
--- a/rules/post/install.make
+++ b/rules/post/install.make
@@ -234,6 +234,26 @@ install_replace = \
echo "ptxd_install_replace '$$FILE' '$$PLACEHOLDER' '$$VALUE'" >> "$(STATEDIR)/$$XPKG.cmds"
#
+# install_replace_figlet
+#
+# Replace placeholder with `figlet value` in a previously
+# installed file
+# Note: packages using this need to select host-figlet!
+#
+# $1: xpkg label
+# $2: filename
+# $3: placeholder
+# $4: value
+#
+install_replace_figlet = \
+ XPKG=$(subst _,-,$(strip $(1))); \
+ FILE=$(strip $(2)); \
+ PLACEHOLDER=$(strip $(3)); \
+ VALUE=$(strip $(4)); \
+ $(call install_check, install_replace); \
+ echo "ptxd_install_replace_figlet '$$FILE' '$$PLACEHOLDER' '$$VALUE'" >> "$(STATEDIR)/$$XPKG.cmds"
+
+#
# install_copy_toolchain_lib
#
# $1: xpkg label
diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh b/scripts/lib/ptxd_make_xpkg_pkg.sh
index 096ef7d6f..ad0884227 100644
--- a/scripts/lib/ptxd_make_xpkg_pkg.sh
+++ b/scripts/lib/ptxd_make_xpkg_pkg.sh
@@ -369,6 +369,30 @@ install replace:
}
export -f ptxd_install_replace
+ptxd_install_replace_figlet() {
+ local dst="$1"
+ local placeholder="$2"
+ local value="$3"
+ local -a dirs ndirs pdirs sdirs
+ local mod_nfs mod_rw
+
+ echo "\
+install replace figlet:
+ file=${dst}
+ '${placeholder}' -> '\`figlet ${value}\`'
+"
+
+ ptxd_install_setup &&
+
+ ptxd_exist "${dirs[@]/%/${dst}}" &&
+ figlet="$(figlet -d "${PTXDIST_SYSROOT_HOST}/share/figlet" -- "${value}" | \
+ awk '{ gsub("\\\\", "`"); if ($0 !~ "^ *$") printf("%s\\n", $0) }')" &&
+ sed -i -e "s#${placeholder}#${figlet}#g" "${dirs[@]/%/${dst}}" ||
+
+ ptxd_install_error "install_replace failed!"
+}
+export -f ptxd_install_replace_figlet
+
ptxd_install_generic() {
local file="$1"
local dst="$2"