… | |
… | |
96 | if (!-f "$path/regions") { |
96 | if (!-f "$path/regions") { |
97 | warn "'$path' does not look like a maps directory ('regions' file is missing).\n"; |
97 | warn "'$path' does not look like a maps directory ('regions' file is missing).\n"; |
98 | exit 1 unless $FORCE; |
98 | exit 1 unless $FORCE; |
99 | } |
99 | } |
100 | |
100 | |
101 | system $RSYNC, "-a", "--chmod=u=rwX,go=rX", "$path/.", "$DATADIR/maps/.", "--delete", "--exclude", "CVS", "--delete-excluded" |
101 | system $RSYNC, "-av", "--chmod=u=rwX,go=rX", |
|
|
102 | "$path/.", "$DATADIR/maps/.", |
|
|
103 | "--exclude", "CVS", "--exclude", "/world-precomposed", |
|
|
104 | "--delete", "--delete-excluded" |
102 | and die "map installation failed.\n"; |
105 | and die "map installation failed.\n"; |
103 | |
106 | |
104 | print "maps installed successfully.\n"; |
107 | print "maps installed successfully.\n"; |
105 | } |
108 | } |
106 | |
109 | |
… | |
… | |
494 | my ($dir, $file, $type) = @$job; |
497 | my ($dir, $file, $type) = @$job; |
495 | |
498 | |
496 | my $data; |
499 | my $data; |
497 | aio_load "$dir/$file", $data; |
500 | aio_load "$dir/$file", $data; |
498 | |
501 | |
|
|
502 | |
499 | my $meta = load_cached "$dir/meta", sub { JSON::XS->new->utf8->relaxed->decode (shift) }; |
503 | my $meta = load_cached "$dir/meta", sub { JSON::XS->new->utf8->relaxed->decode (shift) }; |
500 | |
504 | |
501 | next if $meta && !exists $meta->{$file}; |
505 | utf8::decode $dir; |
|
|
506 | utf8::decode $file; |
|
|
507 | |
|
|
508 | # a meta file for resources is now mandatory |
|
|
509 | unless (exists $meta->{$file}) { |
|
|
510 | warn "skipping $dir/$file\n" if $VERBOSE >= 3; |
|
|
511 | next; |
|
|
512 | } |
502 | |
513 | |
503 | $meta = { |
514 | $meta = { |
504 | %{ $meta->{"" } || {} }, |
515 | %{ $meta->{"" } || {} }, |
505 | %{ $meta->{$file} || {} }, |
516 | %{ $meta->{$file} || {} }, |
506 | }; |
517 | }; |