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

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
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 "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}
40system "ant";
41my $outdate = `date -u +"%Y-%m-%dT%H_%M_%S"`;
42chomp $outdate;
43mkdir "josm";
44system "cp po/*.po po/josm.pot josm";
45if(!$count)
46{
47 system "tar -cjf launchpad_upload_josm_$outdate.tar.bz2 josm";
48}
49else
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}
60system "rm -rv josm new";
Note: See TracBrowser for help on using the repository browser.