[Groonga-commit] groonga/groonga [master] deb: create database during install process

Back to archive index

HAYASHI Kentaro null+****@clear*****
Tue Sep 4 18:55:01 JST 2012


HAYASHI Kentaro	2012-09-04 18:55:01 +0900 (Tue, 04 Sep 2012)

  New Revision: 7fe37523fdb545d9603e5302cdc9a77f3a689d91
  https://github.com/groonga/groonga/commit/7fe37523fdb545d9603e5302cdc9a77f3a689d91

  Log:
    deb: create database during install process

  Modified files:
    packages/debian/groonga-server-common.postinst

  Modified: packages/debian/groonga-server-common.postinst (+10 -0)
===================================================================
--- packages/debian/groonga-server-common.postinst    2012-09-04 18:33:01 +0900 (cad2d57)
+++ packages/debian/groonga-server-common.postinst    2012-09-04 18:55:01 +0900 (b6afbc4)
@@ -21,9 +21,19 @@ fixperms() {
         dpkg-statoverride --update --add groonga groonga 0755 /var/log/groonga
 }
 
+create_database() {
+    if ! -d /var/lib/groonga/db ; then
+        mkdir -p /var/lib/groonga/db
+        TEMP_FILE=`tempfile`
+        groonga -n /var/lib/groonga/db/db < $TEMP_FILE
+        rm -f $TEMP_FILE
+    fi
+}
+
 case "$1" in
     configure)
         add_system_user
+        create_database
         fixperms
         ;;
     abort-upgrade|abort-deconfigure|abort-remove)
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index