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.72 by root, Mon Oct 12 14:01:00 2009 UTC vs.
Revision 1.73 by root, Mon Oct 26 11:31:39 2009 UTC

12my $OPTIPNG = "@OPTIPNG@"; 12my $OPTIPNG = "@OPTIPNG@";
13my $RSYNC = "@RSYNC@"; 13my $RSYNC = "@RSYNC@";
14my $PNGNQ = "@PNGNQ@"; 14my $PNGNQ = "@PNGNQ@";
15 15
16use Getopt::Long; 16use Getopt::Long;
17use File::Temp;
18use POSIX ();
19use Carp;
20
17use Coro::EV; 21use Coro::EV;
18use AnyEvent; 22use AnyEvent;
19use YAML::XS (); 23use YAML::XS ();
20use JSON::XS (); 24use JSON::XS ();
21use IO::AIO (); 25use IO::AIO ();
22use File::Temp; 26
23use Deliantra;
24use Coro 5.12; 27use Coro 5.12;
25use Coro::AIO; 28use Coro::AIO;
26use Coro::Util; 29use Coro::Util;
27use POSIX ();
28use Carp;
29use Coro::Channel; 30use Coro::Channel;
30use Coro::Storable; $Storable::canonical = 1; 31use Coro::Storable; $Storable::canonical = 1;
32
33use Deliantra;
31 34
32$SIG{QUIT} = sub { Carp::cluck "QUIT" }; 35$SIG{QUIT} = sub { Carp::cluck "QUIT" };
33 36
34sub usage { 37sub usage {
35 warn <<EOF; 38 warn <<EOF;
601 } 604 }
602 } 605 }
603 }; 606 };
604 } 607 }
605 608
609 sub generate_plurals {
610# use Lingua::EN::Inflect ();
611# Lingua::EN::Inflect::classical;
612# Lingua::EN::Inflect::def_noun 'talisman' => 'talismans';
613# Lingua::EN::Inflect::def_noun '(.*)boots' => '$1boots'; # hack
614#
615# for my $a (@ARC) {
616# my $name = $a->{name} || $a->{_name};
617#
618# next unless $a->{name_pl};
619#
620#
621# my $test = Lingua::EN::Inflect::PL_N_eq $name, Lingua::EN::Inflect::PL $name;
622# my $pl = $test =~ /^(?:eq|p:.)$/
623# ? $name
624# : Lingua::EN::Inflect::PL $name;
625# die "$test $pl" if $pl =~ /bootss/;#d#
626#
627# if ($pl ne $a->{name_pl}) {
628# warn "$a->{_name}: plural differs, $pl vs $a->{name_pl}\n";
629# }
630# }
631 }
632
606 sub inst_arch($) { 633 sub inst_arch($) {
607 my (undef, $path) = @_; 634 my (undef, $path) = @_;
608 635
609 $PATH = $path; 636 $PATH = $path;
610 637
688 } 715 }
689 716
690 # remove base classes (by naming scheme, should use something like "baseclass xxx" to inherit 717 # remove base classes (by naming scheme, should use something like "baseclass xxx" to inherit
691 @ARC = grep $_->{_name} !~ /^(?:type|class)_/, @ARC; 718 @ARC = grep $_->{_name} !~ /^(?:type|class)_/, @ARC;
692 719
720 print "generating plurals...\n" if $VERBOSE;
721 generate_plurals;
722
693 print "writing archetypes...\n" if $VERBOSE; 723 print "writing archetypes...\n" if $VERBOSE;
694 open my $fh, ">:utf8", "$DATADIR/archetypes~" 724 open my $fh, ">:utf8", "$DATADIR/archetypes~"
695 or die "$DATADIR/archetypes~: $!"; 725 or die "$DATADIR/archetypes~: $!";
696 print $fh Deliantra::archlist_to_string [sort { $a->{_name} cmp $b->{_name} } @ARC]; 726 print $fh Deliantra::archlist_to_string [sort { $a->{_name} cmp $b->{_name} } @ARC];
697 } 727 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines