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

fix grep and sed usage #1162

Merged
merged 2 commits into from
Jun 7, 2024
Merged

fix grep and sed usage #1162

merged 2 commits into from
Jun 7, 2024

Conversation

rasolca
Copy link
Collaborator

@rasolca rasolca commented Jun 6, 2024

Closes #1158

@rasolca rasolca added this to the v0.5.1 milestone Jun 6, 2024
@rasolca rasolca self-assigned this Jun 6, 2024
VERSION_MAJOR=$(sed -n 's/project(DLAF VERSION \([0-9]\+\)\.[0-9]\+\.[0-9]\+)/\1/p' CMakeLists.txt)
VERSION_MINOR=$(sed -n 's/project(DLAF VERSION [0-9]\+\.\([0-9]\+\)\.[0-9]\+)/\1/p' CMakeLists.txt)
VERSION_PATCH=$(sed -n 's/project(DLAF VERSION [0-9]\+\.[0-9]\+\.\([0-9]\+\))/\1/p' CMakeLists.txt)
VERSION_MAJOR=$(sed -n 's/project(DLAF VERSION \([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\))/\1/p' CMakeLists.txt)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

[0-9]\+ is not supported by sed on macos.
(also [0-9]\{1,\} is only supported by GNU sed)

VERSION_FULL="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"
VERSION_FULL_TAG="v${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"
VERSION_TITLE="DLA-Future ${VERSION_FULL}"
CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
RELEASE_DATE=$(date '+%Y-%m-%d')

GREP_VERSION_FULL="$(echo ${VERSION_FULL} | sed s/\\./\\\\./g)"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Need to escape dots otherwise grep matches every char.

@rasolca
Copy link
Collaborator Author

rasolca commented Jun 6, 2024

@RMeli, do you want the same changes on DLAFF?

@RMeli
Copy link
Member

RMeli commented Jun 6, 2024

Since getting an instance on castor I don't use macOS anymore for actual work, but I think it would be good to keep the two scripts more or less in sync. Do you want to open a PR? Otherwise, I'll port it over when this is merged.

@rasolca
Copy link
Collaborator Author

rasolca commented Jun 6, 2024

Since getting an instance on castor I don't use macOS anymore for actual work, but I think it would be good to keep the two scripts more or less in sync. Do you want to open a PR? Otherwise, I'll port it over when this is merged.

Will open a PR when merged.
Anyway non escaping dots when grepping is a bug everywhere...

@rasolca rasolca merged commit 644d9d2 into master Jun 7, 2024
4 checks passed
@rasolca rasolca deleted the rasolca/fix_release_script branch June 7, 2024 09:26
github-actions bot pushed a commit that referenced this pull request Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Improvements for release script
3 participants