Changeset 30155 in osm for applications/editors/josm/plugins/photoadjust/i18n/poimport.pl
- Timestamp:
- 2013-12-28T21:35:45+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/photoadjust
- Files:
-
- 1 added
- 1 edited
- 1 moved
-
. (modified) (1 prop)
-
i18n (added)
-
i18n/poimport.pl (moved) (moved from applications/editors/josm/plugins/photoadjust/poimport.pl ) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/photoadjust
-
Property svn:ignore
set to
josm_trans_*gz
build
po
-
Property svn:ignore
set to
-
applications/editors/josm/plugins/photoadjust/i18n/poimport.pl
r30149 r30155 1 1 #! /usr/bin/perl -w 2 ### 3 ### poimport.pl - Import the translation from the tarball downloaded 4 ### from Launchpad. 2 3 ##################################################################### 4 ### http://www.perl.com/doc/manual/html/utils/pod2man.html 5 ### http://search.cpan.org/dist/perl/pod/perlpod.pod 6 7 =head1 NAME 8 9 poimport.pl - Import the translation from the tarball downloaded from 10 Launchpad. 11 12 =head1 SYNOPSIS 13 14 B<poimport.pl> [B<--help>] [B<--man>] [B<--podir> I<po>] 15 [B<--workdir> I<poimport>] [B<--(no)rmworkdir>] I<tarball> 16 17 =head1 DESCRIPTION 18 19 Import the plugin translations from Launchpad. The argument 20 I<tarball> can be a tarball file that was downloaded from Launchpad, a 21 tarball download URL, a JOSM translation branch revision number 22 (e.g. I<789>), or the keyword I<latest> for the latest revision. 23 Default is to download the latest translation branch revision. 24 25 =head1 OPTIONS 26 27 =over 4 28 29 =item B<--help> 30 31 Prints a brief help message and exits. 32 33 =item B<--man> 34 35 Prints the manual page and exits. 36 37 =item B<--podir> 38 39 Destination directory relative to directory where this script was 40 started in. Default is F<po>. 41 42 =item B<--workdir> 43 44 Temporary directory. A unique directory name that is not used for 45 anything else. Default is F<poimport>. 46 47 =item B<--rmworkdir> 48 49 Remove the temporary directory after the work is done. Disable 50 removal with B<--normworkdir>. Default is to remove the temporary 51 directory. 52 53 =back 54 55 =cut 56 ##################################################################### 5 57 6 58 use strict; … … 9 61 use File::Spec::Functions; 10 62 use File::Basename; 63 use Getopt::Long; 64 use Pod::Usage; 11 65 12 66 ### Name of the tarball downloaded from Launchpad. Or download URL. 13 ### Or JOSM translation branch revision number. 14 my $tarball = "launchpad-export.tar.gz"; 67 ### Or JOSM translation branch revision number. Or keyword "latest". 68 my $tarball; 69 #$tarball = "launchpad-export.tar.gz"; 15 70 #$tarball = "http://launchpadlibrarian.net/159932691/launchpad-export.tar.gz"; 16 71 #$tarball = "http://bazaar.launchpad.net/~openstreetmap/josm/josm_trans/tarball/747"; 17 72 #$tarball = "747"; 18 ### Temporary directory. A unique directory name that is not used for 19 ### anything else. 20 my $workdir = "importpo"; 21 ### Remove the temp. directory after the work is done (0/1)? 22 my $rmworkdir = 1; 23 ### Destination directory relative to directory where this script was 24 ### started in. 25 my $podir = "po"; 73 #$tarball = "http://bazaar.launchpad.net/~openstreetmap/josm/josm_trans/tarball"; 74 $tarball = "latest"; 75 my $workdir = "poimport"; ### Temp. directory. 76 my $rmworkdir = 1; ### Remove the temp. directory (0/1)? 77 my $podir = "po"; ### Destination directory. 78 my $showhelp = 0; ### Show help screen. 79 my $showman = 0; ### Show manual page of this script. 80 81 GetOptions('help|?|h' => \$showhelp, 82 'man' => \$showman, 83 'podir=s' => \$podir, 84 'workdir=s' => \$workdir, 85 'rmworkdir!' => \$rmworkdir, 86 ) or pod2usage(2); 87 88 pod2usage(1) if $showhelp; 89 pod2usage(-exitstatus => 0, -verbose => 2) if $showman; 26 90 27 91 ### Check for arguments. The only supported argument is the tarball. … … 33 97 } 34 98 99 my $josmtburl = "http://bazaar.launchpad.net/~openstreetmap/josm/josm_trans/" 100 . "tarball"; 101 35 102 ### Check for JOSM translation branch revision number. 36 103 if ($tarball =~ m/^\d+$/) { 37 $tarball = "http://bazaar.launchpad.net/~openstreetmap/josm/josm_trans/" 38 . "tarball/" . $tarball; 104 $tarball = $josmtburl . "/" . $tarball; 105 } 106 ### Or for keyword "latest", i.e. the latest JOSM translation revision. 107 elsif ($tarball eq "latest") { 108 $tarball = $josmtburl; 39 109 } 40 110 … … 50 120 if ($tarball =~ m:/([^/]+)/tarball/(\d+)$:) { 51 121 $downfile = $1 . "_" . $2 . ".tar.gz"; 122 } 123 else { 124 $downfile .= ".tar.gz"; 125 } 126 } 127 elsif ($downfile eq "tarball") { 128 ### Download of latest revision. 129 if ($tarball =~ m:/([^/]+)/tarball$:) { 130 $downfile = $1 . "_latest.tar.gz"; 52 131 } 53 132 else {
Note:
See TracChangeset
for help on using the changeset viewer.
