Skip to content

Commit

Permalink
Merge pull request #11 from deneb-alpha/do_not_hardcode_release_value
Browse files Browse the repository at this point in the history
Do not hardcode a fixed release value but align it with the value used while tagging
  • Loading branch information
deneb-alpha authored Apr 9, 2024
2 parents 4d19c5a + fbb5ce3 commit e82bee8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bin/build-packages-for-obs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ while read PKG_NAME PKG_VER PKG_DIR; do
# Convert to obscpio
SPEC_VER=$(sed -n -e 's/^Version:\s*\(.*\)/\1/p' ${T_DIR}/${PKG_NAME}.spec)
SOURCE=$(sed -n -e 's/^\(Source\|Source0\):\s*.*[[:space:]\/]\(.*\)/\2/p' ${T_DIR}/${PKG_NAME}.spec|sed -e "s/%{name}/${PKG_NAME}/"|sed -e "s/%{version}/${SPEC_VER}/")
SPEC_REL=$(sed -n -e 's/^Release: \+\([0-9]\).*/\1/p' ${T_DIR}/${PKG_NAME}.spec)
# If the package does not have sources, we don't need to repackage them
if [ "${SOURCE}" != "" ]; then
FOLDER=$(tar -tf ${T_DIR}/${SOURCE}|head -1|sed -e 's/\///')
Expand All @@ -176,8 +177,10 @@ commit: $(git rev-parse --verify HEAD)
EOF
fi
# Release is handled by the Buildservice
# Remove everything what prevents us from submitting
sed -i 's/^Release.*$/Release: 0/i' $SRPM_DIR/$PKG_NAME/*.spec
# With untagged changes we can only build using --test with tito build.
# tito build with --test appends the git hash to the release version and we do not want this.
# Remove everything preventing us from submitting
sed -i "s/^Release.*$/Release: ${SPEC_REL}/i" ${SRPM_DIR}/${PKG_NAME}/${PKG_NAME}.spec

SUCCEED_CNT=$(($SUCCEED_CNT+1))
break
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Do not hardcode a fixed release value but align it with the
value used while tagging

0 comments on commit e82bee8

Please sign in to comment.