fix: reliable Ubuntu version check and safe apt glob removal in setup.sh - #231
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/EngineScript/EngineScript/sessions/26d2bd26-4501-47a4-8280-7f2331171633 Co-authored-by: PDowney <11467177+PDowney@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix unreliable Ubuntu version comparison in setup script
fix: reliable Ubuntu version check and safe apt glob removal in setup.sh
May 2, 2026
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
PDowney
approved these changes
May 2, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens setup.sh, the repository’s top-level bootstrap script for provisioning an EngineScript Ubuntu host, by making the Ubuntu release check independent of bc and by preventing shell expansion during package cleanup.
Changes:
- Replace the
bc-based Ubuntu 24.04 comparison with an integer comparison derived fromlsb_release -sr. - Quote the package patterns passed to
apt-get removeand add--purgeso cleanup is safer and more predictable.
Comment on lines
+40
to
+43
| UBUNTU_VERSION_INT="$(tr -d '.' <<<"$UBUNTU_VERSION")" | ||
| NOBLE_INT=2404 | ||
|
|
||
| if (( $(bc <<<"$UBUNTU_VERSION != $Noble") )); then | ||
| if (( UBUNTU_VERSION_INT != NOBLE_INT )); then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Two shell scripting hazards in
setup.sh:bc-based floating-point version comparison (unreliable) and unquoted apt glob patterns (unsafe shell expansion).Software Version Updates
Changed Versions
Version Diff
Verification Checklist
Notes
Ubuntu version check — strips the decimal from
lsb_release -sroutput (24.04→2404) and compares as integers with(( )), eliminating thebcdependency and floating-point ambiguity. Variable renamed toNOBLE_INTper projectUPPER_CASEconvention.apt cleanup — adds
--purgeto remove residual config files, and quotes glob patterns to prevent unintended shell expansion beforeapt-getreceives them.Original prompt