Fix converting coretpk manifest 56/33556/1
authorSangyoon Jang <s89.jang@samsung.com>
Tue, 13 Jan 2015 07:44:33 +0000 (16:44 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Tue, 13 Jan 2015 07:44:33 +0000 (16:44 +0900)
convert exec path with user apps directory($HOME/apps_rw)

Change-Id: I9464bab6758b20775c3200ac5234e8db7c91d866
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
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 d4e430e..adfb125 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)) {