Add '--install-deps' option to install missing dependencies 51/144151/5
authorDmitriy Nikiforov <d.nikiforov@partner.samsung.com>
Fri, 11 Aug 2017 12:55:57 +0000 (15:55 +0300)
committerDmitriy Nikiforov <d.nikiforov@partner.samsung.com>
Thu, 17 Aug 2017 12:12:08 +0000 (15:12 +0300)
Change-Id: I35417285861a79efaa5bb38a4af89833823e09c7

infra/commands/publish.sh

index 6ac688c..1fecd2e 100755 (executable)
@@ -16,6 +16,7 @@ Options:
   -A, --with-asan             Also, push the libasan package to device.
   -c, --corpus CORPUS_DIR     Also, push the seed corpus files to device
                               from the specified directory.
+  -i, --install-deps          Install missing dependencies.
   -r, --root                  Push target with root access rights.
   -s, --serial SERIAL_NUMBER  Send all sdb commands to device with specified
                               serial number.
@@ -26,6 +27,8 @@ EOF
 #               GLOBAL OPTIONS PARSING
 ########################################################
 
+INSTALL_DEPS=0
+
 while [[ ${1} = -* ]]; do
     case ${1} in
         '-h'|'--help')
@@ -40,6 +43,10 @@ while [[ ${1} = -* ]]; do
             CORPUS_DIR="${2}"
             shift 2
             ;;
+        '-i'|'--install-deps')
+            INSTALL_DEPS=1
+            shift
+            ;;
         '-r'|'--root')
             ROOT=1
             shift
@@ -92,6 +99,10 @@ if [[ -z ${ARCH} || ! -d ${TARGET_DIR}/${ARCH} ]]; then
     exit 1
 fi
 
+# check and install, if needed, necessary dependencies
+echo "Checking dependencies..."
+check_and_install_deps "${INSTALL_DEPS}" 'base' 'cpio'
+
 # push debug rpms
 printf "\nPushing debug rpm packages to device...\n"