Revert "Fix installation of NPRuntime plug-ins."
authorTaejeong Lee <taejeong.lee@samsung.com>
Tue, 25 Jun 2013 04:43:00 +0000 (13:43 +0900)
committerTaejeong Lee <taejeong.lee@samsung.com>
Tue, 25 Jun 2013 04:43:12 +0000 (13:43 +0900)
This reverts commit 9952b51a8e732a9fd9578d83c34c2f85bc4c9b44.

[Issue#] N/A
[Problem] Webapp install is failed because signature validation regarding this commit.
[Cause] N/A
[Solution] Revert this commit and the core spec will be changed about this.

Change-Id: I2e6e85de8cffc6c359d3d468b9e3f398a7ba5a96

src/jobs/widget_install/widget_unzip.cpp

index 1b86657..df96243 100644 (file)
@@ -34,8 +34,6 @@
 using namespace WrtDB;
 
 namespace {
-const char* const NPRUNTIME_PLUGINS_DIR = "plugins/";
-
 struct PathAndFilePair
 {
     std::string path;
@@ -62,34 +60,6 @@ PathAndFilePair SplitFileAndPath(const std::string &filePath)
                                            position),
                            filePath.substr(position + 1));
 }
-
-inline bool isNPPlugin(const std::string& filePath)
-{
-    std::string::size_type pos = filePath.find(NPRUNTIME_PLUGINS_DIR);
-    // Not specified if a plug-in name MUST end with a specific extension
-    // (e.g. .so)
-    return ((std::string::npos != pos) &&
-            ('/' != filePath[filePath.length() - 1]));
-}
-
-// precondition: isNPPlugin(filePath) == true
-inline bool isValidNPPlugin(const std::string& filePath)
-{
-    return (filePath.find(GlobalConfig::GetNPRuntimePluginsPath()) == 0);
-}
-
-bool shouldBeInstalled(const std::string& filePath)
-{
-    if (isNPPlugin(filePath))
-    {
-        if (!isValidNPPlugin(filePath))
-        {
-            LogDebug("Not a valid NPRuntime plug-in: " << filePath);
-            return false;
-        }
-    }
-    return true;
-}
 }
 
 namespace Jobs {
@@ -128,50 +98,43 @@ void WidgetUnzip::unzipProgress(const std::string &destination)
     // Extract file or path
     std::string fileName = m_zipIterator->name;
 
-    if (shouldBeInstalled(m_zipIterator->name))
-    {
-        if (fileName[fileName.size() - 1] == '/') {
-            // This is path
-            std::string newPath = destination + "/" +
-                fileName.substr(0, fileName.size() - 1);
-            LogPedantic("Path to extract: " << newPath);
-
-            // Create path in case of it is empty
-            createTempPath(newPath);
-        } else {
-            // This is regular file
-            std::string fileExtractPath = destination + "/" + fileName;
-
-            LogPedantic("File to extract: " << fileExtractPath);
-
-            // Split into pat & file pair
-            PathAndFilePair pathAndFile = SplitFileAndPath(fileExtractPath);
-
-            LogPedantic("Path and file: " <<
-                        pathAndFile.path <<
-                        " : " << pathAndFile.file);
-
-            // First, ensure that path exists
-            createTempPath(pathAndFile.path);
-
-            Try
-            {
-                // Open file
-                std::unique_ptr<DPL::ZipInput::File> file(
-                    m_zip->OpenFile(fileName));
-
-                // Extract single file
-                ExtractFile(file.get(), fileExtractPath);
-            }
-            Catch(DPL::ZipInput::Exception::OpenFileFailed)
-            {
-                ThrowMsg(Exceptions::ExtractFileFailed, fileName);
-            }
+    if (fileName[fileName.size() - 1] == '/') {
+        // This is path
+        std::string newPath = destination + "/" +
+            fileName.substr(0, fileName.size() - 1);
+        LogPedantic("Path to extract: " << newPath);
+
+        // Create path in case of it is empty
+        createTempPath(newPath);
+    } else {
+        // This is regular file
+        std::string fileExtractPath = destination + "/" + fileName;
+
+        LogPedantic("File to extract: " << fileExtractPath);
+
+        // Split into pat & file pair
+        PathAndFilePair pathAndFile = SplitFileAndPath(fileExtractPath);
+
+        LogPedantic("Path and file: " <<
+                    pathAndFile.path <<
+                    " : " << pathAndFile.file);
+
+        // First, ensure that path exists
+        createTempPath(pathAndFile.path);
+
+        Try
+        {
+            // Open file
+            std::unique_ptr<DPL::ZipInput::File> file(
+                m_zip->OpenFile(fileName));
+
+            // Extract single file
+            ExtractFile(file.get(), fileExtractPath);
+        }
+        Catch(DPL::ZipInput::Exception::OpenFileFailed)
+        {
+            ThrowMsg(Exceptions::ExtractFileFailed, fileName);
         }
-    }
-    else
-    {
-        LogDebug("Skipping file: " << m_zipIterator->name);
     }
 
     // Check whether there are more files to extract