[$# -eq"0"]&&SETUP_FAIRSOFT=1 &&SETUP_FAIRROOT=1 &&SETUP_CBMROOT=1 : echo"Some Error has occurred"# Default behaviour with no flags, all three should be installed.
while test$# -gt 0;do
case"$1"in
-y|-yes|--yes)
echo"Will update environment to new build after installation"
ANSWER="YES";
shift;;
-n|-no|--no)
echo"In case someone wants to put in script."
ANSWER="NO";
shift;;
-fs|-s|-fairsof|--fairsoft)
echo"*** FAIRSOFT to be installed"
SETUP_FAIRSOFT="1";
shift;;
-fr|-r|-fairroot|--fairroot)
echo"*** FAIRROOT to be installed"
SETUP_FAIRROOT="1";
shift;;
-cr|-c|-cbmroot|--cbmroot)
echo"*** CBMROOT to be installed"
SETUP_CBMROOT="1";
shift;;
-d|--dev|-dev|dev)
echo"*** DEV VERSION specified"
export FSOFTVER=$FSOFTDEV
export FROOTVER=$FROOTDEV
shift;;
-o|--old|-old|old)
echo"*** OLD VERSION specified"
export FSOFTVER=$FSOFTOLD
export FROOTVER=$FROOTOLD
shift;;
0|1)
# This unusual addition is to continue to provide back compatiability with previous versions of autoinstall_framework.
# It is important to keep this in case someone has hardcoded installation instructions somewhere and thus this should avoid breaking his program.
# In particular the old behaviour except 1, 2, or 3 numerical arguments whereby
# argument 1 greater or equal to 1 would install FAIR SOFT
# argument 2 greater or equal to 1 would install FAIR ROOT
# argument 3 greater or equal to 1 would install CBM ROOT
# ergo
# ./autobuild_framework dev 1 0 0
# would install FAIR SOFT but not FAIR ROOT nor CBM ROOT.
if[$1-gt 0 ];
then
SETUP_FAIRSOFT="1";
echo"FAIR SOFT flaged for install"
fi
if[!-z$2];# This combersome and longform if statement exist due to known issues regarding ampersands within bash cases.
then
if[$2-gt 0 ];
then
SETUP_FAIRROOT="1";
echo"FAIR ROOT flaged for install"
fi
fi
if[!-z$3];# This combersome and longform if statement exist due to known issues regarding ampersands within bash cases.
then
if[$3-gt 0 ];
then
SETUP_CBMROOT="1";
echo"CBMROOT flaged for install"
fi
fi
# To prevent the pausing a script with maybe autoinstall_framework called the old way.
ANSWER="NO";
break;;
-h|-help|--help|*)
echo"Autoinstall_framework will install FairSoft, FairSoft, and CbmRoot packages"
echo"If no flags are specified, the program will install all three"
echo"otherwise the user may specify one or more to by calling the corresponding flags"
echo"-h, --help shows this brief help"
echo"-d, --dev Runs with dev"
echo"-o, --old Runs a old version"
echo"-fs, --fairsoft Installation of FairSoft"
echo"-fr, --fairroot Installation of FairRoot"
echo"-cr, --cbmroot Installation of CbmRoot"
echo"-y, --yes Automatically uses new envirnoment configuration post installation"
echo"-n, --no Answers No to automatic environment update"
echo""
echo"Example case to install only FairRoot and CbmRoot (and not FairSoft)"
echo"./autoinstall_framework.sh -fr -cr"
exit 0;;
esac
done
# My experience tells me that the default could be 2, even if there is only 1 processor, as 1 processing and 1 queued job normally is optimal Will leave it at 1 though.