… | |
… | |
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] |
… | |
… | |
423 | my ($dirs, $nondirs) = @_; |
426 | my ($dirs, $nondirs) = @_; |
424 | |
427 | |
425 | find_files "$path/$_" |
428 | find_files "$path/$_" |
426 | for grep $_ !~ /^(?:CVS|dev)$/, @$dirs; |
429 | for grep $_ !~ /^(?:CVS|dev)$/, @$dirs; |
427 | |
430 | |
|
|
431 | my $dir = $path; |
|
|
432 | substr $dir, 0, 1 + length $PATH, ""; |
|
|
433 | |
428 | for my $file (@$nondirs) { |
434 | for my $file (@$nondirs) { |
|
|
435 | if ($file =~ /\.(ogg|jpg|res)$/ || $dir =~ /^res(?:\/|$)/) { |
|
|
436 | push @res, [$path, $file]; |
429 | if ($file =~ /\.png$/) { |
437 | } elsif ($file =~ /\.png$/) { |
430 | push @png, ["$path/$file", 0]; |
438 | push @png, ["$path/$file", 0]; |
431 | } elsif ($file =~ /\.trs$/) { |
439 | } elsif ($file =~ /\.trs$/) { |
432 | push @trs, [$path, $file]; |
440 | push @trs, [$path, $file]; |
433 | } elsif ($file =~ /\.arc$/) { |
441 | } elsif ($file =~ /\.arc$/) { |
434 | push @arc, [$path, $file]; |
442 | push @arc, [$path, $file]; |
435 | } elsif ($file =~ /\.(ogg|jpg|res)$/) { |
|
|
436 | push @res, [$path, $file]; |
|
|
437 | } else { |
443 | } else { |
438 | warn "ignoring $path/$file\n" if $VERBOSE >= 3; |
444 | warn "ignoring $path/$file\n" if $VERBOSE >= 3; |
439 | } |
445 | } |
440 | } |
446 | } |
441 | }; |
447 | }; |