RTSDK: fix a build script bug about mkdir
authorJaeMin Kim <jm.jemin.kim@samsung.com>
Tue, 14 Mar 2017 06:25:54 +0000 (15:25 +0900)
committerJaeMin Kim <jm.jemin.kim@samsung.com>
Tue, 14 Mar 2017 07:35:28 +0000 (16:35 +0900)
Unlike the local test environment, DIBS generates an error if there are
no exception statements.

Change-Id: I179bb7a4e7ff008c221ddd1b4468fc3fbee48721
Signed-off-by: JaeMin Kim <jm.jemin.kim@samsung.com>
package/build.linux

index 155fc29..419ea0f 100755 (executable)
@@ -92,14 +92,31 @@ install() {
         mv ${SRCDIR}/rt-ide/tizen.rt.product/target/products/org.tizen.rt.ide/linux/gtk/x86/* ${INSTALL_DIR}
         mv "${SRCDIR}/package/addingFiles/TizenStudioRT.sh" ${INSTALL_DIR}/rt-ide/
         mv ${SRCDIR}/package/addingFiles/resources ${INSTALL_DIR}/rt-ide/
-        
-               mkdir ${INSTALL_DIR}/platforms
-               mkdir ${INSTALL_DIR}/platforms/tizen-rt
-               cp -rf ${ROOTDIR}/resources/templates ${INSTALL_DIR}/platforms/tizen-rt
-               
+
+               if [ ! -d "${INSTALL_DIR}/platforms" ]; then
+               mkdir ${INSTALL_DIR}/platforms
+                       echo 'created ${INSTALL_DIR}/platforms'
+               fi
+
+               if [ ! -d "${INSTALL_DIR}/platforms/tizen-rt" ]; then
+               mkdir ${INSTALL_DIR}/platforms/tizen-rt
+                       echo 'created ${INSTALL_DIR}/platforms/tizen-rt'
+               fi
+
+               if [ -d "${ROOTDIR}/resources/templates" ]; then
+                       cp -rf ${ROOTDIR}/resources/templates ${INSTALL_DIR}/platforms/tizen-rt/
+                       echo 'copied ${ROOTDIR}/resources/templates to ${INSTALL_DIR}/platforms/tizen-rt/'
+               fi
+
                cp -rf ${SRCDIR}/lib/plugins/* ${INSTALL_DIR}/rt-ide/plugins/
-               mkdir ${INSTALL_DIR}/tools
+
+               if [ ! -d "${INSTALL_DIR}/tools" ]; then
+               mkdir ${INSTALL_DIR}/tools
+                       echo 'created ${INSTALL_DIR}/tools'
+               fi
+
                cp -rf ${SRCDIR}/tools/*.tar ${INSTALL_DIR}/tools/
+
                cd ${INSTALL_DIR}/tools
                find . -name '*.tar' -exec tar xf {} \;
                cd -
@@ -110,18 +127,34 @@ install() {
         mv ${SRCDIR}/rt-ide/tizen.rt.product/target/products/org.tizen.rt.ide/linux/gtk/x86_64/* ${INSTALL_DIR}
         mv "${SRCDIR}/package/addingFiles/TizenStudioRT.sh" ${INSTALL_DIR}/rt-ide/
         mv ${SRCDIR}/package/addingFiles/resources ${INSTALL_DIR}/rt-ide/
-        
-               mkdir ${INSTALL_DIR}/platforms
-               mkdir ${INSTALL_DIR}/platforms/tizen-rt
-               cp -rf ${ROOTDIR}/resources/templates ${INSTALL_DIR}/platforms/tizen-rt
-               
-        cp -rf ${SRCDIR}/lib/plugins/* ${INSTALL_DIR}/rt-ide/plugins/
-               mkdir ${INSTALL_DIR}/tools
+
+               if [ ! -d "${INSTALL_DIR}/platforms" ]; then
+               mkdir ${INSTALL_DIR}/platforms
+                       echo 'created ${INSTALL_DIR}/platforms'
+               fi
+
+               if [ ! -d "${INSTALL_DIR}/platforms/tizen-rt" ]; then
+               mkdir ${INSTALL_DIR}/platforms/tizen-rt
+                       echo 'created ${INSTALL_DIR}/platforms/tizen-rt'
+               fi
+
+               if [ -d "${ROOTDIR}/resources/templates" ]; then
+                       cp -rf ${ROOTDIR}/resources/templates ${INSTALL_DIR}/platforms/tizen-rt/
+                       echo 'copied ${ROOTDIR}/resources/templates to ${INSTALL_DIR}/platforms/tizen-rt/'
+               fi
+
+               cp -rf ${SRCDIR}/lib/plugins/* ${INSTALL_DIR}/rt-ide/plugins/
+
+               if [ ! -d "${INSTALL_DIR}/tools" ]; then
+               mkdir ${INSTALL_DIR}/tools
+                       echo 'created ${INSTALL_DIR}/tools'
+               fi
+
                cp -rf ${SRCDIR}/tools/*.tar ${INSTALL_DIR}/tools/
+
                cd ${INSTALL_DIR}/tools
                find . -name '*.tar' -exec tar xf {} \;
                cd -
-               
         # remove console executable
         rm -rf ${INSTALL_DIR}/rt-ide/launcher
         ;;