-while (<STDIN>) {
- 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 = <STDIN>)
+{
+ chomp $path;
+
+ my $file = abs_path("/store/planet${path}");
+
+ if ($file && $file =~ m|^/store/planet(/.*)$| && -f $file)
+ {
+ print "$1\n";
+ }
+ else
+ {
+ print "NULL\n";
+ }