[Groonga-commit] groonga/heroku-buildpack-groonga at 0c0f083 [master] Fix sed usage

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Feb 23 10:39:22 JST 2016


Kouhei Sutou	2016-02-23 10:39:22 +0900 (Tue, 23 Feb 2016)

  New Revision: 0c0f083f6bdaf08eedfb9ec0958015abed9ebf89
  https://github.com/groonga/heroku-buildpack-groonga/commit/0c0f083f6bdaf08eedfb9ec0958015abed9ebf89

  Message:
    Fix sed usage

  Modified files:
    bin/compile

  Modified: bin/compile (+10 -8)
===================================================================
--- bin/compile    2016-02-23 10:35:54 +0900 (8a1c850)
+++ bin/compile    2016-02-23 10:39:22 +0900 (1be3c9b)
@@ -120,16 +120,18 @@ 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"
-  mecabrc = "#{build_dir}/vendor/mecab/etc/mecabrc"
+  mecabrc_path = "#{build_dir}/vendor/mecab/etc/mecabrc"
   mecabrc_suffix = ".compiling"
-  ENV["MECABRC"] = "#{mecabrc}#{mecabrc_suffix}"
-  puts(File.read(mecabrc))
-  sh("sed", "-i#{mecabrc_suffix}", "-e", "s,/app,#{build_dir},g", mecabrc)
-  puts("=" * 40)
-  puts(File.read(ENV["MECABRC"]))
+  ENV["MECABRC"] = "#{mecabrc_path}#{mecabrc_suffix}"
+  File.open(ENV["MECABRC"], "w") do |mecabrc_compiling_file|
+    mecabrc = File.read(mecabrc_path)
+    mecabrc_compiling = mecabrc.gsub(/\/app/) do
+      build_dir
+    end
+    mecabrc_compiling_file.puts(mecabrc_compiling)
+  end
   mkdir_p(File.dirname(database_path))
-  sh("groonga", "--log-path", "/tmp/log", "--log-level", "debug", "-n", database_path, "quit")
-  puts(File.read("/tmp/log"))
+  sh("groonga", "-n", database_path, "quit")
 
   puts("-----> Loading data")
   Dir.glob("groonga/*.grn").sort.each do |grn|
-------------- next part --------------
HTML����������������������������...
Download 



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