Commit 87a2e3c5 authored by Vitaly Lipatov's avatar Vitaly Lipatov

add support for any p? system, do name translation more correctly

parent bc2b91de
...@@ -28,10 +28,12 @@ set_target_type() ...@@ -28,10 +28,12 @@ set_target_type()
return 1; return 1;
} }
# no output if not detected
get_type_by_git_branch_name() get_type_by_git_branch_name()
{ {
if [ "$1" = "p5" ] ; then # like p5
echo "M50" if echo $1 | grep -q "^p[0-9]$" ; then
get_altdistr_mod $1
return return
fi fi
...@@ -43,7 +45,7 @@ get_type_by_git_branch_name() ...@@ -43,7 +45,7 @@ get_type_by_git_branch_name()
# like M50 # like M50
if echo $1 | grep -q "^M[0-9][0-9]$" ; then if echo $1 | grep -q "^M[0-9][0-9]$" ; then
get_altdistr_mod ${1/^M/} echo $1
return return
fi fi
} }
...@@ -70,13 +72,13 @@ set_binaryrepo() ...@@ -70,13 +72,13 @@ set_binaryrepo()
# M50 -> 5.0 # M50 -> 5.0
get_altdistr_version() get_altdistr_version()
{ {
echo "$1" | sed -e "s|M50|p5|g" | sed -e "s|M\([0-9]\)\([0-9]\)|\1\.\2|g" | sed -e "s|SS|sisyphus|g" | sed -e "s|DD|daedalus|g" | sed -e "s|Sisyphus|sisyphus|g" echo "$1" | sed -e "s|M\([5-9]\)0|p\1|g" | sed -e "s|M\([0-9]\)\([0-9]\)|\1\.\2|g" | sed -e "s|SS|sisyphus|g" | sed -e "s|DD|daedalus|g" | sed -e "s|Sisyphus|sisyphus|g"
} }
# 5.0 -> M50 # 5.0 -> M50
get_altdistr_mod() get_altdistr_mod()
{ {
echo "$1" | sed -e "s|\([0-9]\)\.\([0-9]\)|M\1\2|g" | sed -e "s|Sisyphus|SS|g" | sed -e "s|sisyphus|SS|g" | sed -e "s|p5|M50|g" echo "$1" | sed -e "s|\([0-9]\)\.\([0-9]\)|M\1\2|g" | sed -e "s|Sisyphus|SS|gi" | sed -e "s|p\([5-9]\)|M\10|g"
} }
# TODO: include in sisyphus_check # TODO: include in sisyphus_check
......
...@@ -18,12 +18,17 @@ check_MOD() ...@@ -18,12 +18,17 @@ check_MOD()
check $1 $2 `get_altdistr_mod $1` check $1 $2 `get_altdistr_mod $1`
} }
check_GN()
{
check $1 $2 `get_type_by_git_branch_name $1`
}
echo "Check get_altdistr_version" echo "Check get_altdistr_version"
check_AD M40 4.0 check_AD M40 4.0
check_AD M30 3.0 check_AD M30 3.0
check_AD M41 4.1 check_AD M41 4.1
check_AD M50 5.0 check_AD M50 p5
check_AD M51 5.1
check_AD SS sisyphus check_AD SS sisyphus
echo "Check get_altdist_mod" echo "Check get_altdist_mod"
...@@ -32,4 +37,13 @@ check_MOD 3.0 M30 ...@@ -32,4 +37,13 @@ check_MOD 3.0 M30
check_MOD 4.0 M40 check_MOD 4.0 M40
check_MOD 4.1 M41 check_MOD 4.1 M41
check_MOD 5.0 M50 check_MOD 5.0 M50
check_MOD 5.1 M51
check_MOD p5 M50
check_MOD p6 M60
check_MOD Sisyphus SS check_MOD Sisyphus SS
check_MOD sisyphuS SS
check_GN M50 M50
check_GN 5.0 M50
check_GN p5 M50
check_GN p7 M70
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