lilypond-0.0.77.jcn1
[lilypond.git] / bin / show-latest
blob066a26fe3b5d0d400271dbfd0eec3e486dcfa0b0
1 #!/usr/bin/perl
4 $reldir="~/musix/releases";
6 use FileHandle;
8 sub cmpver
9 {
11 my(@a)= split /\./,$a;
12 my(@b)= split /\./,$b;
14 for $i (0,1,2) {
15 return $a[$i] <=> $b[$i] if ($a[$i] != $b[$i]);
17 return $a cmp $b;
20 my @versions;
21 open LS, "ls -1 $reldir|";
24 while (<LS>) {
26 $_ =~ /lilypond-([^.]+\.[^.]+\.[^.]+).tar.gz/;
27 push @versions, $1;
31 @versions = sort cmpver @versions;
32 my $last= (pop @versions);
35 system "rm $reldir/zZ*";
36 system "> $reldir/zZ_LATEST_IS_$last";
38 open NEWS, "tar --to-stdout -zxf $reldir/lilypond-$last.tar.gz lilypond-$last/NEWS |";
39 input_record_separator NEWS "****";
40 $desc = <NEWS>;
41 chop ($desc);
42 close NEWS;
43 print $desc;