--- deliantra/server/utils/cfutil.in 2007/06/03 15:32:51 1.35 +++ deliantra/server/utils/cfutil.in 2007/07/23 23:38:18 1.43 @@ -8,7 +8,7 @@ my $DATADIR = "@datadir@/@PACKAGE@"; my $CONVERT = "@CONVERT@"; -my $IDENTIFY = "@IDENTIFY@"; +#my $IDENTIFY = "@IDENTIFY@"; my $OPTIPNG = "@OPTIPNG@"; my $RSYNC = "@RSYNC@"; my $PNGNQ = "@PNGNQ@"; @@ -23,8 +23,11 @@ use Coro::AIO; use POSIX (); use Digest::MD5; +use Carp; use Coro::Storable; $Storable::canonical = 1; +$SIG{QUIT} = sub { Carp::cluck "QUIT" }; + sub usage { warn < $1, + copyright => $copyright, + data => $data, + chksum => Digest::MD5::md5 $data, + }; + } + } + sub find_files; sub find_files { my ($path) = @_; @@ -396,8 +428,13 @@ find_files "$path/$_" for grep $_ !~ /^(?:CVS|dev)$/, @$dirs; + my $dir = $path; + substr $dir, 0, 1 + length $PATH, ""; + for my $file (@$nondirs) { - if ($file =~ /\.png$/) { + if ($file =~ /\.(ogg|jpg|res)$/ || $dir =~ /^res(?:\/|$)/) { + push @res, [$path, $file]; + } elsif ($file =~ /\.png$/) { push @png, ["$path/$file", 0]; } elsif ($file =~ /\.trs$/) { push @trs, [$path, $file]; @@ -413,6 +450,8 @@ sub inst_arch($) { my (undef, $path) = @_; + $PATH = $path; + print "\n", "Installing '$path' to '$DATADIR'\n", "\n", @@ -436,6 +475,7 @@ (async \&process_png), (async \&process_png), (async \&process_png), (async \&process_png), (async \&process_trs), (async \&process_trs), (async \&process_arc), (async \&process_arc), + (async \&process_res), (async \&process_res), ); { @@ -513,6 +553,7 @@ version => 2, faceinfo => \%FACEINFO, animinfo => \%ANIMINFO, + resource => \%RESOURCE, }; }