Implement prerequisites auto-update.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
+34
-4
@@ -14,11 +14,9 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FLAG_FILE="$1"
|
||||
PREREQUISITES_INSTALLED_LIST_FILE="$1"
|
||||
shift
|
||||
|
||||
rm -f $FLAG_FILE
|
||||
|
||||
if [ "$1" == "clean" ]
|
||||
then
|
||||
CLEAN_MODE=yes
|
||||
@@ -66,6 +64,14 @@ function setup_from_zip() {
|
||||
|
||||
FAIL_MSG="Failed to setup '$NAME' prerequisite"
|
||||
|
||||
if [ "$CLEAN_MODE" == "no" ]
|
||||
then
|
||||
echo "$CHECKSUM $NAME" >> $TMP_DIR/.prerequisites
|
||||
grep -q "^$CHECKSUM $NAME\$" $TMP_DIR/.prerequisites.prev && return 0
|
||||
|
||||
echo "Setting up $NAME prerequisite"
|
||||
fi
|
||||
|
||||
if [ -e "$DEST" ]
|
||||
then
|
||||
chmod -R u+w "$DEST" || fail_msg "$FAIL_MSG. Failed to add write permission to '$DEST' directory contents."
|
||||
@@ -108,6 +114,14 @@ function setup_cppcheck() {
|
||||
|
||||
FAIL_MSG="Failed to setup '$NAME' prerequisite"
|
||||
|
||||
if [ "$CLEAN_MODE" == "no" ]
|
||||
then
|
||||
echo "$CHECKSUM $NAME" >> $TMP_DIR/.prerequisites
|
||||
grep -q "^$CHECKSUM $NAME\$" $TMP_DIR/.prerequisites.prev && return 0
|
||||
|
||||
echo "Setting up $NAME prerequisite"
|
||||
fi
|
||||
|
||||
if [ -e "$DEST" ]
|
||||
then
|
||||
chmod -R u+w "$DEST" || fail_msg "$FAIL_MSG. Failed to add write permission to '$DEST' directory contents."
|
||||
@@ -155,6 +169,14 @@ function setup_vera() {
|
||||
|
||||
FAIL_MSG="Failed to setup '$NAME' prerequisite"
|
||||
|
||||
if [ "$CLEAN_MODE" == "no" ]
|
||||
then
|
||||
echo "$CHECKSUM $NAME" >> $TMP_DIR/.prerequisites
|
||||
grep -q "^$CHECKSUM $NAME\$" $TMP_DIR/.prerequisites.prev && return 0
|
||||
|
||||
echo "Setting up $NAME prerequisite"
|
||||
fi
|
||||
|
||||
if [ -e "$DEST" ]
|
||||
then
|
||||
chmod -R u+w "$DEST" || fail_msg "$FAIL_MSG. Failed to add write permission to '$DEST' directory contents."
|
||||
@@ -187,6 +209,14 @@ function setup_vera() {
|
||||
|
||||
TMP_DIR=`mktemp -d --tmpdir=./`
|
||||
|
||||
if [ "$CLEAN_MODE" == "yes" ]
|
||||
then
|
||||
rm -f $PREREQUISITES_INSTALLED_LIST_FILE
|
||||
else
|
||||
touch $PREREQUISITES_INSTALLED_LIST_FILE || fail_msg "Failed to create '$PREREQUISITES_INSTALLED_LIST_FILE'."
|
||||
mv $PREREQUISITES_INSTALLED_LIST_FILE $TMP_DIR/.prerequisites.prev
|
||||
fi
|
||||
|
||||
setup_from_zip "stm32f3" \
|
||||
"./third-party/STM32F3-Discovery_FW_V1.1.0" \
|
||||
"http://www.st.com/st-web-ui/static/active/en/st_prod_software_internet/resource/technical/software/firmware/stm32f3discovery_fw.zip" \
|
||||
@@ -211,7 +241,7 @@ setup_vera "vera++-1.2.1" \
|
||||
|
||||
if [ "$CLEAN_MODE" == "no" ]
|
||||
then
|
||||
touch $FLAG_FILE || fail_msg "Failed to create flag file '$FLAG_FILE'."
|
||||
mv $TMP_DIR/.prerequisites $PREREQUISITES_INSTALLED_LIST_FILE || fail_msg "Failed to write '$PREREQUISITES_INSTALLED_LIST_FILE'"
|
||||
fi
|
||||
|
||||
clean_on_exit "OK"
|
||||
|
||||
Reference in New Issue
Block a user