Last change
on this file since 34151 was 31033, checked in by stoecker, 10 years ago |
fix false detected string in trustosm plugin
|
File size:
1.0 KB
|
Rev | Line | |
---|
[14124] | 1 | #! /usr/bin/perl -w
|
---|
| 2 |
|
---|
| 3 | # Written by Dirk Stöcker <openstreetmap@dstoecker.de>
|
---|
| 4 | # Public domain, no rights reserved.
|
---|
| 5 |
|
---|
| 6 | use strict;
|
---|
| 7 |
|
---|
| 8 | # This is a simple conversion and in no way a complete XML parser
|
---|
| 9 | # but it works with a default Perl installation
|
---|
| 10 |
|
---|
| 11 | # Print a header to write valid Java code.
|
---|
| 12 | print "class trans_plugins { void tr(String s){} void f() {\n";
|
---|
| 13 |
|
---|
| 14 | foreach my $arg (@ARGV)
|
---|
| 15 | {
|
---|
| 16 | foreach my $name (glob $arg)
|
---|
| 17 | {
|
---|
| 18 | my $printed = 0;
|
---|
| 19 | die "Can't open $name." if !(open FILE,"<",$name);
|
---|
| 20 | my $plugin = $name;
|
---|
| 21 | while(my $line = <FILE>)
|
---|
| 22 | {
|
---|
| 23 | chomp($line);
|
---|
[28990] | 24 | if($line =~ /name=\"[Pp]lugin.[Dd]escription\" +value=\"(.*)\"/)
|
---|
[14124] | 25 | {
|
---|
[31033] | 26 | my $descr = $1;
|
---|
| 27 | next if $descr eq '${plugin.description}';
|
---|
[14124] | 28 | $printed = 1;
|
---|
[31033] | 29 | print "/* Plugin $plugin */\ntr(\"$descr\");\n" if($plugin ne "myPluginName");
|
---|
[14124] | 30 | }
|
---|
| 31 | elsif($line =~ /project name=\"(.*?)\"/)
|
---|
| 32 | {
|
---|
| 33 | $plugin = $1;
|
---|
| 34 | }
|
---|
| 35 | }
|
---|
| 36 | close FILE;
|
---|
| 37 | print "/* File $name had no data */\n" if(!$printed);
|
---|
| 38 | }
|
---|
| 39 | }
|
---|
| 40 |
|
---|
| 41 | print "}}\n";
|
---|
Note:
See
TracBrowser
for help on using the repository browser.