Skip to content
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

test-case: add quotes to function arguments for func_export_pipeline #475

Merged
merged 1 commit into from
Oct 29, 2020

Conversation

aiChaoSONG
Copy link

@aiChaoSONG aiChaoSONG commented Oct 27, 2020

If a shell function takes a variable as its argument,
and the variable is empty, then the argument will
degrade to nothing in the function.

This patch adds quotes to function arguments to avoid
argument degrading.

Signed-off-by: Amery Song [email protected]

@aiChaoSONG aiChaoSONG requested a review from a team as a code owner October 27, 2020 06:42
Copy link
Collaborator

@marc-hb marc-hb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally agree with the change except it is way too big. For instance is possible some function calls rely sometimes on white space inside the argument, which is bad (it should use a bash array instead) but working and this would break it.

Please resubmit with only the changes you need right now and with a separate commit per function.

@aiChaoSONG
Copy link
Author

@marc-hb Updated, I only need the change for func_pipeine_export

xiulipan
xiulipan previously approved these changes Oct 28, 2020
@xiulipan xiulipan requested a review from marc-hb October 28, 2020 07:46
@marc-hb
Copy link
Collaborator

marc-hb commented Oct 28, 2020

Looks good except you kept the older and now misleading commit subject.

@aiChaoSONG aiChaoSONG changed the title test-case: fix function argument degrading test-case: add quotes to function arguments for func_export_pipeline Oct 29, 2020
@aiChaoSONG
Copy link
Author

@xiulipan Please help to approve this PR again, as I change the misleading commit subject as Marc suggested. Once this get merged, I will test #430, if the result is good, it can be merged too.

Copy link
Collaborator

@marc-hb marc-hb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No functional change, only add quotes.

It is a big functional change when the $tplg argument is empty or not defined.

marc-hb
marc-hb previously approved these changes Oct 29, 2020
If a shell function takes a variable as its argument,
and the variable is empty, then the argument will
degrade to nothing in the function.

This patch adds quotes to function arguments for
func_export_pipeline to avoid argument degrading.

Signed-off-by: Amery Song <[email protected]>
@aiChaoSONG aiChaoSONG requested a review from xiulipan October 29, 2020 06:23
@marc-hb
Copy link
Collaborator

marc-hb commented Oct 29, 2020

Travis builds delayed everywhere because of the required migration to travis.com https://travis-ci.community/t/builds-hang-in-queued-state/10250 shellcheck would not have been very helpful in this PR because of the number of files changed. I reviewed every line carefully.

The only failure in https://sof-ci.01.org/softestpr/PR475/build346/devicetest/ is a RTC wakeup failure on just one system, this can't be related.

Merging this to unblock #430

@marc-hb marc-hb merged commit 5479c13 into thesofproject:master Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants