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
-d|--device)
TARGET="d"
;;
- -2|--tizen2)
- TIZEN="2"
+ --32)
+ BIT="32"
;;
- -3|--tizen3)
- TIZEN="3"
+ --64)
+ BIT="64"
;;
-i|--init)
NOINIT=""
esac
done
-if [ $TIZEN = "2" ]
+if [ $BIT = "32" ]
then
if [ $TARGET = "e" ]
then
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))
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
exit 1
fi
-TARGET="e"
-TIZEN="3"
+TARGET="d"
+BIT="32"
for opt in $OPTS
do
-d|--device)
TARGET="d"
;;
- -2|--tizen2)
- TIZEN="2"
+ --32)
+ BIT="32"
;;
- -3|--tizen3)
- TIZEN="3"
+ --64)
+ BIT="64"
;;
-h|--help)
usage
esac
done
-if [ $TIZEN = "2" ]
+if [ $BIT = "32" ]
then
if [ $TARGET = "e" ]
then
{
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"
deploy()
{
push "$1" "$2"
- install "$2" "$1"
+ install "$2" "$1" "$3"
sdb -$TARGET shell rm "$2/$1" > /dev/null
}
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[*]})
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."