Skip to content

Commit e82bee8

Browse files
authored
Merge pull request #11 from deneb-alpha/do_not_hardcode_release_value
Do not hardcode a fixed release value but align it with the value used while tagging
2 parents 4d19c5a + fbb5ce3 commit e82bee8

2 files changed

+7
-2
lines changed

bin/build-packages-for-obs

+5-2
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ while read PKG_NAME PKG_VER PKG_DIR; do
152152
# Convert to obscpio
153153
SPEC_VER=$(sed -n -e 's/^Version:\s*\(.*\)/\1/p' ${T_DIR}/${PKG_NAME}.spec)
154154
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}/")
155+
SPEC_REL=$(sed -n -e 's/^Release: \+\([0-9]\).*/\1/p' ${T_DIR}/${PKG_NAME}.spec)
155156
# If the package does not have sources, we don't need to repackage them
156157
if [ "${SOURCE}" != "" ]; then
157158
FOLDER=$(tar -tf ${T_DIR}/${SOURCE}|head -1|sed -e 's/\///')
@@ -176,8 +177,10 @@ commit: $(git rev-parse --verify HEAD)
176177
EOF
177178
fi
178179
# Release is handled by the Buildservice
179-
# Remove everything what prevents us from submitting
180-
sed -i 's/^Release.*$/Release: 0/i' $SRPM_DIR/$PKG_NAME/*.spec
180+
# With untagged changes we can only build using --test with tito build.
181+
# tito build with --test appends the git hash to the release version and we do not want this.
182+
# Remove everything preventing us from submitting
183+
sed -i "s/^Release.*$/Release: ${SPEC_REL}/i" ${SRPM_DIR}/${PKG_NAME}/${PKG_NAME}.spec
181184

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

0 commit comments

Comments
 (0)