Commit b2ecd0b1 authored by Vitaly Lipatov's avatar Vitaly Lipatov

rpmgs: stop update version with macro except ver_major and major

parent 7e73e195
......@@ -805,8 +805,14 @@ fi
# Set version if needed
if [ -n "$GSSETVERSION" ] && [ "$GSSETVERSION" != "HEAD" ] ; then
CURVER=$(get_version $spec)
set_version $spec ${GSSETVERSION/-*/}
if [ "$CURVER" != "$GSSETVERSION" ] ; then
CURRAWVER=$(get_raw_version $spec)
if echo "$CURRAWVER" | grep -q "%" && echo "$CURRAWVER" | grep -v -E "^(%ver_major|%major)$" ; then
fatal "Can't override macros in Version field, check it manually. Only %ver_major and %major is supported"
fi
set_version $spec ${GSSETVERSION/-*/}
set_release $spec $GSSETRELEASE
if [ -n "$GSSETRELEASE" ] ; then
echo "Set new $GSSETVERSION-$GSSETRELEASE version for $spec"
......
......@@ -171,6 +171,11 @@ get_version()
eval_spec $1 | get_var "Version"
}
get_raw_version()
{
cat $1 | get_var "Version"
}
# Args: specname, source_number
get_tarballname()
{
......@@ -203,6 +208,7 @@ set_version()
VERMAJOR=
fi
# supports ver_major or major
MAJORMACROS=`grep "%define[[:space:]]\(\|ver_\)major[[:space:]]" $SPEC | sed -e "s|.*[[:space:]]\(.*major\).*|\1|"`
if [ -n "${MAJORMACROS}" ] ; then
# Change major define
......
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