- <% node[:tile][:styles].each do |name,details| -%>
- system("/usr/bin/render_expired", "--map=<%= name %>", *args, "--max-zoom=<%= details[:max_zoom] %>", :in=> f) &&
- <% end -%>
+ File.open(f, "r") do |file|
+ file.each do |line|
+ z, x, y = line.split("/")
+
+ z = z.to_i + 3
+ x = x.to_i * 8
+ y = y.to_i * 8
+
+ hash = []
+
+ 1.upto(5) do
+ hash.push(((x & 0xf) << 4) | (y & 0xf))
+
+ x = x >> 4
+ y = y >> 4
+ end
+
+ tileName = "#{z}/#{hash[4]}/#{hash[3]}/#{hash[2]}/#{hash[1]}/#{hash[0]}.meta"
+
+ tileDirs.each do |tileDir|
+ if File.exist?("#{tileDir}/#{tileName}")
+ FileUtils.touch("#{tileDir}/#{tileName}", :mtime => expiredTime)
+
+ tilesExpired = tilesExpired + 1
+ else
+ tilesIgnored = tilesIgnored + 1
+ end
+ end
+ end
+ end
+