Last change
on this file since 30130 was 30130, checked in by holgermappt, 12 years ago |
Initial checkin of JOSM PhotoAdjust plugin.
|
-
Property svn:executable
set to
*
|
File size:
1002 bytes
|
Line | |
---|
1 | #! /usr/bin/perl -w
|
---|
2 | ###
|
---|
3 | ### importpo.pl - Import the translation from the tarball downloaded
|
---|
4 | ### from Launchpad.
|
---|
5 |
|
---|
6 | use strict;
|
---|
7 | use File::Copy;
|
---|
8 | use Cwd;
|
---|
9 | use File::Spec::Functions;
|
---|
10 |
|
---|
11 | ### Name of the tarball downloaded from Launchpad.
|
---|
12 | my $tarball = "launchpad-export.tar.gz";
|
---|
13 | ### Temporary directory.
|
---|
14 | my $workdir = "importpo";
|
---|
15 | ### Remove the temp. directory after the work is done (0/1)?
|
---|
16 | my $rmworkdir = 1;
|
---|
17 | ### Destination directory relative to directory where this script was
|
---|
18 | ### started in.
|
---|
19 | my $podir = "po";
|
---|
20 |
|
---|
21 | die "Tarball $tarball not found.\n" if (! -r $tarball);
|
---|
22 | if (! -d $workdir) {
|
---|
23 | mkdir $workdir or die "Failed to create directory $workdir: $!";
|
---|
24 | }
|
---|
25 | copy($tarball, $workdir);
|
---|
26 | my $startdir = getcwd();
|
---|
27 | chdir $workdir;
|
---|
28 | system "tar -xf $tarball";
|
---|
29 | foreach my $lpponame (split("\n", `find po -name "*.po"`)) {
|
---|
30 | if ($lpponame =~ /([a-zA-Z_]+\.po)/) {
|
---|
31 | my $poname = $1;
|
---|
32 | copy($lpponame, catfile($startdir, $podir, $poname));
|
---|
33 | }
|
---|
34 | }
|
---|
35 |
|
---|
36 | if ($rmworkdir) {
|
---|
37 | chdir $startdir;
|
---|
38 | system "rm -rf $workdir";
|
---|
39 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.