Last change
on this file since 26927 was 26849, checked in by stoecker, 13 years ago |
JOSM i18n update
|
-
Property svn:executable
set to
*
|
File size:
1.3 KB
|
Line | |
---|
1 | #!/usr/bin/perl -w
|
---|
2 |
|
---|
3 | use strict;
|
---|
4 |
|
---|
5 | my $count = 0;#11;
|
---|
6 | my $cleanall = 0;#1;
|
---|
7 |
|
---|
8 | if($#ARGV != 0)
|
---|
9 | {
|
---|
10 | warn "URL not given."
|
---|
11 | }
|
---|
12 | else
|
---|
13 | {
|
---|
14 | mkdir "build";
|
---|
15 | mkdir "build/new";
|
---|
16 | die "Could not change into new data dir." if !chdir "build/new";
|
---|
17 | system "wget $ARGV[0]";
|
---|
18 | system "tar -xf laun*";
|
---|
19 | chdir "../..";
|
---|
20 | foreach my $name (split("\n", `find build/new -name "*.po"`))
|
---|
21 | {
|
---|
22 | my $a=$name;
|
---|
23 | $a =~ s/.*-//;
|
---|
24 | if(-f "po/$a")
|
---|
25 | {
|
---|
26 | system "mv -v $name po/$a";
|
---|
27 | }
|
---|
28 | elsif($cleanall)
|
---|
29 | {
|
---|
30 | local $/; undef $/;
|
---|
31 | open FILE,"<",$name or die;
|
---|
32 | my $x = <FILE>;
|
---|
33 | close FILE;
|
---|
34 | $x =~ s/\n\n.*$/\n/s;
|
---|
35 | open FILE,">","po/$a" or die;
|
---|
36 | print FILE $x;
|
---|
37 | close FILE;
|
---|
38 | }
|
---|
39 | }
|
---|
40 | }
|
---|
41 | system "ant";
|
---|
42 | my $outdate = `date -u +"%Y-%m-%dT%H_%M_%S"`;
|
---|
43 | chomp $outdate;
|
---|
44 | mkdir "build/josm";
|
---|
45 | system "cp po/*.po po/josm.pot build/josm";
|
---|
46 | chdir "build";
|
---|
47 | if(!$count)
|
---|
48 | {
|
---|
49 | system "tar -cjf launchpad_upload_josm_$outdate.tar.bz2 josm";
|
---|
50 | }
|
---|
51 | else
|
---|
52 | {
|
---|
53 | my @files = sort glob("josm/*.po");
|
---|
54 | my $num = 1;
|
---|
55 | while($#files >= 0)
|
---|
56 | {
|
---|
57 | my @f = splice(@files, 0, $count);
|
---|
58 | system "tar -cjf launchpad_upload_josm_${outdate}_$num.tar.bz2 josm/josm.pot ".join(" ",@f);
|
---|
59 | ++$num;
|
---|
60 | }
|
---|
61 | }
|
---|
62 | system "rm -rv josm new";
|
---|
63 | chdir "..";
|
---|
Note:
See
TracBrowser
for help on using the repository browser.