source: subversion/applications/editors/merkaartor/translations/maketar.pl @ 13794

Last change on this file since 13794 was 13794, checked in by Dirk Stoecker, 11 years ago

added tar-file creation

  • Property svn:executable set to *
File size: 1.1 KB
Line 
1#! /usr/bin/perl -w
2
3use utf8;
4use encoding "utf8";
5use File::Copy;
6
7my %files = map {$_ => undef} ("merkaartor", "templates");
8my $templ = "(".join("|",keys %files).")";
9foreach my $f (@ARGV)
10{
11  if($f =~ /\*/) { printf "Skipping $f\n"; }
12  elsif($f =~ /${templ}_(.*)\.po$/) { $files{$1}{$2} = $f; }
13  elsif($f =~ /${templ}\.pot$/) { $files{$1}{pot} = $f; }
14  else { die "unknown file name $f."; }
15}
16mkdir "upl";
17foreach my $t (keys %files)
18{
19  mkdir "upl/$t";
20}
21
22my $temp = "templates";
23copy($files{$temp}{"pot"}, "upl/$temp/$temp.pot");
24foreach my $t (keys %{$files{$temp}})
25{
26  next if $t =~ /\.pot$/;
27  copy($files{$temp}{$t}, "upl/$temp/$t.po");
28}
29
30$temp = "merkaartor";
31copy($files{$temp}{"pot"}, "upl/$temp/$temp.pot");
32foreach my $t (keys %{$files{$temp}})
33{
34  next if $t =~ /\.pot$/;
35  copy($files{$temp}{$t}, "upl/$temp/$t.po") if -f "${temp}_$t.ts";
36}
37
38chdir "upl";
39my @t=gmtime();
40my $date=sprintf("%04d-%02d-%02d_%02d_%02d", 1900+$t[5],$t[4]+1,$t[3],$t[2],$t[1]);
41
42system "tar -czf ../${date}_launchpad_upload.tgz *";
43chdir "..";
44
45foreach my $t (keys %files)
46{
47  unlink glob("upl/$t/*");
48  rmdir "upl/$t";
49}
50rmdir "upl"
Note: See TracBrowser for help on using the repository browser.