Skip to content

Fixed bad quoting of variable expansions - #2038

Merged
larsewi merged 1 commit into
cfengine:masterfrom
larsewi:results
Nov 14, 2025
Merged

Fixed bad quoting of variable expansions#2038
larsewi merged 1 commit into
cfengine:masterfrom
larsewi:results

Conversation

@larsewi

@larsewi larsewi commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

You would normally use double quotes when expanding variables to prevent
word splitting. However, these variables contain options to rsync,
hence we want word splitting to occur.

This should fix the issue where no test results are reported to the
Jenkins CI.

Signed-off-by: Lars Erik Wik lars.erik.wik@northern.tech

You would normally use double quotes when expanding variables to prevent
word splitting. However, these variables contain options to `rsync`,
hence we want word splitting to occur.

This should fix the issue where no test results are reported to the
Jenkins CI.

Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
@larsewi

larsewi commented Nov 14, 2025

Copy link
Copy Markdown
Contributor Author

@cf-bottom Jenkins please :)

@larsewi
larsewi marked this pull request as ready for review November 14, 2025 12:03
@cf-bottom

Copy link
Copy Markdown

@vpodzime vpodzime left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me otherwise.

# shellcheck disable=SC2086
# > Double quote to prevent globbing and word splitting.
# We want word splitting
rsync -rv $INCLUDES --exclude="*" \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please double-check that the * is not expanded locally without quotes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Why? The quotes are there to prevent globbing. And they should be there? At least they have been there for over 10 years without any trouble.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Do you mean the * from here INCLUDES='--include=test.* --include=summary.*' ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Either way, I think it will be fine. I recently added double quotes on the INCLUDES variable expansion to fix shellcheck warnings. And the quotes should not really have been there. Now, I'm just putting things back to the way they where and disabling the shellcheck warnings from those lines.

@larsewi
larsewi merged commit 26d2b64 into cfengine:master Nov 14, 2025
21 of 35 checks passed
@larsewi
larsewi deleted the results branch April 27, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants