This is an automated email from the ASF dual-hosted git repository.

dahn pushed a commit to branch 4.20
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.20 by this push:
     new 47a6ac89ba5 Update templateConfig.sh to not break with directorys with 
space on t… (#10898)
47a6ac89ba5 is described below

commit 47a6ac89ba5b3324c9dd91a52054e58ed19949c0
Author: Vitor Hugo Homem Marzarotto 
<[email protected]>
AuthorDate: Sun Dec 21 06:22:39 2025 -0300

    Update templateConfig.sh to not break with directorys with space on t… 
(#10898)
    
    Co-authored-by: Vitor Hugo Homem Marzarotto 
<[email protected]>
    Co-authored-by: Henrique Sato <[email protected]>
    Co-authored-by: Wei Zhou <[email protected]>
---
 engine/schema/templateConfig.sh | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/engine/schema/templateConfig.sh b/engine/schema/templateConfig.sh
index d10b8668b12..0d55eb37d04 100644
--- a/engine/schema/templateConfig.sh
+++ b/engine/schema/templateConfig.sh
@@ -62,8 +62,8 @@ function getChecksum() {
 }
 
 function createMetadataFile() {
-  local fileData=$(cat $SOURCEFILE)
-  echo -e "["default"]\nversion = $VERSION.${securityversion}\n" >> 
$METADATAFILE
+  local fileData=$(cat "$SOURCEFILE")
+  echo -e "["default"]\nversion = $VERSION.${securityversion}\n" >> 
"$METADATAFILE"
   for template in "${templates[@]}"
   do
     section="${template%%:*}"
@@ -76,7 +76,7 @@ function createMetadataFile() {
     templatename="systemvm-${sectionHv%.*}-${VERSION}-${arch}"
     checksum=$(getChecksum "$fileData" "$VERSION-${arch}-$hvName")
     filename=$(echo ${downloadurl##*'/'})
-    echo -e "["$section"]\ntemplatename = $templatename\nchecksum = 
$checksum\ndownloadurl = $downloadurl\nfilename = $filename\narch = 
$arch\nguestos = $guestos\n" >> $METADATAFILE
+    echo -e "["$section"]\ntemplatename = $templatename\nchecksum = 
$checksum\ndownloadurl = $downloadurl\nfilename = $filename\narch = 
$arch\nguestos = $guestos\n" >> "$METADATAFILE"
   done
 }
 
@@ -91,8 +91,8 @@ templates=( 
"kvm-x86_64:https://download.cloudstack.org/systemvm/${CS_VERSION}/s
             
"ovm3:https://download.cloudstack.org/systemvm/$CS_VERSION/systemvmtemplate-$VERSION-x86_64-ovm.raw.bz2";
 )
 
 PARENTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P 
)/dist/systemvm-templates/"
-mkdir -p $PARENTPATH
-METADATAFILE=${PARENTPATH}"metadata.ini"
-echo > $METADATAFILE
-SOURCEFILE=${PARENTPATH}'md5sum.txt'
+mkdir -p "$PARENTPATH"
+METADATAFILE="${PARENTPATH}metadata.ini"
+echo > "$METADATAFILE"
+SOURCEFILE="${PARENTPATH}md5sum.txt"
 createMetadataFile

Reply via email to