Ignore:
Timestamp:
2000-08-21T22:40:55+12:00 (24 years ago)
Author:
sjboddie
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/bin/script/build

    r1431 r1438  
    33# This perl script may be called directly or by running build.bat on
    44# windows (build.bat is in bin\windows)
     5
     6use FileHandle;
    57
    68BEGIN {
     
    1113    "run setup.bat (windows)?\n" unless defined $ENV{'GSDLOS'};
    1214    unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
     15
     16    STDOUT->autoflush(1);
     17    STDERR->autoflush(1);
    1318}
    1419
    1520use parsargv;
    1621use util;
    17 use FileHandle;
    1822
    1923if (!parsargv::parse(\@ARGV,
     
    153157        print $out "       or archives data. Try downloading an unbuilt version\n";
    154158        print $out "       of the collection from www.nzdl.org\n";
     159        &final_out (1) if $use_out;
    155160        die "\n";
    156161    }
    157162    }
     163    &final_out (0) if $use_out;
    158164}
    159165
     
    177183    }
    178184    } else {
     185    &final_out (2) if $use_out;
    179186    die "\nimport.pl failed\n";
    180187    }
     
    200207    }
    201208    } else {
     209    &final_out (2) if $use_out;
    202210    die "\nbuildcol.pl failed\n";
    203211    }
     
    239247    &util::rm ($file);
    240248}
     249
     250# creates a file called $outfile.final (should only be called if -out option
     251# is used and isn't STDERR or STDOUT) and writes an output code to it.
     252# An output code of 0 specifies that there was no error
     253sub final_out {
     254    my ($exit_code) = @_;
     255
     256    if (open (FINAL, ">$outfile.final")) {
     257    print FINAL $exit_code;
     258    close FINAL;
     259    }
     260}
Note: See TracChangeset for help on using the changeset viewer.