]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.10
authorfred <fred>
Wed, 20 Aug 1997 23:43:33 +0000 (23:43 +0000)
committerfred <fred>
Wed, 20 Aug 1997 23:43:33 +0000 (23:43 +0000)
bin/mudela-book.in

index 374f223a1f4f0c29aecc2ff6b1e13d3dd12a9da4..9aec75cb60a40c9ca6f870a8557e25b2b970b8ea 100644 (file)
@@ -6,6 +6,29 @@ my $outname = "-";
 my $outdir;
 use Getopt::Long;
 
+
+# do something, check return status
+sub my_system
+{
+    my (@cmds) = @_;
+    foreach $cmd (@cmds) {
+       my ($ignoreret)=0;
+       if ( $cmd  =~ /^-/ ) {
+           $ignoreret = 1;
+           $cmd = substr ($cmd, 1);
+       }
+       
+       my $ret =  ( system ($cmd));
+       if ($ret) {
+           if ($ignoreret) {
+               print STDERR "ignoring failed command \`$cmd\' (status $ret)\n";
+           }else {
+               print STDERR "\nmudela-book: failed on command \`$cmd\' (status $ret)\n";
+               exit 2;
+           }
+       }
+    }
+}
 sub gen_mufile
 {
     return "$outdir/$outname$mudcount.ly";
@@ -40,7 +63,7 @@ sub close_mudela
     }
     
     if ( ! -f gen_texfile) {
-       system "lilypond ". gen_mufile;
+       my_system "lilypond ". gen_mufile;
        rename "lelie.tex", gen_texfile;
     }
     print BOOK "\\preexample\\input " . gen_texfile . "\n\\postexample\n";