]> git.donarmstrong.com Git - lilypond.git/blobdiff - bin/show-latest.in
partial: 0.1.57.jcn
[lilypond.git] / bin / show-latest.in
old mode 100644 (file)
new mode 100755 (executable)
index e87a6ad..1c3d14d
@@ -1,28 +1,30 @@
 #!@PERL@
+# -*-Perl-*-
 
 
-$reldir="~/musix/releases";
+$reldir="/home/hanwen/musix/releases";
 
 use FileHandle;
+use Getopt::Long;
 
-sub  cmpver 
+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(@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 (<LS>) {
-       
     $_ =~ /lilypond-([^.]+\.[^.]+\.[^.]+).tar.gz/;
     push @versions, $1;
 }
@@ -32,12 +34,20 @@ while (<LS>) {
 my $last= (pop @versions);
 
 
-system "rm $reldir/zZ*";
-system  "> $reldir/zZ_LATEST_IS_$last";
+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 = <NEWS>;
+    chop ($desc);
+    close NEWS;
 
-open NEWS, "tar --to-stdout  -zxf $reldir/lilypond-$last.tar.gz lilypond-$last/NEWS |";
-input_record_separator NEWS "****";
-$desc = <NEWS>;
-chop ($desc);
-close NEWS;
     print $desc;
+}