From f4bff4486a8d806db5468d6deb254f5f1acfccd9 Mon Sep 17 00:00:00 2001 From: Sangyoon Jang Date: Tue, 13 Jan 2015 16:44:33 +0900 Subject: [PATCH] Fix converting coretpk manifest convert exec path with user apps directory($HOME/apps_rw) Change-Id: I9464bab6758b20775c3200ac5234e8db7c91d866 Signed-off-by: Sangyoon Jang --- backend/scripts/coretpk_rw_xml_converter.sh.in | 19 ++++++++++--------- backend/src/coretpk/coretpk-installer.c | 2 +- .../src/coretpk/xml-parser/coretpk-parser-hybrid.c | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/backend/scripts/coretpk_rw_xml_converter.sh.in b/backend/scripts/coretpk_rw_xml_converter.sh.in index f34d958..6599be8 100644 --- a/backend/scripts/coretpk_rw_xml_converter.sh.in +++ b/backend/scripts/coretpk_rw_xml_converter.sh.in @@ -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##/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 "// d" -e "// d" \ -e "s#\(]*\)>#\1 storeclient-id=\"$CLIENTID\">#" \ -e "s#package=\"#type=\"coretpk\" package=\"#g" $INPUT > $OUTPUT else /bin/sed -e "s##/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 "// d" -e "// d" \ -e "s#\(]*\)>#\1 install-location=\"internal-only\">#" \ -e "s#\(]*\)>#\1 storeclient-id=\"$CLIENTID\">#" \ @@ -45,13 +46,13 @@ then if [ $INSTALLLOCATION -eq 1 ] then /bin/sed -e "s##/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 "// d" -e "// d" \ -e "s#\(]*\)>#\1 storeclient-id=\"$CLIENTID\">#" \ -e "s#package=\"#type=\"coretpk\" package=\"#g" $INPUT > $OUTPUT else /bin/sed -e "s##/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 "// d" -e "// d" \ -e "s#\(]*\)>#\1 install-location=\"auto\">#" \ -e "s#\(]*\)>#\1 storeclient-id=\"$CLIENTID\">#" \ @@ -65,11 +66,11 @@ else then /bin/sed -e "s##/opt/usr/apps/$PKGID/shared/res/#g" \ -e "// d" -e "// 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##/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 "// d" -e "// d" \ -e "s#\(]*\)>#\1 install-location=\"internal-only\">#" \ -e "s#package=\"#type=\"coretpk\" package=\"#g" $INPUT > $OUTPUT @@ -79,11 +80,11 @@ else then /bin/sed -e "s##/opt/usr/apps/$PKGID/shared/res/#g" \ -e "// d" -e "// 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##/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 "// d" -e "// d" \ -e "s#\(]*\)>#\1 install-location=\"auto\">#" \ -e "s#package=\"#type=\"coretpk\" package=\"#g" $INPUT > $OUTPUT diff --git a/backend/src/coretpk/coretpk-installer.c b/backend/src/coretpk/coretpk-installer.c index d4e430e..adfb125 100755 --- a/backend/src/coretpk/coretpk-installer.c +++ b/backend/src/coretpk/coretpk-installer.c @@ -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); diff --git a/backend/src/coretpk/xml-parser/coretpk-parser-hybrid.c b/backend/src/coretpk/xml-parser/coretpk-parser-hybrid.c index ff01c69..c033441 100755 --- a/backend/src/coretpk/xml-parser/coretpk-parser-hybrid.c +++ b/backend/src/coretpk/xml-parser/coretpk-parser-hybrid.c @@ -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)) { -- 2.7.4