Explorar el Código

allow one to override the database storage location

Ralf S. Engelschall hace 18 años
padre
commit
6022c70a3e
Se han modificado 2 ficheros con 15 adiciones y 2 borrados
  1. 14 1
      dbmail/dbmail-setup.sh
  2. 1 1
      dbmail/dbmail.spec

+ 14 - 1
dbmail/dbmail-setup.sh

@@ -3,6 +3,14 @@
 ##  dbmail-setup.sh -- DBMail RDBMS Setup Utility
 ##
 
+#   command line argument sanity check
+if [ $# -eq 0 ]; then
+    echo "$0:ERROR: invalid command line" 1>&2
+    echo "$0:USAGE: $0 install [<database-directory>]" 1>&2
+    echo "$0:USAGE: $0 uninstall" 1>&2
+    exit 1
+fi
+
 #   package configuration
 db_type="@db_type@"
 db_script="@l_prefix@/share/dbmail/dbmail-setup.sql"
@@ -29,10 +37,15 @@ elif [ ".$db_type" = .pgsql ]; then
 fi
 
 #   dispatch operation
-cmd="${1:-"install"}"
+cmd="$1"
+shift
 case "$cmd" in
     install )
         #   create the DBMail database
+        if [ $# -gt 0 ]; then
+            db_dir="$1"
+            shift
+        fi
         if [ ".$db_type" = .sqlite ]; then
             ( umask 077
               @l_prefix@/bin/sqlite3 $db_name <$db_script

+ 1 - 1
dbmail/dbmail.spec

@@ -38,7 +38,7 @@ Class:        EVAL
 Group:        Mail
 License:      GPL
 Version:      %{V_major}.%{V_minor}%{V_micro}
-Release:      20070804
+Release:      20070805
 
 #   package options
 %option       with_fsl    yes