NOERROR=0
SUMMARY_GENERATION=$ERROR
SINGLE_MOD_EXEC=$SUCCESS
+GTESTRPM=gtest-[0-9]*.armv7l.rpm
CONFIG_FILE="$PWD/Res/Config.txt"
PATH_FILE="$PWD/Res/Paths.txt"
exit 1
fi
- WRONGFILEFAIL=0
-
- wget --spider --user=$SPIN_GIT_USER --password=$SPIN_GIT_PASSWORD $SPIN_GIT_URL$GTESTRPM 2>$EXECUTE_LOG/$GIT_DOWN_CHECK_FILE
- WRONGFILEFAIL=`cat $EXECUTE_LOG/$GIT_DOWN_CHECK_FILE | grep "404 Not Found" | wc -l`
-
- if [ $WRONGFILEFAIL != $NOERROR ]; then
- cat $EXECUTE_LOG/$GIT_DOWN_CHECK_FILE >> $EXECUTE_LOG/$EXEC_ERROR_FILE
- echo "[ERROR] $GTESTRPM is not matching with the version present at server [Update GTESTRPM in Res/Config.txt file and run again]." | tee -a $EXECUTE_LOG/$EXEC_ERROR_FILE
- echo "Execution not initiated and Summary report will not be generated." | tee -a $EXECUTE_LOG/$EXEC_ERROR_FILE
- if [ -f $EXECUTE_LOG/$GIT_DOWN_CHECK_FILE ]; then
- rm -rf $EXECUTE_LOG/$GIT_DOWN_CHECK_FILE
- fi
-
- exit 1
-
- else
- if [ -d $GTEST_DIR ]
- then
- cd $GTEST_DIR
+ if [ -d $GTEST_DIR ]
+ then
+ cd $GTEST_DIR
- wget -nd --user=$SPIN_GIT_USER --password=$SPIN_GIT_PASSWORD $SPIN_GIT_URL$GTESTRPM 2>$EXECUTE_LOG/$GIT_DOWN_CHECK_FILE
- echo "$GTESTRPM Downloaded successfully."
+ wget -nd --user=$SPIN_GIT_USER --password=$SPIN_GIT_PASSWORD -A $GTESTRPM -r -l 1 -nd $SPIN_GIT_URL 2>$EXECUTE_LOG/$GIT_DOWN_CHECK_FILE
+ num_rpms=`ls $GTEST_DIR | wc -l`
+ if [ "$num_rpms" = "1" ]; then
+ echo "GTEST RPM Downloaded successfully."
else
- Help_Usage
nRet=$ERROR
fi
+ else
+ nRet=$ERROR
fi
if [ -f $EXECUTE_LOG/$GIT_DOWN_CHECK_FILE ]; then
{
mkdir -p $EXECUTE_LOG
- if [ -z "$GTESTRPM" ]
- then
- echo "Authentication fail." | tee -a $EXECUTE_LOG/$EXEC_ERROR_FILE
- echo "/**********************************************************************************************/"
- echo " Check Res/Config.txt and update GTESTRPM with correct credentials " | tee -a $EXECUTE_LOG/$EXEC_ERROR_FILE
- echo " with correct credentials and configuration to download module RPM." | tee -a $EXECUTE_LOG/$EXEC_ERROR_FILE
- echo "/**********************************************************************************************/"
- echo "[ERROR] Downloading $GTEST RPM failed." | tee -a $EXECUTE_LOG/$EXEC_ERROR_FILE
- echo "Execution not initiated and Summary report will not be generated." | tee -a $EXECUTE_LOG/$EXEC_ERROR_FILE
- exit 1
- fi
-
if [ -d $RPM_DIR ]
then
Check_Pkg_Name $1
Download_GTEST
if [ $? -eq $ERROR ]
then
- echo "Error in downloading $GTESTRPM." | tee -a $EXECUTE_LOG/$EXEC_ERROR_FILE
+ echo "Error in downloading GTEST RPM." | tee -a $EXECUTE_LOG/$EXEC_ERROR_FILE
return $ERROR
fi