X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/e9d337c2a49d120a8dcb508879d74f6bab5b84d9..4193b7c3aea52c461d1988aacb4e68751b533515:/cookbooks/planet/templates/default/apache-latest-planet-filename.erb diff --git a/cookbooks/planet/templates/default/apache-latest-planet-filename.erb b/cookbooks/planet/templates/default/apache-latest-planet-filename.erb index d7c8695c7..9107436b3 100644 --- a/cookbooks/planet/templates/default/apache-latest-planet-filename.erb +++ b/cookbooks/planet/templates/default/apache-latest-planet-filename.erb @@ -2,9 +2,25 @@ # DO NOT EDIT - This file is being maintained by Chef +use strict; +use warnings; + +use Cwd qw(abs_path); + $| = 1; -while () { - my $where = readlink("<%= node[:planet][:dump][:xml_directory] %>/planet-latest.osm.bz2"); - s/planet\/planet\-latest\.osm\.bz2/planet\/$where/g; - print $_; + +while (my $path = ) +{ + chomp $path; + + my $file = abs_path("/store/planet${path}"); + + if ($file && $file =~ m|^/store/planet(/.*)$| && -f $file) + { + print "$1\n"; + } + else + { + print "NULL\n"; + } }