summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongeup Ham <dongeup.ham@samsung.com>2012-11-12 19:16:19 +0900
committerDongeup Ham <dongeup.ham@samsung.com>2012-11-12 19:16:19 +0900
commit2080ee240f11a56710b9b68970583c2af013efe7 (patch)
tree76d65c00971bd0bedfaccd000ee350bf3b174fd3
parent53da6f66b39e8b53b868f1e7e12ed3dd30528809 (diff)
downloadinstaller-2080ee240f11a56710b9b68970583c2af013efe7.tar.gz
installer-2080ee240f11a56710b9b68970583c2af013efe7.tar.bz2
installer-2080ee240f11a56710b9b68970583c2af013efe7.zip
Fix Uninstallation failure in managed application UI
Change-Id: I4e1961b28a66df974226304d9bb1c85ae7cf8949
-rwxr-xr-xinc/InstallerDefs.h2
-rwxr-xr-xsrc/Util/InstallerUtil.cpp23
-rwxr-xr-xsrc/Util/InstallerUtil.h2
-rwxr-xr-xsrc/XmlHandler/XmlWriter.cpp4
-rwxr-xr-xsrc/backend/backend.cpp13
5 files changed, 36 insertions, 8 deletions
diff --git a/inc/InstallerDefs.h b/inc/InstallerDefs.h
index 731a799..3e89413 100755
--- a/inc/InstallerDefs.h
+++ b/inc/InstallerDefs.h
@@ -21,7 +21,7 @@
#ifndef _INSTALLER_DEFS_H_
#define _INSTALLER_DEFS_H_
-#define OSP_INSTALLER_VERSION "osp-installer version = [2012/11/09]_RC[1]"
+#define OSP_INSTALLER_VERSION "osp-installer version = [2012/11/12]_RC[1]"
#define DIR_BIN L"/bin"
#define DIR_INFO L"/info"
diff --git a/src/Util/InstallerUtil.cpp b/src/Util/InstallerUtil.cpp
index afdea15..b6f4ed7 100755
--- a/src/Util/InstallerUtil.cpp
+++ b/src/Util/InstallerUtil.cpp
@@ -411,3 +411,26 @@ InstallerUtil::CreateSymlinkForAppDirectory(const String& inPath, String& outPat
return true;
}
+bool
+InstallerUtil::DumpLog(const char* pBuf)
+{
+ char temp[4096] = {0};
+ TryReturn(pBuf, false, "[osp-installer] pBuf is null");
+
+ int bufLen = strlen(pBuf);
+ strncpy(temp, pBuf, sizeof(temp));
+
+ char *pStart = &temp[0];
+
+ for (int i = 0; i < bufLen; i++)
+ {
+ if (temp[i] == '\n')
+ {
+ temp[i] = 0;
+ AppLogTag(OSP_INSTALLER, "%s", pStart);
+ pStart = temp + i + 1;
+ }
+ }
+
+ return true;
+}
diff --git a/src/Util/InstallerUtil.h b/src/Util/InstallerUtil.h
index fa91af7..a83a7b8 100755
--- a/src/Util/InstallerUtil.h
+++ b/src/Util/InstallerUtil.h
@@ -61,6 +61,8 @@ public:
static bool CreateSymlinkForAppDirectory(const Osp::Base::String& inPath, Osp::Base::String& outPath);
+ static bool DumpLog(const char* pBuf);
+
private:
InstallerUtil(const InstallerUtil& value);
InstallerUtil& operator =(const InstallerUtil& source);
diff --git a/src/XmlHandler/XmlWriter.cpp b/src/XmlHandler/XmlWriter.cpp
index 5d82efa..86e39d5 100755
--- a/src/XmlHandler/XmlWriter.cpp
+++ b/src/XmlHandler/XmlWriter.cpp
@@ -31,6 +31,7 @@
#include "InstallerDefs.h"
#include "XmlWriter.h"
+#include "InstallerUtil.h"
using namespace Osp::Base;
using namespace Osp::Base::Collection;
@@ -65,7 +66,8 @@ XmlWriter::~XmlWriter(void)
AppLogTag(OSP_INSTALLER, "------------------------------------------");
AppLogTag(OSP_INSTALLER, "%ls is generated", __xmlFilePath.GetPointer());
AppLogTag(OSP_INSTALLER, "------------------------------------------");
- AppLogTag(OSP_INSTALLER, "%s", __pXmlBuffer->content);
+ // AppLogTag(OSP_INSTALLER, "%s", __pXmlBuffer->content);
+ InstallerUtil::DumpLog((const char*)__pXmlBuffer->content);
}
if (__pXmlWriter)
diff --git a/src/backend/backend.cpp b/src/backend/backend.cpp
index b72cdff..597e5de 100755
--- a/src/backend/backend.cpp
+++ b/src/backend/backend.cpp
@@ -97,7 +97,7 @@ main(int argc, char **argv)
case PKGMGR_REQ_INSTALL:
{
errorType = manager.Request(path, INSTALLER_OPERATION_INSTALL, REQUESTER_TYPE_NORMAL);
-
+ appId = manager.GetAppId();
if (_pi != 0)
{
char resultBuf[128] = {0};
@@ -135,6 +135,7 @@ main(int argc, char **argv)
AppLogTag(OSP_INSTALLER, "requestAppId = %ls", requestAppId.GetPointer());
ret = manager.Request(requestAppId, INSTALLER_OPERATION_UNINSTALL, REQUESTER_TYPE_NORMAL);
+ appId = manager.GetAppId();
if (_pi != 0)
{
@@ -202,7 +203,6 @@ __osp_installer_report_result(const String& appId, int errorType)
}
else
{
- manager.PrintResult();
snprintf(resultBuf, sizeof(resultBuf), "%ls", appId.GetPointer());
}
@@ -217,10 +217,11 @@ __osp_installer_report_result(const String& appId, int errorType)
ret = pkgmgr_installer_send_signal(_pi, pPkgType, resultBuf, pKey, pValue);
AppLogTag(OSP_INSTALLER, "------------------------------------------");
AppLogTag(OSP_INSTALLER, "pkgmgr_installer_send_signal");
- AppLogTag(OSP_INSTALLER, " # type = [%s]", pPkgType);
- AppLogTag(OSP_INSTALLER, " # key = [%s]", pKey);
- AppLogTag(OSP_INSTALLER, " # val = [%s]", pValue);
- AppLogTag(OSP_INSTALLER, " # ret = [%s]", (ret == 0)?"success":"failure");
+ AppLogTag(OSP_INSTALLER, " # type = [%s]", pPkgType);
+ AppLogTag(OSP_INSTALLER, " # pkg id = [%s]", resultBuf);
+ AppLogTag(OSP_INSTALLER, " # key = [%s]", pKey);
+ AppLogTag(OSP_INSTALLER, " # val = [%s]", pValue);
+ AppLogTag(OSP_INSTALLER, " # ret = [%s]", (ret == 0)?"success":"failure");
AppLogTag(OSP_INSTALLER, "------------------------------------------");
pkgmgr_installer_free(_pi);