From 550e3e5d0c0a5a01d2f7a24869523d14e5034f5e Mon Sep 17 00:00:00 2001 From: Soyoung Kim Date: Fri, 21 Dec 2012 18:06:38 +0900 Subject: [PATCH] Fixed directory installation using pkgcmd [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 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/wrt-installer/wrt_installer.cpp b/src/wrt-installer/wrt_installer.cpp index 4f877a1..425d655 100644 --- a/src/wrt-installer/wrt_installer.cpp +++ b/src/wrt-installer/wrt_installer.cpp @@ -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: -- 2.7.4