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