From 56919b117a3c8e743f359dcbc47aa9987e5cb14c Mon Sep 17 00:00:00 2001 From: Taejeong Lee Date: Fri, 25 Jan 2013 22:56:15 +0900 Subject: [PATCH] [Release] wrt-installer_0.0.97 by sync with master branch Change-Id: I2c0fabbba3ea5544ff701ec42df101d351361e69 --- configuration/config.tizen.xsd | 7 +++-- debian/changelog | 28 ++++++++++++++++++ etc/wrt_preinstall_widgets.sh | 6 ++-- packaging/wrt-installer.spec | 4 +-- src/wrt-installer/plugin_utils.cpp | 59 +++++++++++++++++++++++++++++++------- 5 files changed, 86 insertions(+), 18 deletions(-) diff --git a/configuration/config.tizen.xsd b/configuration/config.tizen.xsd index 4bc46ea..8fc4c99 100755 --- a/configuration/config.tizen.xsd +++ b/configuration/config.tizen.xsd @@ -110,7 +110,7 @@ - + @@ -150,7 +150,10 @@ - + + + + diff --git a/debian/changelog b/debian/changelog index 9027226..5d7a7de 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,31 @@ +wrt-installer (0.0.97) unstable; urgency=low + + * Revert "Change pkgname to appid for docomo request." + + -- Tae-Jeong Lee Fri, 25 Jan 2013 22:38:17 +0900 + +wrt-installer (0.0.96) unstable; urgency=low + + * Change pkgname to appid for docomo request. PART2 + + * Git : framework/web/wrt-installer + * Tag : wrt-installer_0.0.96 + + -- Soyoung Kim Thu, 24 Jan 2013 21:14:47 +0900 + +wrt-installer (0.0.95) unstable; urgency=low + + * change schema type of livebox + * Patch for semaphore deadlock bug while plugins installation. + * Fixed preinstall for plugin + * Change pkgname to appid for docomo request. PART1 + * Fixed app-control element type + + * Git : framework/web/wrt-installer + * Tag : wrt-installer_0.0.95 + + -- Soyoung Kim Thu, 24 Jan 2013 16:00:35 +0900 + wrt-installer (0.0.94) unstable; urgency=low * Modify app control element. diff --git a/etc/wrt_preinstall_widgets.sh b/etc/wrt_preinstall_widgets.sh index 2d7b9d5..1837565 100755 --- a/etc/wrt_preinstall_widgets.sh +++ b/etc/wrt_preinstall_widgets.sh @@ -69,13 +69,13 @@ else fi } +#Plugin installation is temporary code for window SDK +/usr/bin/wrt-installer -p + if [ ! -d $_working_dir ]; then echo "There is no preinstall widget directory - $_working_dir" restore_widget exit 1 fi -#Plugin installation is temporary code for window SDK -/usr/bin/wrt-installer -p - install_widgets diff --git a/packaging/wrt-installer.spec b/packaging/wrt-installer.spec index a113ad7..8b80231 100644 --- a/packaging/wrt-installer.spec +++ b/packaging/wrt-installer.spec @@ -1,7 +1,7 @@ -#git:framework/web/wrt-installer wrt-installer 0.0.94 +#git:framework/web/wrt-installer wrt-installer 0.0.97 Name: wrt-installer Summary: Installer for tizen Webruntime -Version: 0.0.94 +Version: 0.0.97 Release: 1 Group: Development/Libraries License: Apache License, Version 2.0 diff --git a/src/wrt-installer/plugin_utils.cpp b/src/wrt-installer/plugin_utils.cpp index ae29f5e..2b6bc3c 100644 --- a/src/wrt-installer/plugin_utils.cpp +++ b/src/wrt-installer/plugin_utils.cpp @@ -21,38 +21,75 @@ */ #include "plugin_utils.h" -#include #include #include #include +#include using namespace WrtDB; namespace PluginUtils { -const char PLUGIN_INSTALL_SEMAPHORE[] = "/.wrt_plugin_install_lock"; +const char* PLUGIN_INSTALL_LOCK_FILE = "/tmp/.wrt_plugin_install_lock"; -static DPL::Semaphore semaphore(PLUGIN_INSTALL_SEMAPHORE); +static int s_plugin_install_lock_fd = -1; bool lockPluginInstallation() { - Try { - semaphore.Lock(); - return true; + int ret = 0; + + LogInfo("Try to lock for plugins installation."); + + s_plugin_install_lock_fd = + open(PLUGIN_INSTALL_LOCK_FILE, O_RDONLY|O_CREAT, 0666); + + if (s_plugin_install_lock_fd == -1) + { + LogError("Lock file open failed!"); + + return false; } - Catch(DPL::Semaphore::Exception::Base){ + + ret = flock(s_plugin_install_lock_fd, LOCK_EX); //lock with waiting + + if (ret == -1) + { + LogError("Lock failed!"); + + close(s_plugin_install_lock_fd); + s_plugin_install_lock_fd = -1; + return false; } + + return true; } bool unlockPluginInstallation() { - Try { - semaphore.Unlock(); + LogInfo("Unlock for plugins installation."); + + if (s_plugin_install_lock_fd != -1) + { + int ret = 0; + + ret = flock(s_plugin_install_lock_fd, LOCK_UN); //unlock + + if (ret == -1) + { + LogError("Unlock failed!"); + } + + close(s_plugin_install_lock_fd); + s_plugin_install_lock_fd = -1; + return true; } - Catch(DPL::Semaphore::Exception::Base){ - return false; + else + { + LogError("Lock file was not created!"); } + + return false; } bool checkPluginInstallationRequired() -- 2.7.4