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

Comparing deliantra/server/utils/cfutil.in (file contents):
Revision 1.37 by root, Tue Jul 10 16:24:00 2007 UTC vs.
Revision 1.42 by root, Thu Jul 19 13:46:39 2007 UTC

21use Crossfire; 21use Crossfire;
22use Coro; 22use Coro;
23use Coro::AIO; 23use Coro::AIO;
24use POSIX (); 24use POSIX ();
25use Digest::MD5; 25use Digest::MD5;
26use Carp;
26use Coro::Storable; $Storable::canonical = 1; 27use Coro::Storable; $Storable::canonical = 1;
28
29$SIG{QUIT} = sub { Carp::cluck "QUIT" };
27 30
28sub usage { 31sub usage {
29 warn <<EOF; 32 warn <<EOF;
30Usage: cfutil [-v] [-q] [--force] [--cache] 33Usage: cfutil [-v] [-q] [--force] [--cache]
31 [--install-arch path] 34 [--install-arch path]
92 if (!-f "$path/regions") { 95 if (!-f "$path/regions") {
93 warn "'$path' does not look like a maps directory ('regions' file is missing).\n"; 96 warn "'$path' does not look like a maps directory ('regions' file is missing).\n";
94 exit 1 unless $FORCE; 97 exit 1 unless $FORCE;
95 } 98 }
96 99
97 system $RSYNC, "-av", "$path/.", "$DATADIR/maps/.", "--delete", "--exclude", "CVS", "--delete-excluded" 100 system $RSYNC, "-a", "--chmod=u=rwX,go=rX", "$path/.", "$DATADIR/maps/.", "--delete", "--exclude", "CVS", "--delete-excluded"
98 and die "map installation failed.\n"; 101 and die "map installation failed.\n";
99 102
100 print "maps installed successfully.\n"; 103 print "maps installed successfully.\n";
101} 104}
102 105
392 my ($dir, $file) = @{pop @res}; 395 my ($dir, $file) = @{pop @res};
393 396
394 my $data; 397 my $data;
395 aio_load "$dir/$file", $data; 398 aio_load "$dir/$file", $data;
396 399
400 my $copyright;
401 aio_load "$dir/copyright", $copyright;
402
397 $file =~ s/\.res$//; 403 $file =~ s/\.res$//;
398 $file =~ /\.([^.]+)$/ 404 $file =~ /\.([^.]+)$/
399 or next; 405 or next;
400 406
401 my $type = $1; 407 my $type = $1;
402 408
403 substr $dir, 0, 1 + length $PATH, ""; 409 substr $dir, 0, 1 + length $PATH, "";
404 410
405 $RESOURCE{"$dir/$file"} = { 411 $RESOURCE{"$dir/$file"} = {
406 type => $1, 412 type => $1,
407 copyright => "", # TODO 413 copyright => $copyright,
408 data => $data, 414 data => $data,
409 chksum => Digest::MD5::md5 $data, 415 chksum => Digest::MD5::md5 $data,
410 }; 416 };
411 } 417 }
412 } 418 }
427 push @png, ["$path/$file", 0]; 433 push @png, ["$path/$file", 0];
428 } elsif ($file =~ /\.trs$/) { 434 } elsif ($file =~ /\.trs$/) {
429 push @trs, [$path, $file]; 435 push @trs, [$path, $file];
430 } elsif ($file =~ /\.arc$/) { 436 } elsif ($file =~ /\.arc$/) {
431 push @arc, [$path, $file]; 437 push @arc, [$path, $file];
432 } elsif ($file =~ /\.(ogg|res)$/) { 438 } elsif ($file =~ /\.(ogg|jpg|res)$/) {
433 push @res, [$path, $file]; 439 push @res, [$path, $file];
434 } else { 440 } else {
435 warn "ignoring $path/$file\n" if $VERBOSE >= 3; 441 warn "ignoring $path/$file\n" if $VERBOSE >= 3;
436 } 442 }
437 } 443 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines