Updated build and deploy scripts. 83/57983/1
authorEugene Kurzberg <i.kurtsberg@samsung.com>
Tue, 26 Jan 2016 13:47:38 +0000 (15:47 +0200)
committerEugene Kurzberg <i.kurtsberg@samsung.com>
Tue, 26 Jan 2016 13:48:17 +0000 (15:48 +0200)
Change-Id: Id99ffbd95a4b990fe19985c852df0a852f0a7de1
Signed-off-by: Eugene Kurzberg <i.kurtsberg@samsung.com>
build
deploy

diff --git a/build b/build
index 90986cb..de4f4af 100755 (executable)
--- a/build
+++ b/build
@@ -2,20 +2,21 @@
 
 usage()
 {
-    echo "Usage: `basename $0` [-h|--help] [-e|--emulator] | [-d|--device] [-2|--tizen2] | [-3|--tizen3] [-i|--init] [-t|--test]
+    echo "Usage: `basename $0` [-h|--help] [-e|--emulator] | [-d|--device] [--32] | [--64] [-i|--init] [-t|--test]
     -h, --help      Show this message.
-    -e, --emulator  Build for emulator (default).
-    -d, --device    Build for device.
-    -2, --tizen2    Build for Tizen 2.x (32-bit)
-    -3, --tizen3    Build for Tizen 3.0 (64-bit, default)
+    -e, --emulator  Build for emulator.
+    -d, --device    Build for device (default).
     -i, --init      Build online (without --noinit).
-    -t, --test      Build with tests."
+    -t, --test      Build with tests.
+
+        --32        Build 32-bit package (default).
+        --64        Build 64-bit package."
 }
 
-TARGET="e"
-TIZEN="3"
+TARGET="d"
+BIT="32"
 NOINIT="--noinit"
-OPTS=$(getopt -o "edith23" -l "emulator,device,tizen2,tizen3,init,test,help" -- "$@" 2> /dev/null)
+OPTS=$(getopt -o "edith" -l "emulator,device,32,64,init,test,help" -- "$@" 2> /dev/null)
 
 if [ $? -ne 0 ]
 then
@@ -32,11 +33,11 @@ do
         -d|--device)
         TARGET="d"
         ;;
-        -2|--tizen2)
-        TIZEN="2"
+        --32)
+        BIT="32"
         ;;
-        -3|--tizen3)
-        TIZEN="3"
+        --64)
+        BIT="64"
         ;;
         -i|--init)
         NOINIT=""
@@ -51,7 +52,7 @@ do
     esac
 done
 
-if [ $TIZEN = "2" ]
+if [ $BIT = "32" ]
 then
     if [ $TARGET = "e" ]
     then
diff --git a/deploy b/deploy
index 22edc8d..ce0f08e 100755 (executable)
--- a/deploy
+++ b/deploy
@@ -2,13 +2,14 @@
 
 usage()
 {
-    echo "Usage: `basename $0` [-h|--help] [-e|--emulator] [-d|--device]
+    echo "Usage: `basename $0` [-h|--help] [-e|--emulator] | [-d|--device] [-r|--rpm] [--32] | [--64]
     -h, --help      Show this message.
-    -e, --emulator  Install on emulator (default).
-    -d, --device    Install on device.
-    -2, --tizen2    Install on Tizen 2.x (32-bit)
-    -3, --tizen3    Install on Tizen 3.0 (64-bit, default)
-    -r, --rpm       Install packages via RPM."
+    -e, --emulator  Install on emulator.
+    -d, --device    Install on device (default).
+    -r, --rpm       Install packages via RPM.
+
+        --32        Install 32-bit package (default).
+        --64        Install 64-bit package."
 }
 
 DEVS=($(sdb devices | tail -n+2))
@@ -19,7 +20,7 @@ then
     exit 1
 fi
 
-OPTS=$(getopt -o "hedr23" -l "help,emulator,tizen2,tizen3,device,rpm" -- "$@" 2> /dev/null)
+OPTS=$(getopt -o "hedr" -l "help,emulator,32,64,device,rpm" -- "$@" 2> /dev/null)
 
 if [ $? -ne 0 ]
 then
@@ -27,8 +28,8 @@ then
     exit 1
 fi
 
-TARGET="e"
-TIZEN="3"
+TARGET="d"
+BIT="32"
 
 for opt in $OPTS
 do
@@ -39,11 +40,11 @@ do
         -d|--device)
         TARGET="d"
         ;;
-        -2|--tizen2)
-        TIZEN="2"
+        --32)
+        BIT="32"
         ;;
-        -3|--tizen3)
-        TIZEN="3"
+        --64)
+        BIT="64"
         ;;
         -h|--help)
         usage
@@ -55,7 +56,7 @@ do
     esac
 done
 
-if [ $TIZEN = "2" ]
+if [ $BIT = "32" ]
 then
     if [ $TARGET = "e" ]
     then
@@ -101,11 +102,10 @@ install()
 {
     echo "Installing $2..."
 
-    if [ $RPM ]
+    if [ $3 ]
     then
         sdb -$TARGET root on
         sdb -$TARGET shell rpm -i --force "$1/$2"
-        sdb -$TARGET shell pkg_initdb
         sdb -$TARGET root off
     else
         sdb -$TARGET shell pkgcmd -iqt rpm -p "$1/$2"
@@ -115,7 +115,7 @@ install()
 deploy()
 {
     push "$1" "$2"
-    install "$2" "$1"
+    install "$2" "$1" "$3"
     sdb -$TARGET shell rm "$2/$1" > /dev/null
 }
 
@@ -129,7 +129,8 @@ PKGS=($(grep %package packaging/*.spec | awk '{print $3}'))
 
 if [ -z $PKGS ]
 then
-    deploy "$PKG-$SUFFIX" "$DEST"
+    deploy "$PKG-$SUFFIX" "$DEST" "$RPM"
+    deploy "$PKG-debuginfo-$SUFFIX" "$DEST" true
 else
     echo "Current package contains several sub-packages:"
     PKGS=($PKG ${PKGS[*]})
@@ -143,7 +144,8 @@ else
 
     for i in $NUMS
     do
-        deploy "${PKGS[$((i - 1))]}-$SUFFIX" "$DEST"
+        deploy "${PKGS[$((i - 1))]}-$SUFFIX" "$DEST" "$RPM"
+        deploy "${PKGS[$((i - 1))]}-debuginfo-$SUFFIX" "$DEST" true
     done
 fi
 echo "Done."