X-Git-Url: https://git.treefish.org/fex.git/blobdiff_plain/c65ee6f7429eff9a7f58aad7c0aec858ad473092..cdeb354c4dbb11b683f9f8c5db2861f3dc572c61:/locale/translate?ds=inline diff --git a/locale/translate b/locale/translate index 2fdd709..8d581ec 100755 --- a/locale/translate +++ b/locale/translate @@ -34,6 +34,8 @@ use File::Copy; $> = $FEX[2]; $) = $FEX[3]; +umask 022; + $FEXHOME = $ENV{FEXHOME} || $FEX[7]; # require "$FEXHOME/lib/fex.pp" @@ -101,43 +103,47 @@ foreach $file (@trfiles) { print "$ft written\n"; } -foreach $file (@cpfiles) { - my $fs = "locale/$lang/$file"; - if (-e $fs) { - my $fd = "$FEXHOME/$fs"; - mkdirp(dirname($fd)); - if (-f $fs) { - $fd .= '_new' if -e $fd; - if (copy($fs,$fd)) { - chmod((stat $fs)[2],$fd); - print "$fd written\n"; - } - } else { - if (-f $fd) { - my $fds = $fd.'_save'; - my $fdn = $fd.'_new'; - system "rm -rf $fds $fdn"; - rename $fd,$fds; - system "tar cf - $fs | (cd $FEXHOME; tar xf -)"; - rename $fd,$fdn; - rename $fds,$fd; - print "$fdn written\n"; +if ($FEXHOME !~ /fexdev/) { + + foreach $file (@cpfiles) { + my $fs = "locale/$lang/$file"; + if (-e $fs) { + my $fd = "$FEXHOME/$fs"; + mkdirp(dirname($fd)); + if (-f $fs) { + $fd .= '_new' if -e $fd; + if (copy($fs,$fd)) { + chmod((stat $fs)[2],$fd); + print "$fd written\n"; + } } else { - system "tar cf - $fs | (cd $FEXHOME; tar xf -)"; - print "$fd written\n"; + if (-f $fd) { + my $fds = $fd.'_save'; + my $fdn = $fd.'_new'; + system "rm -rf $fds $fdn"; + rename $fd,$fds; + system "tar cf - $fs | (cd $FEXHOME; tar xf -)"; + rename $fd,$fdn; + rename $fds,$fd; + print "$fdn written\n"; + } else { + system "tar cf - $fs | (cd $FEXHOME; tar xf -)"; + print "$fd written\n"; + } } } } -} -foreach $fs (qw(fex.ph dop)) { - $fd = "$FEXHOME/locale/$lang/lib/$fs"; - symlink "../../../lib/$fs",$fd and print "$fd linked\n"; -} + foreach $fs (qw(fex.ph dop)) { + $fd = "$FEXHOME/locale/$lang/lib/$fs"; + symlink "../../../lib/$fs",$fd and print "$fd linked\n"; + } + + unless (-f "$FEXHOME/locale/$lang/htdocs/FAQ/meta.faq") { + unlink "$FEXHOME/locale/$lang/htdocs/FAQ/FAQ.html"; + rmdir "$FEXHOME/locale/$lang/htdocs/FAQ"; + } -unless (-f "$FEXHOME/locale/$lang/htdocs/FAQ/meta.faq") { - unlink "$FEXHOME/locale/$lang/htdocs/FAQ/FAQ.html"; - rmdir "$FEXHOME/locale/$lang/htdocs/FAQ"; } make_lf($lang);