source: osm/applications/editors/josm/dist/getversions@ 30690

Last change on this file since 30690 was 29437, checked in by stoecker, 12 years ago

update for newer svn

  • Property svn:executable set to *
File size: 1.4 KB
Line 
1#! /usr/bin/perl -w
2
3my $oldsvn = 0; # before 1.7
4my $maxlength = 0;
5my @names = glob "*.jar";
6
7foreach my $plugin (@names)
8{
9 my $l = length($plugin);
10 $maxlength = $l if $l > $maxlength;
11}
12
13system "svn -q export -r BASE . getrev" if !$oldsvn;
14foreach my $plugin (@names)
15{
16 my $date = "";
17 my $version = "";
18 my $mversion = "";
19 my $manifest = `unzip -c $plugin META-INF/MANIFEST.MF`;
20 if($manifest)
21 {
22 $date = $1 if $manifest =~ /Plugin-Date: ([^\r\n]+)/;
23 $version = $1 if $manifest =~ /Plugin-Version: ([^\r\n]+)/;
24 $mversion = $1 if $manifest =~ /Plugin-Mainversion: ([^\r\n]+)/;
25 }
26 printf "%-${maxlength}s %28s %6s (%4s)", $plugin,$date,$version,$mversion;
27 my $svnfile = $oldsvn ? ".svn/text-base/$plugin.svn-base" : "getrev/$plugin";
28 if(-f $svnfile && ($manifest = `unzip -c $svnfile META-INF/MANIFEST.MF`))
29 {
30 my $svndate = "";
31 my $svnversion = "";
32 my $svnmversion = "";
33 $svndate = $1 if $manifest =~ /Plugin-Date: ([^\r\n]+)/;
34 $svnversion = $1 if $manifest =~ /Plugin-Version: ([^\r\n]+)/;
35 $svnmversion = $1 if $manifest =~ /Plugin-Mainversion: ([^\r\n]+)/;
36 my $changed = ($svndate ne $date || $svnversion ne $version);
37 my $changedm = $svnmversion ne $mversion;
38 printf " SVN: %28s %6s (%4s)%s%s", $svndate,$svnversion,$svnmversion,
39 $changed ? " changed" : "", $changedm ? " main" : "";
40 `svn revert $plugin` if !$changed && !$changedm;
41 }
42 printf "\n";
43}
44system "rm -rf getrev" if !$oldsvn;
Note: See TracBrowser for help on using the repository browser.