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

Update buildrelease.sh to consider release-candidate tags #11370

Merged
merged 1 commit into from
Nov 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bin/buildrelease.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ if [ -z $TAG ]; then
fi

# Check whether this git branch is allowed to be tagged
if ! echo ${GITBRANCH} | egrep -iq 'master|_wmagent|_crab|_cmsweb|_dbs' ; then
echo "ABORTING - Can only release from master / _crab / _dbs / _wmagent / _cmsweb branches: ${GITBRANCH}"
if ! echo ${GITBRANCH} | egrep -iq 'master|_wmagent|_crab|_cmsweb' ; then
echo "ABORTING - Can only release from master / _crab / _wmagent / _cmsweb branches: ${GITBRANCH}"
exit 4
fi

Expand All @@ -56,7 +56,7 @@ echo "Updating version string ..."
perl -p -i -e "s{__version__ =.*}{__version__ = '$TAG'}g" src/python/WMCore/__init__.py
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you're making changes, how about changing this line and get rid of perl. You can replace this with sed and use flag -i which will do replacement in place of given file. Getting rid of perl will reduce dependency chain and shell script can rely on standard UNIX tools rather dedicated programming language.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this line is simple to replace. But the helper function is a bit more tricky.
I created an specific issue for this task though: #11372


echo "Generating CHANGES file"
LASTCOMMITLINE=$(git log -n1 --oneline -E --grep="^[0-9]+\.[0-9]+\.[0-9]+\.*(pre|patch)*[0-9]*$")
LASTCOMMITLINE=$(git log -n1 --oneline -E --grep="^[0-9]+\.[0-9]+\.[0-9]+\.*(rc|patch)*[0-9]*$")
LASTCOMMIT=$(echo ${LASTCOMMITLINE} | awk '{print $1}')
LASTVERSION=$(echo ${LASTCOMMITLINE} | awk '{print $2}')

Expand Down