Commit ce0a2d68 authored by Vitaly Lipatov's avatar Vitaly Lipatov

add support for run rpmgs spec new_version (fix altbug #14397)

parent 04dc61cc
...@@ -21,7 +21,7 @@ GETSOURCE="" ...@@ -21,7 +21,7 @@ GETSOURCE=""
LOADLIST="0" LOADLIST="0"
############################# #############################
Usage="Usage: $name [-a -r ] spec..." Usage="Usage: $name [-a -r ] spec ... | spec new_version"
function mygetopts() function mygetopts()
{ {
name=${0##*/} name=${0##*/}
...@@ -31,6 +31,7 @@ phelp() ...@@ -31,6 +31,7 @@ phelp()
{ {
echog "$Descr" echog "$Descr"
echog "$Usage" echog "$Usage"
echog "You can run rpmgs file.spec new_version for set new version and download it"
echog "Options:" echog "Options:"
echog " -a - get all source (not only 0)" echog " -a - get all source (not only 0)"
echog " -f - force download (remove source before download)" echog " -f - force download (remove source before download)"
...@@ -172,7 +173,21 @@ function print_error() ...@@ -172,7 +173,21 @@ function print_error()
parse_cmd_pre "$@" parse_cmd_pre "$@"
mygetopts $LISTARGS mygetopts $LISTARGS
#echo $LISTNAMES @ $LISTARGS test -z "$VERBOSE" || echo "'$LISTNAMES' @ '$LISTARGS'"
if [ -n "$LISTARGS" ] ; then
if [ -z "${LISTARGS/*spec/}" ] ; then
fatal "run with incorrect filename $LISTARGS"
fi
if [ -f "$LISTNAMES" ] ; then
fatal "set version permitted only for one file"
fi
if [ "${LISTARGS/ /}" != "$LISTARGS" ] ; then
fatal "you run rpmgs with more than one version"
fi
GSSETVERSION=$LISTARGS
fi
test -z "$LISTNAMES" && print_error test -z "$LISTNAMES" && print_error
for i in $LISTNAMES for i in $LISTNAMES
...@@ -180,6 +195,19 @@ do ...@@ -180,6 +195,19 @@ do
if [ -n "${i/*spec/}" ] ; then if [ -n "${i/*spec/}" ] ; then
print_error print_error
fi fi
# Set version if needed
if [ -n "$GSSETVERSION" ] ; then
CURVER=$(get_version $i)
set_version $i $GSSETVERSION
if [ "$CURVER" != "$GSSETVERSION" ] ; then
REL=alt1
set_release $i $REL
echo "Set new $GSSETVERSION-$REL version for $i"
else
echo "Version $GSSETVERSION already set"
fi
fi
for nn in "" $LOADLIST for nn in "" $LOADLIST
do do
...@@ -203,6 +231,7 @@ do ...@@ -203,6 +231,7 @@ do
fi fi
echo "DONE" echo "DONE"
popd popd
# VERSION we get after build_rpms_name
add_changelog_helper "- new version ($VERSION)" $i add_changelog_helper "- new version ($VERSION)" $i
done done
done done
......
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