install-template.sh: Optimize by using Bourne shell builtins.

This replaces forking separate processes and using "cut" with Bourne
shell builtin operations for "remove largest suffix pattern" and
"remove smallest prefix pattern" operations.
This commit is contained in:
Havard Eidnes
2026-03-25 07:30:12 +00:00
parent 8a703520e8
commit 86aac98cfc
+4 -4
View File
@@ -433,8 +433,8 @@ uninstall_components() {
local _directive
while read _directive; do
local _command=`echo $_directive | cut -f1 -d:`
local _file=`echo $_directive | cut -f2 -d:`
local _command="${_directive%%:*}"
local _file="${_directive#*:}"
# Sanity checks
if [ ! -n "$_command" ]; then critical_err "malformed installation directive"; fi
@@ -541,8 +541,8 @@ install_components() {
local _directive
while read _directive; do
local _command=`echo $_directive | cut -f1 -d:`
local _file=`echo $_directive | cut -f2 -d:`
local _command="${_directive%%:*}"
local _file="${_directive#*:}"
# Sanity checks
if [ ! -n "$_command" ]; then critical_err "malformed installation directive"; fi