osmo-release.sh: support epoch

Related: OS#5046
Change-Id: I5d9d18d7cc84f185222ee176e6546bb3553a3598
This commit is contained in:
Oliver Smith 2021-02-26 08:38:20 +01:00
parent e75fa1e2ec
commit b76811b1da
1 changed files with 18 additions and 1 deletions

View File

@ -247,7 +247,24 @@ if [ -f "TODO-RELEASE" ]; then
git add TODO-RELEASE
fi
gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge --ignore-branch --new-version="$NEW_VER"
# Add missing epoch (OS#5046)
DEB_VER=$(head -1 debian/changelog | cut -d ' ' -f 2 | sed 's,(,,' | sed 's,),,')
NEW_VER_WITH_EPOCH="$NEW_VER"
case "$DEB_VER" in
*:*)
epoch="$(echo "$DEB_VER" | cut -d: -f1)"
NEW_VER_WITH_EPOCH="$epoch:$NEW_VER"
;;
esac
gbp dch \
--debian-tag='%(version)s' \
--auto \
--meta \
--git-author \
--multimaint-merge \
--ignore-branch \
--new-version="$NEW_VER_WITH_EPOCH"
dch -r -m --distribution "unstable" ""
git add ${GIT_TOPDIR}/debian/changelog
bumpversion --current-version $VERSION $REL --tag --commit --tag-name $NEW_VER --allow-dirty