ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cf.schmorp.de/server/utils/cfutil.in
(Generate patch)

Comparing cf.schmorp.de/server/utils/cfutil.in (file contents):
Revision 1.57 by root, Mon Aug 20 22:09:04 2007 UTC vs.
Revision 1.62 by root, Mon Sep 10 18:30:30 2007 UTC

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
173 176
174 (my $base = $stem) =~ s/^.*\///; 177 (my $base = $stem) =~ s/^.*\///;
175 178
176 my $fi = $FACEINFO{$base}; 179 my $fi = $FACEINFO{$base};
177 unless ($fi) { 180 unless ($fi) {
178 warn "$path: <$base> not referenced by any archetype, skipping.\n"; 181 #warn "$path: <$base> not referenced by any archetype, skipping.\n";
179 next; 182 #next;
180 } 183 }
181 184
182 my $arc = $FACEINFO{$base}{arc} 185 my $arc = $fi->{arc} || { };
183 or die "FATAL: internal error <$base>, cannot continue";
184 186
185 unless ($path =~ /~$/) { 187 unless ($path =~ /~$/) {
186 # possibly enlarge 188 # possibly enlarge
187 if (0 > aio_stat "$stem.64x64.png") { 189 if (0 > aio_stat "$stem.64x64.png") {
188 my $other = "$stem.64x64.png~"; 190 my $other = "$stem.64x64.png~";
425 facings => $facings, 427 facings => $facings,
426 frames => \@frames, 428 frames => \@frames,
427 }; 429 };
428 } 430 }
429 431
430 for my $face ($o->{face} || (), @{$anim || []}) { 432 for ($o->{face} || (), @{$anim || []}) {
431 next if $face =~ /^facings\s/; 433 next if /^facings\s/;
434
435 my $face = $_;
436 $face =~ s/\+\d+\+\d+$//; # remove tile offset coordinates
432 437
433 my $info = $FACEINFO{$face} ||= { }; 438 my $info = $FACEINFO{$face} ||= { };
434 $info->{arc} = $o; 439 $info->{arc} = $o;
435 440
436 next if $face =~ /^blank.x11$|^empty.x11$/; 441 next if $face =~ /^blank.x11$|^empty.x11$/;
492 my ($dir, $file, $type) = @$job; 497 my ($dir, $file, $type) = @$job;
493 498
494 my $data; 499 my $data;
495 aio_load "$dir/$file", $data; 500 aio_load "$dir/$file", $data;
496 501
502
497 my $meta = load_cached "$dir/meta", sub { JSON::XS::from_json shift }; 503 my $meta = load_cached "$dir/meta", sub { JSON::XS->new->utf8->relaxed->decode (shift) };
498 504
499 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 }
500 513
501 $meta = { 514 $meta = {
502 %{ $meta->{"" } || {} }, 515 %{ $meta->{"" } || {} },
503 %{ $meta->{$file} || {} }, 516 %{ $meta->{$file} || {} },
504 }; 517 };

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines