From 3246f28a070f5910bdbceb0391246386449ea906 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Mon, 5 Sep 2016 20:28:42 +0900 Subject: [PATCH] Add a script to upgrade rua db Change-Id: If2bed2a7b5dbbd4c83a5fd89dd377cd9738c80eb Signed-off-by: Hwankyu Jhun --- packaging/librua.spec | 6 ++++++ scripts/103.rua_upgrade.sh | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100755 scripts/103.rua_upgrade.sh diff --git a/packaging/librua.spec b/packaging/librua.spec index 1234963..68c5235 100644 --- a/packaging/librua.spec +++ b/packaging/librua.spec @@ -14,6 +14,8 @@ BuildRequires: pkgconfig(db-util) BuildRequires: pkgconfig(sqlite3) BuildRequires: pkgconfig(libtzplatform-config) +%define upgrade_script_path /usr/share/upgrade/scripts + %description Recently used application library @@ -42,6 +44,9 @@ make %{?_smp_mflags} %install %make_install +mkdir -p %{buildroot}%{upgrade_script_path} +cp -f scripts/103.rua_upgrade.sh %{buildroot}%{upgrade_script_path} + %post -p /sbin/ldconfig %postun -p /sbin/ldconfig @@ -51,6 +56,7 @@ make %{?_smp_mflags} %defattr(-,root,root,-) %{_libdir}/librua.so.* %license LICENSE +%{upgrade_script_path}/103.rua_upgrade.sh %files devel %manifest %{name}.manifest diff --git a/scripts/103.rua_upgrade.sh b/scripts/103.rua_upgrade.sh new file mode 100755 index 0000000..424b6a4 --- /dev/null +++ b/scripts/103.rua_upgrade.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +#------------------------------------------# +# rua upgrade (2.4 -> 3.0) # +#------------------------------------------# + +# Macro +PATH=/bin:/usr/bin:/sbin:/usr/sbin + +DB_DIR=/opt/dbspace +DB_RUA=$DB_DIR/.rua.db + +# Delete DB & DB journal +rm -rf $DB_RUA +rm -rf $DB_RUA-journal + -- 2.7.4