X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.web-live.git;a=blobdiff_plain;f=pctb%2Fdictionary-update-receiver;fp=pctb%2Fdictionary-update-receiver;h=727b94b47851df7f9e8b1cf04ed11960e3eefe22;hp=9132c4e9d22036ab35a249ffbe8e54d388666662;hb=f9e9ccb00d5761e861ead0795c711f595d8db3ff;hpb=6bc2ac751dfd2cd3633e94388b6c1f5a52abb5ae diff --git a/pctb/dictionary-update-receiver b/pctb/dictionary-update-receiver index 9132c4e..727b94b 100755 --- a/pctb/dictionary-update-receiver +++ b/pctb/dictionary-update-receiver @@ -30,7 +30,7 @@ use IO::Handle; sub parseentryin__pixmap ($) { my ($entry_in) = @_; $entry_in =~ - m/^(\w+ \- \w[-+'"#! 0-9a-z]*)\nP3\n([1-9]\d{1,3}) ([1-9]\d{1,3})\n255\n/s or die; # ']); + m/^(\w+ \- \w[-+\'\"\#! 0-9a-z]*)\nP3\n([1-9]\d{1,3}) ([1-9]\d{1,3})\n255\n/s or die; my ($def,$w,$h)= ($1, $2+0, $3+0); my @d= grep { m/./ } split /\s+/, $'; @d == $w*$h*3 or die "$d[0]|$d[1]|...|$d[$#d-1]|$d[$#d] ?"; @@ -157,8 +157,9 @@ my $path= path_info(); my $entry_in= param('entry'); defined $entry_in or die; -my $owner= `whoami`; $? and die $?; -chomp $owner; +my $du=$ENV{'YPPSC_DICTUPDATES'}; +chdir $du or die "$du $!" + if defined $du; my $kind; @@ -170,6 +171,17 @@ if ($path =~ /(pixmap|char)/) { my ($ctx,$def,$entry,$icon,$width,$whole)= &{"parseentryin__$kind"}($entry_in); +my $fn_t= "_update.$$-xxxxxxxxxxxxxxxx.tmp"; +open F, "> $fn_t" or die "$fn_t $!"; +(stat F) or die $!; +my $fn_i= sprintf "_update.$$-%016x.rdy", (stat _)[1]; + +print F $whole or die $!; +close F or die $!; +rename $fn_t, $fn_i or die "$fn_t $fn_i $!"; + +__END__ + $icon =~ s/^/ /mg; my $email= <