Add scripts 63/131963/2
authorJunghyun Yeon <jungh.yeon@samsung.com>
Wed, 31 May 2017 10:02:04 +0000 (19:02 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Thu, 1 Jun 2017 05:47:44 +0000 (05:47 +0000)
- Move pkg_initdb related scripts from pkgmgr-tool
- Add scripts to execute label change

Change-Id: Ib826154fb0ac1622aec374e69ed10f3fa8755499
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
packaging/pkgmgr.spec

index 39f30cf..a00c55f 100644 (file)
@@ -141,6 +141,21 @@ HOME="$saveHOME"
 
 %postun -n pkgmgr-installer -p /sbin/ldconfig
 
+%posttrans
+if [ ! -f %{TZ_SYS_DB}/.pkgmgr_parser.db ]; then
+  pkg_initdb --ro
+  install_preload_pkg
+  if [ -f /tmp/.preload_install_error ]; then
+    if [ ! -d /tmp/.postscript/error ]; then
+      mkdir -p /tmp/.postscript/error
+    fi
+    echo "preload install failed" > /tmp/.postscript/error/%{name}_error
+  else
+    pkgcmd -l
+  fi
+  ${_sysconfdir}/package-manager/pkgmgr-label-initial-image.sh
+fi
+rm -rf %{_sysconfdir}/package-manager/pkgmgr-label-initial-image.sh
 
 %files
 %manifest %{name}.manifest