… | |
… | |
21 | use Crossfire; |
21 | use Crossfire; |
22 | use Coro; |
22 | use Coro; |
23 | use Coro::AIO; |
23 | use Coro::AIO; |
24 | use POSIX (); |
24 | use POSIX (); |
25 | use Digest::MD5; |
25 | use Digest::MD5; |
|
|
26 | use Carp; |
26 | use Coro::Storable; $Storable::canonical = 1; |
27 | use Coro::Storable; $Storable::canonical = 1; |
|
|
28 | |
|
|
29 | $SIG{QUIT} = sub { Carp::cluck "QUIT" }; |
27 | |
30 | |
28 | sub usage { |
31 | sub usage { |
29 | warn <<EOF; |
32 | warn <<EOF; |
30 | Usage: cfutil [-v] [-q] [--force] [--cache] |
33 | Usage: 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 | |
… | |
… | |
430 | push @png, ["$path/$file", 0]; |
433 | push @png, ["$path/$file", 0]; |
431 | } elsif ($file =~ /\.trs$/) { |
434 | } elsif ($file =~ /\.trs$/) { |
432 | push @trs, [$path, $file]; |
435 | push @trs, [$path, $file]; |
433 | } elsif ($file =~ /\.arc$/) { |
436 | } elsif ($file =~ /\.arc$/) { |
434 | push @arc, [$path, $file]; |
437 | push @arc, [$path, $file]; |
435 | } elsif ($file =~ /\.(ogg|res)$/) { |
438 | } elsif ($file =~ /\.(ogg|jpg|res)$/) { |
436 | push @res, [$path, $file]; |
439 | push @res, [$path, $file]; |
437 | } else { |
440 | } else { |
438 | warn "ignoring $path/$file\n" if $VERBOSE >= 3; |
441 | warn "ignoring $path/$file\n" if $VERBOSE >= 3; |
439 | } |
442 | } |
440 | } |
443 | } |