def if_files_changed(node, group_name, files)
if files.empty?
return
end
hash_io = IO.popen(['xargs', 'sha1sum'], 'w+')
files.sort.each { |f| hash_io.puts(f) }
hash_io.close_write
current_hash = hash_io.read
hash_file = File.join($chake_tmpdir, node + '.' + group_name + '.sha1sum')
hash_on_disk = nil
if File.exists?(hash_file)
hash_on_disk = File.read(hash_file)
end
if current_hash != hash_on_disk
yield
end
FileUtils.mkdir_p(File.dirname(hash_file))
File.open(hash_file, 'w') do |f|
f.write(current_hash)
end
end