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 | 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 | }
|
---|
44 | system "rm -rf getrev" if !$oldsvn;
|
---|