Commit 459169ed authored by Vitaly Lipatov's avatar Vitaly Lipatov

use get_default_txtrelease where possible

parent 0efd493d
...@@ -194,8 +194,8 @@ do ...@@ -194,8 +194,8 @@ do
fi fi
# If non alt release, set initial alt release # If non alt release, set initial alt release
if get_release $i | grep -v "^alt" >/dev/null ; then if get_release $i | grep -q -v "^alt" && get_release $i | grep -q -v "^$(get_default_txtrelease)" ; then
set_release $i "alt1" reset_release $i
fi fi
# If it was PLD spec # If it was PLD spec
......
...@@ -243,7 +243,7 @@ do ...@@ -243,7 +243,7 @@ do
if [ -n "${spec/*spec/}" ] ; then if [ -n "${spec/*spec/}" ] ; then
print_error print_error
fi fi
set_specdir $spec set_specdir $spec
# Set version if needed # Set version if needed
...@@ -251,7 +251,7 @@ do ...@@ -251,7 +251,7 @@ do
CURVER=$(get_version $spec) CURVER=$(get_version $spec)
set_version $spec $GSSETVERSION set_version $spec $GSSETVERSION
if [ "$CURVER" != "$GSSETVERSION" ] ; then if [ "$CURVER" != "$GSSETVERSION" ] ; then
[ -n "$GSSETRELEASE" ] || GSSETRELEASE=alt1 [ -n "$GSSETRELEASE" ] || GSSETRELEASE=$(get_default_txtrelease)1
set_release $spec $GSSETRELEASE set_release $spec $GSSETRELEASE
echo "Set new $GSSETVERSION-$GSSETRELEASE version for $spec" echo "Set new $GSSETVERSION-$GSSETRELEASE version for $spec"
else else
......
...@@ -35,7 +35,7 @@ SPEC=$1 ...@@ -35,7 +35,7 @@ SPEC=$1
VER=$1 VER=$1
# need for rpmgs # need for rpmgs
GSSETRELEASE=$2 GSSETRELEASE=$2
test -n "$GSSETRELEASE" || GSSETRELEASE=alt1 test -n "$GSSETRELEASE" || GSSETRELEASE=$(get_default_txtrelease)1
export GSSETRELEASE export GSSETRELEASE
test -f "$SPEC" || SPEC=$(get_gear_spec) test -f "$SPEC" || SPEC=$(get_gear_spec)
......
...@@ -94,8 +94,9 @@ pkg_release_check() ...@@ -94,8 +94,9 @@ pkg_release_check()
{ {
# assert MENV # assert MENV
local STREL=$(get_default_txtrelease) local STREL=$(get_default_txtrelease)
# support alt in any case
local STRELDEF=alt local STRELDEF=alt
# FIXME: do we need it? # can be set from korinf config
[ -z "$KORINFTARGETRELEASE" ] || STREL=$KORINFTARGETRELEASE [ -z "$KORINFTARGETRELEASE" ] || STREL=$KORINFTARGETRELEASE
if [ "$MENV" = "SS" ] || [ "$MENV" = "DD" ] ; then if [ "$MENV" = "SS" ] || [ "$MENV" = "DD" ] ; then
......
...@@ -113,6 +113,6 @@ do ...@@ -113,6 +113,6 @@ do
done done
LISTBUILT=$(strip_spaces "$LISTBUILT") LISTBUILT=$(strip_spaces "$LISTBUILT")
test -z "$LISTBUILT" && fatal "Error: List for build is empty. Check if file is exist." test -z "$LISTBUILT" && fatal "Error: List for build is empty. Check if the file is exists."
} }
...@@ -33,7 +33,7 @@ get_etersoft_srpm_path() ...@@ -33,7 +33,7 @@ get_etersoft_srpm_path()
# translate ftp to local path # translate ftp to local path
SOURCE=$(echo "$SOURCEFTP" | sed -e "s|.*://.*$COMPANYFTP|$TARGETFTPBASE|g") SOURCE=$(echo "$SOURCEFTP" | sed -e "s|.*://.*$COMPANYFTP|$TARGETFTPBASE|g")
# rewrite V.E.R./sources with $ALPHA/sources if $ALPHA exist # rewrite V.E.R./sources with $ALPHA/sources if $ALPHA exists
if [ -n "$ALPHA" ] ; then if [ -n "$ALPHA" ] ; then
BSOURCE=$(dirname $SOURCE) BSOURCE=$(dirname $SOURCE)
BNSOURCE=$(basename $BSOURCE) BNSOURCE=$(basename $BSOURCE)
......
...@@ -76,9 +76,20 @@ set_var() ...@@ -76,9 +76,20 @@ set_var()
subst "s|\($2:\).*\$|\1 $3|" $1 subst "s|\($2:\).*\$|\1 $3|" $1
} }
# Args: spec, new_release
# set release to arg2 or reset numeration if arg2 is empty
set_release() set_release()
{ {
local RELEASE=$2 local RELEASE=$2
[ -n "$RELEASE" ] || RELEASE="$(get_txtrelease $1)1"
set_var $1 Release $RELEASE
}
# Args: spec, new_release
# Set release to arg2 or to the default start value if arg2 is empty
reset_release()
{
local RELEASE=$2
[ -n "$RELEASE" ] || RELEASE="$(get_default_txtrelease)1" [ -n "$RELEASE" ] || RELEASE="$(get_default_txtrelease)1"
set_var $1 Release $RELEASE set_var $1 Release $RELEASE
} }
......
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