#!@PERL@ # -*-Perl-*- $reldir="/home/hanwen/musix/releases"; use FileHandle; use Getopt::Long; sub cmpver { my(@a)= split( /\./, $a); my(@b)= split( /\./, $b); for $i (0,1,2) { return $a[$i] <=> $b[$i] if ($a[$i] != $b[$i]); } return $a cmp $b; } my @versions; open LS, "ls -1 $reldir|"; GetOptions( 'print', 'news', 'latest'); while () { $_ =~ /lilypond-([^.]+\.[^.]+\.[^.]+).tar.gz/; push @versions, $1; } @versions = sort cmpver @versions; my $last= (pop @versions); if ( $opt_print ) { print $last; } if ( $opt_latest) { system "rm $reldir/zZ*"; system "> $reldir/zZ_LATEST_IS_$last"; } if ( $opt_news ) { open NEWS, "tar --to-stdout -zxf $reldir/lilypond-$last.tar.gz lilypond-$last/NEWS |"; input_record_separator NEWS "****"; $desc = ; chop ($desc); close NEWS; print $desc; }