Merge "Fix coretpk upgrade" into tizen accepted/tizen_common accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable accepted/tizen/common/20150609.084418 accepted/tizen/mobile/20150121.045015 accepted/tizen/tv/20150121.044515 accepted/tizen/wearable/20150121.044748 submit/tizen/20150120.043506 submit/tizen/20150304.022845 submit/tizen_common/20150226.010729 submit/tizen_common/20150608.135929 submit/tizen_mobile/20150121.020049 submit/tizen_tv/20150121.020041 submit/tizen_wearable/20150121.020025
authorSuchang Woo <suchang.woo@samsung.com>
Wed, 14 Jan 2015 08:42:18 +0000 (00:42 -0800)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Wed, 14 Jan 2015 08:42:18 +0000 (00:42 -0800)
backend/scripts/coretpk_rw_xml_converter.sh.in
backend/src/coretpk/coretpk-installer.c
backend/src/coretpk/xml-parser/coretpk-parser-hybrid.c

index f34d958..6599be8 100644 (file)
@@ -2,7 +2,8 @@
 INPUT=$1
 OUTPUT=$2
 PKGID=$3
-CLIENTID=$4
+USRAPPDIR=$4
+CLIENTID=$5
 INSTALLLOCATION=0
 
 if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]
@@ -29,13 +30,13 @@ then
                if [ $INSTALLLOCATION -eq 1 ]
                then
                        /bin/sed        -e      "s#<icon>#<icon>/opt/usr/apps/$PKGID/shared/res/#g" \
-                                               -e      "s#exec=\"#exec=\"/opt/usr/apps/$PKGID/bin/#g" \
+                                               -e      "s#exec=\"#exec=\"$USRAPPDIR/$PKGID/bin/#g" \
                                                -e "/<feature.*>/ d" -e "/<feature /,/<\/feature>/ d" \
                                                -e      "s#\(<manifest[^>]*\)>#\1 storeclient-id=\"$CLIENTID\">#" \
                                                -e "s#package=\"#type=\"coretpk\" package=\"#g" $INPUT > $OUTPUT
                else
                        /bin/sed        -e      "s#<icon>#<icon>/opt/usr/apps/$PKGID/shared/res/#g" \
-                                               -e      "s#exec=\"#exec=\"/opt/usr/apps/$PKGID/bin/#g" \
+                                               -e      "s#exec=\"#exec=\"$USRAPPDIR/$PKGID/bin/#g" \
                                                -e "/<feature.*>/ d" -e "/<feature /,/<\/feature>/ d" \
                                                -e "s#\(<manifest[^>]*\)>#\1 install-location=\"internal-only\">#" \
                                                -e      "s#\(<manifest[^>]*\)>#\1 storeclient-id=\"$CLIENTID\">#" \
@@ -45,13 +46,13 @@ then
                if [ $INSTALLLOCATION -eq 1 ]
                then
                        /bin/sed        -e      "s#<icon>#<icon>/opt/usr/apps/$PKGID/shared/res/#g" \
-                                               -e      "s#exec=\"#exec=\"/opt/usr/apps/$PKGID/bin/#g" \
+                                               -e      "s#exec=\"#exec=\"$USRAPPDIR/$PKGID/bin/#g" \
                                                -e "/<feature.*>/ d" -e "/<feature /,/<\/feature>/ d" \
                                                -e      "s#\(<manifest[^>]*\)>#\1 storeclient-id=\"$CLIENTID\">#" \
                                                -e "s#package=\"#type=\"coretpk\" package=\"#g" $INPUT > $OUTPUT
                else
                        /bin/sed        -e      "s#<icon>#<icon>/opt/usr/apps/$PKGID/shared/res/#g" \
-                                               -e      "s#exec=\"#exec=\"/opt/usr/apps/$PKGID/bin/#g" \
+                                               -e      "s#exec=\"#exec=\"$USRAPPDIR/$PKGID/bin/#g" \
                                                -e "/<feature.*>/ d" -e "/<feature /,/<\/feature>/ d" \
                                                -e "s#\(<manifest[^>]*\)>#\1 install-location=\"auto\">#" \
                                                -e      "s#\(<manifest[^>]*\)>#\1 storeclient-id=\"$CLIENTID\">#" \
@@ -65,11 +66,11 @@ else
                then
                        /bin/sed        -e      "s#<icon>#<icon>/opt/usr/apps/$PKGID/shared/res/#g" \
                                                -e "/<feature.*>/ d" -e "/<feature /,/<\/feature>/ d" \
-                                               -e      "s#exec=\"#exec=\"/opt/usr/apps/$PKGID/bin/#g" \
+                                               -e      "s#exec=\"#exec=\"$USRAPPDIR/$PKGID/bin/#g" \
                                                -e "s#package=\"#type=\"coretpk\" package=\"#g" $INPUT > $OUTPUT
                else
                        /bin/sed        -e      "s#<icon>#<icon>/opt/usr/apps/$PKGID/shared/res/#g" \
-                                               -e      "s#exec=\"#exec=\"/opt/usr/apps/$PKGID/bin/#g" \
+                                               -e      "s#exec=\"#exec=\"$USRAPPDIR/$PKGID/bin/#g" \
                                                -e "/<feature.*>/ d" -e "/<feature /,/<\/feature>/ d" \
                                                -e "s#\(<manifest[^>]*\)>#\1 install-location=\"internal-only\">#" \
                                                -e "s#package=\"#type=\"coretpk\" package=\"#g" $INPUT > $OUTPUT
@@ -79,11 +80,11 @@ else
                then
                        /bin/sed        -e      "s#<icon>#<icon>/opt/usr/apps/$PKGID/shared/res/#g" \
                                                -e "/<feature.*>/ d" -e "/<feature /,/<\/feature>/ d" \
-                                               -e      "s#exec=\"#exec=\"/opt/usr/apps/$PKGID/bin/#g" \
+                                               -e      "s#exec=\"#exec=\"$USRAPPDIR/$PKGID/bin/#g" \
                                                -e "s#package=\"#type=\"coretpk\" package=\"#g" $INPUT > $OUTPUT
                else
                        /bin/sed        -e      "s#<icon>#<icon>/opt/usr/apps/$PKGID/shared/res/#g" \
-                                               -e      "s#exec=\"#exec=\"/opt/usr/apps/$PKGID/bin/#g" \
+                                               -e      "s#exec=\"#exec=\"$USRAPPDIR/$PKGID/bin/#g" \
                                                -e "/<feature.*>/ d" -e "/<feature /,/<\/feature>/ d" \
                                                -e "s#\(<manifest[^>]*\)>#\1 install-location=\"auto\">#" \
                                                -e "s#package=\"#type=\"coretpk\" package=\"#g" $INPUT > $OUTPUT
index 8e5f3b2..277329b 100755 (executable)
@@ -1036,7 +1036,7 @@ int _coretpk_installer_convert_manifest(char *manifestfilepath, char *pkgid, cha
        /*run script*/
        if (strstr(manifestfilepath, OPT_USR_APPS)) {
                snprintf(rwmanifest, BUF_SIZE, "%s/%s.xml", OPT_SHARE_PACKAGES, pkgid);
-               const char *rw_xml_argv[] = { CORETPK_RW_XML_CONVERTER, manifestfilepath, rwmanifest, pkgid, clientid, NULL };
+               const char *rw_xml_argv[] = { CORETPK_RW_XML_CONVERTER, manifestfilepath, rwmanifest, pkgid, OPT_USR_APPS, clientid, NULL };
                ret = _ri_xsystem(rw_xml_argv);
        } else {
                snprintf(rwmanifest, BUF_SIZE, "%s/%s.xml", USR_SHARE_PACKAGES, pkgid);
index ff01c69..c033441 100755 (executable)
@@ -540,7 +540,7 @@ int _coretpk_installer_hybrid_convert_manifest(char *manifest, const char* pkgid
        snprintf(outputxml, BUF_SIZE, "%s/%s", TEMP_XML_DIR, CORETPK_XML);
        _LOGD("input xml = [%s], out xml = [%s]", manifest, outputxml);
 
-       const char *unzip_argv_rw[] = { CORETPK_RW_XML_CONVERTER, manifest, outputxml, pkgid, NULL, NULL };
+       const char *unzip_argv_rw[] = { CORETPK_RW_XML_CONVERTER, manifest, outputxml, pkgid, OPT_USR_APPS, NULL, NULL };
        const char *unzip_argv_ro[] = { CORETPK_RO_XML_CONVERTER, manifest, outputxml, pkgid, NULL, NULL };
 
        if (strstr(manifest, OPT_USR_APPS)) {