-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Update templateConfig.sh to not break with directorys with space on t… #10898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 4.19
Are you sure you want to change the base?
Conversation
METADATAFILE=${PARENTPATH}"metadata.ini" | ||
echo > $METADATAFILE | ||
METADATAFILE="${PARENTPATH}metadata.ini" | ||
echo > "$METADATAFILE" | ||
SOURCEFILE=${PARENTPATH}'md5sum.txt' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about line 81 and line 84 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They should not have problems, since on line 80 it's certain that the PARENTPATH variable will be a String, so line 81 and 84 should always work properly even with spaces on the paths. If you find any test case that triggers an error please report to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vits-hugs
my testing result: no space in METADATAFILE
<08:21:05> weizhou:/tmp $ mkdir "aa bb"
<08:21:07> weizhou:/tmp $ cd aa\ bb/
<08:21:09> weizhou:/tmp/aa bb $
<08:21:09> weizhou:/tmp/aa bb $
<08:21:09> weizhou:/tmp/aa bb $ PARENTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )/dist/systemvm-templates/"
<08:21:14> weizhou:/tmp/aa bb $ echo $PARENTPATH
/usr/bin/dist/systemvm-templates/
<08:21:26> weizhou:/tmp/aa bb $ METADATAFILE=${PARENTPATH}"metadata.ini"
<08:22:00> weizhou:/tmp/aa bb $ echo $METADATAFILE
/usr/bin/dist/systemvm-templates/metadata.ini
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, when i tested, i got the result below, which is the expected behaviour, i don't know how you got the "/usr/bin/..." path, since the command "pwd -P" should return your current working directory.
vitor@vitor-Inspiron-5480:/tmp$ mkdir "aa bb"
vitor@vitor-Inspiron-5480:/tmp$ cd aa\ bb/
vitor@vitor-Inspiron-5480:/tmp/aa bb$ PARENTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )/dist/systemvm-templates/"
vitor@vitor-Inspiron-5480:/tmp/aa bb$ echo $PARENTPATH
/tmp/aa bb/dist/systemvm-templates/
vitor@vitor-Inspiron-5480:/tmp/aa bb$ METADATAFILE=${PARENTPATH}"metadata.ini"
vitor@vitor-Inspiron-5480:/tmp/aa bb$ echo > "$METADATAFILE"
bash: /tmp/aa bb/dist/systemvm-templates/metadata.ini: No such file or directory
vitor@vitor-Inspiron-5480:/tmp/aa bb$
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 4.19 #10898 +/- ##
=============================================
- Coverage 15.17% 4.28% -10.90%
=============================================
Files 5414 372 -5042
Lines 475185 29743 -445442
Branches 57991 5229 -52762
=============================================
- Hits 72105 1274 -70831
+ Misses 395018 28324 -366694
+ Partials 8062 145 -7917
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Currently the script of
templateConfig.sh
doesn't recognize folders with spaces in their names, which can cause compilation errors, this PR updates the script so that the folders with space in their names are recognized.Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
To test this, I renamed my user folder to have a white-space in it, then ran the process of building the project, which runs the
templateConfig.sh
, and verified that there wasn't any errors on the building process.