[Groonga-commit] groonga/heroku-buildpack-rroonga at e90701a [master] Merge path related environment variables

Back to archive index

Kouhei Sutou null+****@clear*****
Sun May 25 17:00:48 JST 2014


Kouhei Sutou	2014-05-25 17:00:48 +0900 (Sun, 25 May 2014)

  New Revision: e90701aa4d193f7c74b0c285918515ae383e6c77
  https://github.com/groonga/heroku-buildpack-rroonga/commit/e90701aa4d193f7c74b0c285918515ae383e6c77

  Message:
    Merge path related environment variables

  Modified files:
    bin/compile

  Modified: bin/compile (+20 -1)
===================================================================
--- bin/compile    2014-05-25 16:20:42 +0900 (ed29fa0)
+++ bin/compile    2014-05-25 17:00:48 +0900 (19a09f0)
@@ -142,6 +142,25 @@ def setup_ruby_environment_variables(build_dir)
   prepend_path_to_environment_variable("GEM_PATH", gem_paths)
 end
 
+def merge_environment_variables(variables)
+  variables = variables.dup
+  target_paths = [
+    "PATH",
+    "LD_LIBRARY_PATH",
+    "PKG_CONFIG_PATH",
+    "GEM_PATH",
+  ]
+  target_paths.each do |target_path|
+    next unless variables.key?(target_path)
+    all_paths = [
+      ENV[target_path],
+      variables[target_path],
+    ]
+    variables[target_path] = all_paths.compact.join(File::PATH_SEPARATOR)
+  end
+  variables
+end
+
 arguments = Arguments.new(*ARGV)
 
 builder = BuildpackBuilder.new("Groonga", "groonga/groonga", arguments)
@@ -156,7 +175,7 @@ puts("-----> Initializing database")
 Dir.chdir(arguments.build_dir) do
   groonga_database_path = File.join(arguments.build_dir, "groonga", "database")
   ENV["GROONGA_DATABASE_PATH"] = groonga_database_path
-  sh(arguments.environment_variables,
+  sh(merge_environment_variables(arguments.environment_variables),
      "bundle", "exec", "ruby", File.join("groonga", "init.rb"))
 end
 
-------------- next part --------------
HTML����������������������������...
Télécharger 



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