Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/freebsd/poudriere.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAllan Jude <allan@klarasystems.com>2021-10-31 18:31:27 +0300
committerEmmanuel Vadot <manu@bidouilliste.com>2021-11-04 16:30:13 +0300
commit0021004be45b3d1c6287baf4313b8b8e9d15b64c (patch)
treeabad5eec1a863cab7e1db782adbe43e7551523bb /src
parentee5bbca734b541504e0d023967a352724bf1dcd8 (diff)
image: use parameter substitution to parse $MEDIATYPE
Replace `$(echo ${MEDIATYPE} | cut -d '+' -f 1)` with shell builtins
Diffstat (limited to 'src')
-rw-r--r--src/share/poudriere/image.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/share/poudriere/image.sh b/src/share/poudriere/image.sh
index 3715b79c..01b24c0b 100644
--- a/src/share/poudriere/image.sh
+++ b/src/share/poudriere/image.sh
@@ -390,8 +390,10 @@ post_getopts
: ${IMAGENAME:=poudriereimage}
MASTERNAME=${JAILNAME}-${PTNAME}${SETNAME:+-${SETNAME}}
-MAINMEDIATYPE=$(echo ${MEDIATYPE} | cut -d '+' -f 1)
-SUBMEDIATYPE=$(echo ${MEDIATYPE} | cut -d '+' -f 2)
+MAINMEDIATYPE=${MEDIATYPE%%+*}
+MEDIAREMAINDER=${MEDIATYPE#*+}
+SUBMEDIATYPE=${MEDIAREMAINDER%%+*}
+MEDIAREMAINDER=${MEDIAREMAINDER#*+}
if [ "${MEDIATYPE}" = "none" ]; then
err 1 "Missing -t option"