Skip to content
Snippets Groups Projects
Commit 76db00fb authored by Sebastien Masson's avatar Sebastien Masson
Browse files

improve the robustness of -n/r/a options in makenemo, #68

parent 4dbfc9bb
No related branches found
No related tags found
No related merge requests found
...@@ -223,11 +223,23 @@ done ...@@ -223,11 +223,23 @@ done
if [ -n "$x_name" ] # is the configuration existing in cfgs or tests? or is it a new conf? if [ -n "$x_name" ] # is the configuration existing in cfgs or tests? or is it a new conf?
then then
incfg=$( find $CFGS_DIR -type d -name $x_name | wc -l ) # this configuration exists in CFGS_DIR incfg=$( find $CFGS_DIR -type d -name $x_name | wc -l ) # this configuration exists in CFGS_DIR
intst=$( find $TESTS_DIR -type d -name $x_name | wc -l ) # this configuration exists in TESTS_DIR intst=$( find $TESTS_DIR -type d -name $x_name | wc -l ) # this configuration exists in TESTS_DIR
[[ $incfg -eq 0 && $intst -eq 0 ]] && x_n=$x_name # this is a new configuration -> dedine/overwrite x_n if [ $(( $incfg + $intst )) -eq 2 ] ; then
[[ $incfg -eq 1 && -z "$x_r" ]] && x_r=$x_name # this is a reference configuration -> dedine/overwrite x_r echo -e "\033[0;31m\nERROR: the $x_name directory is found twice: in $CFGS_DIR and in $TESTS_DIR\033[0m\n"
[[ $intst -eq 1 && -z "$x_a" ]] && x_a=$x_name # this is a test configuration -> dedine/overwrite x_a exit 4
fi
if [ $(( $incfg + $intst )) -gt 0 ] ; then
[ -n "$x_r" ] && echo -e "\nWARNING: $x_name configuration is already existing, we ignore \"-r $x_r\"\n"
[ -n "$x_a" ] && echo -e "\nWARNING: $x_name configuration is already existing, we ignore \"-a $x_a\"\n"
fi
if [ $incfg -eq 1 ] ; then
x_r=$x_name ; x_a='' # reference configuration existing -> define/overwrite x_r
elif [ $intst -eq 1 ] ; then
x_a=$x_name ; x_r='' # test configuration existing -> define/overwrite x_a
else
x_n=$x_name # this is a new configuration -> define
fi
fi fi
export NEW_CONF=${x_n} export NEW_CONF=${x_n}
......
...@@ -166,7 +166,7 @@ if [ $# -gt 0 ]; then ...@@ -166,7 +166,7 @@ if [ $# -gt 0 ]; then
echo ' for SETTE-built configurations (needed if sette.sh invocations may overlap)' echo ' for SETTE-built configurations (needed if sette.sh invocations may overlap)'
echo '-r to execute without waiting to run sette_rpt.sh at the end (useful for chaining sette.sh invocations)' echo '-r to execute without waiting to run sette_rpt.sh at the end (useful for chaining sette.sh invocations)'
echo '-y to perform a dryrun to simply report what settings will be used' echo '-y to perform a dryrun to simply report what settings will be used'
echo '-d to compile Nemo with debug options (only if %DEBUG_FCFLAGS if defined in your arch file)' echo '-b to compile Nemo with debug options (only if %DEBUG_FCFLAGS if defined in your arch file)'
echo '-c to clean each configuration' echo '-c to clean each configuration'
echo '-s to synchronise the sette MY_SRC and EXP00 with the reference MY_SRC and EXPREF' echo '-s to synchronise the sette MY_SRC and EXP00 with the reference MY_SRC and EXPREF'
echo '-u to run sette.sh without any user interaction. This means no checks on creating' echo '-u to run sette.sh without any user interaction. This means no checks on creating'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment