Add a script to upgrade syspopup db 23/85723/1 accepted/tizen/common/20160829.140002 accepted/tizen/common/20160830.150210 accepted/tizen/ivi/20160830.061225 accepted/tizen/mobile/20160830.060952 accepted/tizen/tv/20160830.061055 accepted/tizen/wearable/20160830.061139 submit/tizen/20160829.010716 submit/tizen/20160830.010724
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 29 Aug 2016 00:44:48 +0000 (09:44 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 29 Aug 2016 00:44:48 +0000 (09:44 +0900)
Change-Id: I517f02cb58cf76c80c996d75df7425700cb6c0ed
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
packaging/syspopup.manifest
packaging/syspopup.spec
scripts/102.syspopup_upgrade.sh [new file with mode: 0755]

index 6cf983a..776b0ca 100644 (file)
@@ -4,6 +4,5 @@
         </request>
        <assign>
                <filesystem path="TZ_SYS_DB/.syspopup.db" label="System::Shared"/>
-               <filesystem path="TZ_SYS_DB/.syspopup.db-journal" label="System::Shared"/>
        </assign>
 </manifest>
index 9198ee9..05034dc 100644 (file)
@@ -38,6 +38,9 @@ BuildRequires:  pkgconfig(capi-system-system-settings)
 BuildRequires:  pkgconfig(libsystemd-daemon)
 BuildRequires:  pkgconfig(aul)
 
+%define upgrade_script_path /usr/share/upgrade/scripts
+%define upgrade_data_path /usr/share/upgrade/data
+
 %if "%{?profile}" == "wearable"
 %define profile_wearable 1
 %else
@@ -117,6 +120,11 @@ touch %{buildroot}%{_datadir}/popup_noti_term
 mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d
 install -m 0644 %SOURCE1005 %{buildroot}%{_sysconfdir}/dbus-1/system.d/org.tizen.aul.syspopup.conf
 
+mkdir -p %{buildroot}%{upgrade_script_path}
+mkdir -p %{buildroot}%{upgrade_data_path}
+cp -f scripts/102.syspopup_upgrade.sh %{buildroot}%{upgrade_script_path}
+cp -f %{buildroot}%{TZ_SYS_DB}/.syspopup.db %{buildroot}%{upgrade_data_path}
+
 %post -p /sbin/ldconfig
 
 %postun -p /sbin/ldconfig
@@ -134,10 +142,10 @@ install -m 0644 %SOURCE1005 %{buildroot}%{_sysconfdir}/dbus-1/system.d/org.tizen
 %{_libdir}/libsyspopup.so.0.1.0
 %TZ_SYS_RO_PACKAGES/org.tizen.syspopup-app.xml
 %{_datadir}/popup_noti_term
-
 %attr(644,root,%{TZ_SYS_USER_GROUP}) %{TZ_SYS_DB}/.syspopup.db
-
 %TZ_SYS_RO_SHARE/license/%{name}
+%{upgrade_script_path}/102.syspopup_upgrade.sh
+%{upgrade_data_path}/.syspopup.db
 
 %files devel
 %manifest %{name}-devel.manifest
diff --git a/scripts/102.syspopup_upgrade.sh b/scripts/102.syspopup_upgrade.sh
new file mode 100755 (executable)
index 0000000..eeb859f
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+#------------------------------------------#
+# syspopup upgrade (2.4 -> 3.0)              #
+#------------------------------------------#
+
+# Macro
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+UPGRADE_DB_DIR=/usr/share/upgrade/data
+DB_DIR=/opt/dbspace
+
+UPGRADE_DB_SYSPOPUP=$UPGRADE_DB_DIR/.syspopup.db
+DB_SYSPOPUP=$DB_DIR/.syspopup.db
+
+# Copy DB
+cp -rf $UPGRADE_DB_SYSPOPUP $DB_SYSPOPUP
+
+chmod 644 $DB_SYSPOPUP
+chown :users $DB_SYSPOPUP
+chsmack -a System::Shared $DB_SYSPOPUP
+
+# Delete DB journal
+rm -rf $DB_SYSPOPUP-journal
+