Fixed directory installation using pkgcmd
authorSoyoung Kim <sy037.kim@samsung.com>
Fri, 21 Dec 2012 09:06:38 +0000 (18:06 +0900)
committerGerrit Code Review <gerrit2@kim11>
Wed, 26 Dec 2012 02:55:04 +0000 (11:55 +0900)
[Issue#] N/A
[Problem] directory installation failed using pkgcmd command
[Cause] installation policy option is wrong using pkgcmd.
[Solution] Fixed option for pkgcmd.
[SCMRequest] N/A

src/wrt-installer/wrt_installer.cpp

index 4f877a1..425d655 100644 (file)
@@ -225,7 +225,16 @@ void WrtInstaller::OnCreate()
         switch (reqType) {
             case PKGMGR_REQ_INSTALL:
                 m_packagePath = m_argv[4];
-                m_installPolicy = WRT_WIM_POLICY_WAC;
+                struct stat info;
+                if (-1 != stat(m_argv[4], &info) && S_ISDIR(info.st_mode)) {
+                    LogInfo("Installing package directly from directory");
+                    m_installPolicy = WRT_WIM_POLICY_DIRECTORY_FORCE_INSTALL;
+                }
+                else
+                {
+                    LogInfo("Installing from regular location");
+                    m_installPolicy = WRT_WIM_POLICY_WAC;
+                }
                 AddStep(&WrtInstaller::installStep);
                 break;
             case PKGMGR_REQ_UNINSTALL: