-
Notifications
You must be signed in to change notification settings - Fork 29
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
Failing 01_update_platforms_check.sh on Fedora IoT #93
Comments
This regression happened recently with 84bbd67 |
@alcir did you want to open a RHBZ for this issue so we can track it for F38? (if not I can) Thanks for finding it! |
See: https://github.com/koalaman/shellcheck/wiki/SC2048 In the case of the UPDATE_PLATFORM_URLS variable, we actually want to split on whitespace since the array should just contain URLs. Disable the Shellcheck directive for this array. Closes: fedora-iot#93
I will |
It is already tracked |
Again, I'm not a bash expert, but instead of disable shellcheck, here
we could actually populate the UPDATE_PLATFORM_URLS array simply in this way UPDATE_PLATFORM_URLS=($(grep -P -ho 'http[s]?.*' $REPOS_DIRECTORY/*)) or readarray -t UPDATE_PLATFORM_URLS < <(grep -P -ho 'http[s]?.*' $REPOS_DIRECTORY/*)
|
Could you make this same suggestion on the PR itself (#94)? Maintaining the context of the suggestion would make it easier to discuss. |
Yes that works for me, I also I made this that works as well using the tr command. UPDATE_PLATFORM_URLS=$(grep -P -ho 'http[s]?.' $REPOS_DIRECTORY/ | tr '\n' ' ') |
This updates the script to be more ShellCheck compliant around the assignment of the UPDATE_PLATFORM_URLS variable and the check to see if the varible is empty. The existing functionality remains unchanged. Thanks to @alcir for the suggested changes! Closes: fedora-iot#93
I don't know if it is a duplicate of #90 and #71, so excuse me in advance:
On a fresh Fedora IoT 37 I always get
Also running
/usr/lib/greenboot/check/wanted.d/01_update_platforms_check.sh
by hand after the boot, it returns the same result.I'm not a great bash expert, but I suspect that the double quotes around the
${UPDATE_PLATFORM_URLS[@]}
will result in a single line containing all the UPDATE_PLATFORM_URLS making ineffective the for loopgreenboot/usr/lib/greenboot/check/wanted.d/01_update_platforms_check.sh
Line 16 in 7ad3ea5
At the end of the day, the curl command is
curl -o /dev/null -Isw '%{http_code}\n' "https://ostree.fedoraproject.org/iot https://ostree.fedoraproject.org/iot/mirrorlist"
leading to a 000 HTTP_STATUS variable (that is curl: (3) URL using bad/illegal format or missing URL)
In short: if in such line I remove the double quotes
for UPDATE_PLATFORM_URL in ${UPDATE_PLATFORM_URLS[@]}; do
the script works as expected.
The text was updated successfully, but these errors were encountered: