Skip to content

Semver2#625

Open
oocube wants to merge 6 commits into
masterfrom
semver2
Open

Semver2#625
oocube wants to merge 6 commits into
masterfrom
semver2

Conversation

@oocube
Copy link
Copy Markdown
Contributor

@oocube oocube commented May 13, 2026

This second semver PR activates the semantic version number in our builds. With that #616 is complete.

Comment thread installers/win32/create_nsis.sh Outdated
return 1
fi

if [ -z "${VER_NSIS}" ]
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.

It's generally best practice to use double brackets [[ ]]

VER_MAJ=$(echo "$VERSION" | cut -d. -f1)
VER_MIN=$(echo "$VERSION" | cut -d. -f2)
VER_REV=$(echo "$VERSION" | cut -d. -f3)
if [ "" == "$VER_REV" ]; then
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.

Single Brackets (Dangerous):
if [ $name == "Bob" ]
If $name is empty, Bash sees: if [ == "Bob" ], which is a syntax error.

Double Brackets (Safe):
if [[ $name == "Bob" ]]
Even if $name is empty, Bash handles it gracefully without requiring extra quotes.

I try to stick to double brackets everywhere for consistency.

Comment thread ShellScripts/common/get_version.sh Outdated
VER_FULL="$VER_MAJ.$VER_MIN.$VER_REV.$VER_GITREV-$VER_DATE-$VER_GITHASH"
BUILDTIME=$(date "+%Y.%m.%d %H:%M")

if [ -z "${SEMVER}" ] || [ -z "${PROJECTNAME}" ]
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.

I would use double brackets and you can just do "$SEMVER" and "$PROJECTNAME"

else
# Variables passed in. Make use of them.

VER_FULL="${SEMVER}"
Copy link
Copy Markdown
Contributor

@mcarans mcarans May 13, 2026

Choose a reason for hiding this comment

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

simplify to "$SEMVER"

@mcarans
Copy link
Copy Markdown
Contributor

mcarans commented May 13, 2026

I added some comments.

BTW, do you think it would be better for PRs to fork the Oolite repo, then make PRs from the fork keeping the Oolite repo clean with only master and version branches (and maybe a develop branch)?

@phkb
Copy link
Copy Markdown
Contributor

phkb commented May 13, 2026

Windows Test version fails to start with this error

The procedure entry point __emutls_v._ZSt11__once_call could not be located in the dynamic link library C:\Oolite-semver\oolite.app\gnustep-base-1_31.dll

Haven't tried the standard version.

@oocube
Copy link
Copy Markdown
Contributor Author

oocube commented May 13, 2026

I added some comments.

BTW, do you think it would be better for PRs to fork the Oolite repo, then make PRs from the fork keeping the Oolite repo clean with only master and version branches (and maybe a develop branch)?

Added the double brackets although I am more happy with a syntax error than some automagical fix.
And just like your best practice for double brackets the curly ones are my best practice. ;-)

Your idea of handing development elsewhere is interesting. I was close to suggesting you to use branches in the oolite repository, thus making your development more visible to others. But I am happy to see now we have prereleases available for download for all branches and pull requests. Which means I can make a change and everybody and download and test the behaviour even without having merged. And for guys like you who develop in private then come up with a pull request, the PR will also result in a prerelease so we can test the behaviour before having to merge.

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