diff options
author | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-04-11 14:47:06 +0900 |
---|---|---|
committer | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-04-11 14:47:34 +0900 |
commit | 9f25a3ba181dece83eb1f934cfa771e379131d61 (patch) | |
tree | fea1f6669d1228c7a3f1ef0b6cbdf63089a7e648 /run_integration_test.rb | |
parent | b3208fc929fe1da5a827e43cb0f35d983c2b5e0f (diff) | |
download | kati-9f25a3ba181dece83eb1f934cfa771e379131d61.tar.gz |
Make it possible to run make -n in repo/android
Diffstat (limited to 'run_integration_test.rb')
-rwxr-xr-x | run_integration_test.rb | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/run_integration_test.rb b/run_integration_test.rb index 6ecbf82..6cc0813 100755 --- a/run_integration_test.rb +++ b/run_integration_test.rb @@ -87,9 +87,22 @@ class AndroidTestCase < TestCase name = 'android' checkout = Proc.new{|tc| FileUtils.mkdir_p(@name) - Dir.chdir(@name) { - check_command("tar -xzf ../android.tgz") - } + md5 = `md5sum android.tgz` + need_update = true + if File.exist?("#{@name}/STAMP") + stamp = File.read("#{@name}/STAMP") + if md5 == stamp + need_update = false + end + end + + if need_update + check_command("tar -xzf android.tgz") + File.open("#{@name}/STAMP.tmp", 'w') do |ofile| + ofile.print(md5) + end + File.rename("#{@name}/STAMP.tmp", "#{@name}/STAMP") + end } super(name, checkout, DO_NOTHING, DO_NOTHING, 'dump-products') |