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

Last change on this file since 34201 was 32307, checked in by stoecker, 9 years ago

fix JAR file, allow larger numbers in getversions script

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