[Groonga-commit] groonga/heroku-buildpack-rroonga at 4278407 [master] Set up env_dir

Back to archive index

Kouhei Sutou null+****@clear*****
Sun May 25 18:11:17 JST 2014


Kouhei Sutou	2014-05-25 18:11:17 +0900 (Sun, 25 May 2014)

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

  Message:
    Set up env_dir

  Modified files:
    bin/compile

  Modified: bin/compile (+16 -8)
===================================================================
--- bin/compile    2014-05-25 17:58:49 +0900 (835cafa)
+++ bin/compile    2014-05-25 18:11:17 +0900 (818766a)
@@ -111,12 +111,17 @@ class BuildpackBuilder
   def compile
     puts("-----> Compiling buildpack: #{@label}")
 
-    arguments = [
-       @arguments.build_dir,
-       @arguments.cache_dir,
-    ]
-    arguments << @arguments.env_dir if****@argum*****_dir
-    run_script("bin/compile", *arguments)
+    Dir.mktmpdir do |env_dir|
+      new_environment_variables.each do |name, value|
+        File.open("#{env_dir}/#{name}", "w") do |file|
+          file.print(value)
+        end
+      end
+      run_script("bin/compile",
+                 @arguments.build_dir,
+                 @arguments.cache_dir,
+                 env_dir)
+    end
   end
 
   def release
@@ -128,8 +133,11 @@ class BuildpackBuilder
 
   def run_script(script, *arguments)
     chmod(0755, script)
-    sh(merge_environment_variables(@arguments.environment_variables),
-       script, *arguments)
+    sh(new_environment_variables, script, *arguments)
+  end
+
+  def new_environment_variables
+    merge_environment_variables(@arguments.environment_variables)
   end
 end
 
-------------- next part --------------
HTML����������������������������...
下載 



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