Commit 9bd7bf6c authored by Vitaly Lipatov's avatar Vitaly Lipatov

rpmbs/rpmlog/rpmgs: use version_to_tag for git tag names

parent a0c425d3
......@@ -122,19 +122,20 @@ LISTRPMARGS=$@
__gear_create_tag()
{
local GEARCTAG=gear-create-tag
local TAGNAME="$(version_to_tag "$VERSION-$RELEASE")"
if [ "$1" = "pipe" ] ; then
shift
if [ -n "$SETTAG" ] ; then
a= git tag $FORCE "$VERSION-$RELEASE" -m "$BASENAME $VERSION-$RELEASE" "$@" 2>&1
a= git tag $FORCE "$TAGNAME" -m "$BASENAME $VERSION-$RELEASE" "$@" 2>&1
return
fi
$GEARCTAG $FORCE -n "$VERSION-$RELEASE" -m "$BASENAME $VERSION-$RELEASE" "$@" 2>&1
$GEARCTAG $FORCE -n "$TAGNAME" -m "$BASENAME $VERSION-$RELEASE" "$@" 2>&1
else
if [ -n "$SETTAG" ] ; then
docmd git tag $FORCE "$VERSION-$RELEASE" -m "$BASENAME $VERSION-$RELEASE" "$@"
docmd git tag $FORCE "$TAGNAME" -m "$BASENAME $VERSION-$RELEASE" "$@"
return
fi
docmd $GEARCTAG $FORCE -n "$VERSION-$RELEASE" -m "$BASENAME $VERSION-$RELEASE" "$@"
docmd $GEARCTAG $FORCE -n "$TAGNAME" -m "$BASENAME $VERSION-$RELEASE" "$@"
fi
}
......
......@@ -382,10 +382,11 @@ get_tag_by_version()
fi
local i
local encoded="$(version_to_tag "$GSSETVERSION")"
alternate_tag1="$(echo "v$GSSETVERSION" | sed -e "s|\.|-|g")"
alternate_tag2="$(echo "REL_$GSSETVERSION" | sed -e "s|\.|_|g")"
alternate_tag3="$(echo "version_$GSSETVERSION")"
for i in v$GSSETVERSION $alternate_tag1 $GSSETVERSION $alternate_tag2 $alternate_tag3 ; do
for i in v$GSSETVERSION v$encoded $alternate_tag1 $GSSETVERSION $encoded $alternate_tag2 $alternate_tag3 ; do
git rev-parse $i >/dev/null 2>/dev/null && rc=0 && break
done
......
......@@ -138,8 +138,12 @@ if [ -z "$FROMTAG" ] ; then
build_rpms_name $SPECNAME
[ -n "$VERSION" ] || fatal "Can't get package version"
[ -n "$RELEASE" ] || fatal "Can't get package release"
FROMTAG="$VERSION-$RELEASE"
# FIXME: if don't exists, use last tag?
FROMTAG="$(version_to_tag "$VERSION-$RELEASE")"
# If tag doesn't exist, find the commit that introduced current version-release
if ! git rev-parse --verify "$FROMTAG" >/dev/null 2>&1 ; then
FROMTAG=$(git log --format=%H -1 -S "$VERSION-$RELEASE" -- "$SPECNAME")
[ -n "$FROMTAG" ] || fatal "Can't find tag or commit for $VERSION-$RELEASE"
fi
fi
if [ -z "$CHANGELOGADD" ] && is_last_commit_tag ; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment