During package installation there is no test for /opt/dbspace existence.
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Thu, 30 Jan 2014 11:47:43 +0000 (12:47 +0100)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Thu, 30 Jan 2014 11:47:43 +0000 (12:47 +0100)
[Issue#]        N/A
[Bug/Feature]   When creating databse from scratch during depedencies
                installation for gbs build process error occurs:
                Error: unable to open database "/opt/dbspace/.rules-db.db3":
                unable to open database file.
[Cause]         Missing /opt/dbspace directory.
[Solution]      Add checking for /opt/dbspace existence. Create directory
                if missing.
[Verification]  Delete /opt/dbspace, install libprivilege-control, check if
                /opt/dbspace and "/opt/dbspace/.rules-db.db3" exists.

Change-Id: I216b75caf63ac69d08b0d3b07981860606dcb6b8

Conflicts:

packaging/libprivilege-control.spec

packaging/libprivilege-control.spec

index c300e47..92d9aaa 100644 (file)
@@ -57,6 +57,13 @@ ln -sf /usr/lib/systemd/system/smack-rules.service %{buildroot}/usr/lib/systemd/
 
 %post
 /sbin/ldconfig
+
+if [ ! -e "/opt/dbspace" ]
+then
+    mkdir -p /opt/dbspace
+    chmod 775 /opt/dbspace
+fi
+
 /usr/share/privilege-control/db/updater.sh
 
 %postun -p /sbin/ldconfig