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