[Groonga-commit] groonga/heroku-buildpack-groonga at 92ebd79 [master] Use compiling specific mecabrc on compiling

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Feb 23 10:18:15 JST 2016


Kouhei Sutou	2016-02-23 10:18:15 +0900 (Tue, 23 Feb 2016)

  New Revision: 92ebd790a29f5fd73c8ea68c387a80244300afe0
  https://github.com/groonga/heroku-buildpack-groonga/commit/92ebd790a29f5fd73c8ea68c387a80244300afe0

  Message:
    Use compiling specific mecabrc on compiling

  Modified files:
    bin/compile

  Modified: bin/compile (+11 -19)
===================================================================
--- bin/compile    2016-02-23 10:10:16 +0900 (53ad240)
+++ bin/compile    2016-02-23 10:18:15 +0900 (68e7849)
@@ -76,15 +76,6 @@ def fix_prefix_in_pc(prefix, real_prefix)
   end
 end
 
-def update_mecabrc(mecabrc, prefix)
-  sh("sed", "-i.bak", "-e", "s,/app,#{prefix},g", mecabrc)
-  begin
-    yield
-  ensure
-    mv("#{mecabrc}.bak", mecabrc)
-  end
-end
-
 puts("-----> Loading environment variables")
 environment_variables = load_environment_variables(env_dir)
 
@@ -129,16 +120,17 @@ Dir.chdir(build_dir) do
     build_path_environment_value(ld_library_paths + base_ld_library_paths)
   ENV["GRN_PLUGINS_DIR"] = "#{absolete_prefix}/lib/groonga/plugins"
   ENV["GRN_RUBY_SCRIPTS_DIR"] = "#{absolete_prefix}/lib/groonga/scripts/ruby"
-  ENV["MECABRC"] = "#{build_dir}/vendor/mecab/etc/mecabrc"
-  update_mecabrc(ENV["MECABRC"], build_dir) do
-    mkdir_p(File.dirname(database_path))
-    sh("groonga", "-n", database_path, "quit")
-
-    puts("-----> Loading data")
-    Dir.glob("groonga/*.grn").sort.each do |grn|
-      sh("groonga", "--file", grn, database_path)
-      rm(grn)
-    end
+  mecabrc = "#{build_dir}/vendor/mecab/etc/mecabrc"
+  mecabrc_suffix = ".compiling"
+  ENV["MECABRC"] = "#{mecabrc}#{mecabrc_suffix}"
+  sh("sed", "-i#{mecabrc_suffix}", "-e", "s,/app,#{build_dir},g", mecabrc)
+  mkdir_p(File.dirname(database_path))
+  sh("groonga", "-n", database_path, "quit")
+
+  puts("-----> Loading data")
+  Dir.glob("groonga/*.grn").sort.each do |grn|
+    sh("groonga", "--file", grn, database_path)
+    rm(grn)
   end
 
   puts("-----> Setting environment variables")
-------------- next part --------------
HTML����������������������������...
Download 



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