source: osm/applications/editors/josm/i18n/launchpad.pl@ 26927

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
3use strict;
4
5my $count = 0;#11;
6my $cleanall = 0;#1;
7
8if($#ARGV != 0)
9{
10 warn "URL not given."
11}
12else
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}
41system "ant";
42my $outdate = `date -u +"%Y-%m-%dT%H_%M_%S"`;
43chomp $outdate;
44mkdir "build/josm";
45system "cp po/*.po po/josm.pot build/josm";
46chdir "build";
47if(!$count)
48{
49 system "tar -cjf launchpad_upload_josm_$outdate.tar.bz2 josm";
50}
51else
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}
62system "rm -rv josm new";
63chdir "..";
Note: See TracBrowser for help on using the repository browser.