summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2016-09-05 20:53:07 +0900
committerHwankyu Jhun <h.jhun@samsung.com>2016-09-05 21:21:05 +0900
commitaf932abc24839bedcf42c595eb7df356265a6443 (patch)
tree39a5595d20da23757208141639faee6d1c53df55
parent104d813e700ebb28098c6645d8f1ec3dc1476ee4 (diff)
downloadwidget-service-accepted/tizen/common/20160905.171443.tar.gz
widget-service-accepted/tizen/common/20160905.171443.tar.bz2
widget-service-accepted/tizen/common/20160905.171443.zip
Change-Id: Iaaae6502c7a525d9bdee19de74ac6f6160df0fe8 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r--packaging/libwidget_service.spec9
-rwxr-xr-xscripts/104.widget_upgrade.sh28
2 files changed, 37 insertions, 0 deletions
diff --git a/packaging/libwidget_service.spec b/packaging/libwidget_service.spec
index 9859189..befbe2a 100644
--- a/packaging/libwidget_service.spec
+++ b/packaging/libwidget_service.spec
@@ -29,6 +29,8 @@ BuildRequires: pkgconfig(pkgmgr-installer)
BuildRequires: pkgconfig(ecore-wayland)
BuildRequires: pkgconfig(iniparser)
+%define upgrade_script_path /usr/share/upgrade/scripts
+
%if "%{model_build_feature_widget}" == "0"
ExclusiveArch:
%endif
@@ -79,12 +81,17 @@ cat /dev/null > .widget.db-journal
install -m 0644 .widget.db %{buildroot}%{TZ_SYS_DB}
install -m 0644 .widget.db-journal %{buildroot}%{TZ_SYS_DB}
install -m 0644 .widget.db %{buildroot}%{_sysconfdir}/skel/.applications/dbspace
+install -m 0644 .widget.db-journal %{buildroot}%{_sysconfdir}/skel/.applications/dbspace
+
+mkdir -p %{buildroot}%{upgrade_script_path}
+cp -f scripts/104.widget_upgrade.sh %{buildroot}%{upgrade_script_path}
%post -n %{name}
/sbin/ldconfig
chsmack -a "User::Home" %{TZ_SYS_DB}/.widget.db
chsmack -a "User::Home" %{TZ_SYS_DB}/.widget.db-journal
chsmack -a "User::Home" %{_sysconfdir}/skel/.applications/dbspace/.widget.db
+chsmack -a "User::Home" %{_sysconfdir}/skel/.applications/dbspace/.widget.db-journal
%postun -n %{name}
/sbin/ldconfig
@@ -96,10 +103,12 @@ chsmack -a "User::Home" %{_sysconfdir}/skel/.applications/dbspace/.widget.db
%{_libdir}/libwidget_service.so*
%{_sysconfdir}/package-manager/parserlib/libwidget-application.so
%{_sysconfdir}/skel/.applications/dbspace/.widget.db
+%{_sysconfdir}/skel/.applications/dbspace/.widget.db-journal
%{TZ_SYS_DB}/.widget.db
%{TZ_SYS_DB}/.widget.db-journal
%{_bindir}/widget_test
%{_datarootdir}/widget_service/*
+%{upgrade_script_path}/104.widget_upgrade.sh
%files devel
%manifest %{name}.manifest
diff --git a/scripts/104.widget_upgrade.sh b/scripts/104.widget_upgrade.sh
new file mode 100755
index 0000000..070e144
--- /dev/null
+++ b/scripts/104.widget_upgrade.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+#------------------------------------------#
+# widget upgrade (2.4 -> 3.0) #
+#------------------------------------------#
+
+# Macro
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+UPGRADE_DB_DIR=/etc/skel/.applications/dbspace
+DB_DIR=/opt/dbspace
+
+UPGRADE_DB_WIDGET=$UPGRADE_DB_DIR/.widget.db
+DB_WIDGET=$DB_DIR/.widget.db
+
+# Delete DB
+rm -rf $DB_WIDGET
+rm -rf $DB_WIDGET-journal
+
+# Copy DB
+cp -rf $UPGRADE_DB_WIDGET $DB_WIDGET
+cp -rf $UPGRADE_DB_WIDGET-journal $DB_WIDGET-journal
+
+chmod 644 $DB_WIDGET
+chmod 644 $DB_WIDGET-journal
+
+chsmack -a User::Home $DB_WIDGET
+chsmack -a User::Home $DB_WIDGET-journal