[groonga-commit:2952] ranguba/ranguba [master] don't override existing configuration files.

null+ranguba at clear-code.com null+ranguba at clear-code.com
Sat Dec 25 21:36:22 EST 2010


Kouhei Sutou	2010-12-26 02:36:22 +0000 (Sun, 26 Dec 2010)

  New Revision: ce2f6d83fabb5fed6e88774c71da1e88b2462f2c

  Log:
    don't override existing configuration files.

  Modified files:
    installer/install_sources_and_gems.sh

  Modified: installer/install_sources_and_gems.sh (+9 -10)
===================================================================
--- installer/install_sources_and_gems.sh    2010-12-26 02:21:20 +0000 (0ecf4fa)
+++ installer/install_sources_and_gems.sh    2010-12-26 02:36:22 +0000 (1bab0cf)
@@ -146,18 +146,17 @@ function install_ranguba() {
     tar xfz "$SOURCE/$APPLICATION_NAME.tar.gz" -C "$PREFIX/"
     mkdir -p "$PREFIX/$APPLICATION_NAME/vendor/cache"
     cp -a ${SOURCE}/*.gem "$PREFIX/$APPLICATION_NAME/vendor/cache"
+    local config_dir="$PREFIX/$APPLICATION_NAME/config/customize"
     if test -f "$DATA_DIR/encodings.csv"; then
-	cp -f "$DATA_DIR/encodings.csv" "$PREFIX/$APPLICATION_NAME/config/customize/encodings.csv"
-    fi
-    if test -f "$DATA_DIR/categories.csv"; then
-	cp -f "$DATA_DIR/categories.csv" "$PREFIX/$APPLICATION_NAME/config/customize/categories.csv"
-    fi
-    if test -f "$DATA_DIR/passwords.csv"; then
-	cp -f "$DATA_DIR/passwords.csv" "$PREFIX/$APPLICATION_NAME/config/customize/passwords.csv"
-    fi
-    if test -f "$DATA_DIR/title.txt"; then
-	cp -f "$DATA_DIR/title.txt" "$PREFIX/$APPLICATION_NAME/config/customize/title.txt"
+	cp -f "$DATA_DIR/encodings.csv" "$config_dir/encodings.csv"
     fi
+    for config_file in categories.csv passwords.csv title.txt; do
+	local origin="$DATA_DIR/$config_file"
+	local dest="$config_dir/$config_file"
+	if test -f "$origin" -a ! -f "$dest"; then
+	    cp -f "$origin" "$dest"
+	fi
+    done
     cd "$PREFIX/$APPLICATION_NAME"
     cp config/groonga.yml.example config/groonga.yml
     RAILS_ENV="production" ruby -S bundle --no-color install \



More information about the groonga-commit mailing list