summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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