Changeset 1438 for trunk


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

* empty log message *

Location:
trunk/gsdl
Files:
4 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}
  • trunk/gsdl/lib/fileutil.cpp

    r1437 r1438  
    263263  ifstream file_in (filenamec);
    264264  if (file_in) {
    265     file_in.seekg (256, ios::end);
     265    file_in.seekg (-256, ios::end);
    266266    char c;
    267267    file_in.get(c);
    268268    while (!file_in.eof()) {
    269       if (c == '\n') return_str.clear();
    270       else return_str.push_back (c);
     269      if (c == '\n') {
     270    file_in.get(c);
     271    if (!file_in.eof()) {
     272      return_str.clear();
     273      if (c == '\\') return_str.push_back ('\\');
     274      return_str.push_back (c);
     275    }
     276      } else {
     277    if (c == '\\') return_str.push_back ('\\');
     278    return_str.push_back (c);
     279      }
    271280      file_in.get(c);
    272281    }
    273282    file_in.close();
     283
    274284  }
    275285  delete filenamec;
  • trunk/gsdl/macros/collect.dm

    r1437 r1438  
    630630}
    631631
    632 _bildstatusscriptextra_ {}
     632# special header for status page
     633_bildstatusheader_ {_cgihead_
     634_htmlhead_(background="_httpiconchalk_" onLoad="initialize();")_startspacer_
     635}
     636_bildstatusheader_[v=1] {_cgihead_
     637_htmlhead_(onLoad="initialize();")
     638}
     639
     640_bildstatusscriptextra_ {
     641var timer = 5;
     642function initialize() \{
     643  setTimeout("count_down()",1000);
     644\}
     645
     646function count_down() \{
     647  if (timer==0) \{
     648    document.collectorform.submit();
     649  \} else \{
     650    window.status = "Building status update in  "+timer+" seconds";
     651    timer--;
     652    setTimeout("count_down()",1000);
     653  \}   
     654\}
     655}
     656
    633657_bildstatuscontent_ {
     658<form name="collectorform" method=post action="_gwcgi_">
     659<input type=hidden name="e" value="_decodedcompressedoptions_">
    634660<center>
    635661<table width=_pagewidth_>
     
    638664</td></tr>
    639665</table></center>
     666</form>
    640667}
    641668
  • trunk/gsdl/src/recpt/collectoraction.cpp

    r1437 r1438  
    238238                     ostream &logout) {
    239239
    240   if (args["cp"] != "intro") {
     240  text_t &current_page = args["cp"];
     241
     242  if (current_page != "intro") {
    241243    // authenticate the user if authentication is available
    242244    args["uan"] = 1;
     
    276278    // turned on).
    277279    update_cfgfile_clone (args, logout);
     280  }
     281
     282  if (current_page == "bildstatus") {
     283    // if .final file exists then build has finished
     284    text_t fbld = filename_cat (gsdlhome, "tmp", args["bc1dirname"] + ".bld.final");
     285    if (file_exists (fbld)) {
     286      char *fbldc = fbld.getcstr();
     287      ifstream fbld_in (fbldc);
     288      if (fbld_in) {
     289    char c = fbld_in.get();
     290    fbld_in.close();
     291    if (c == '0') current_page = "bilddone";
     292    else current_page = "bildfail";
     293      } else {
     294    // assume build failed (we shouldn't get here though ... right?)
     295    current_page = "bildfail";
     296      }
     297      delete fbldc;
     298    }
    278299  }
    279300
     
    644665  // _cfgfile_ -- if displaying the "configure collection" page
    645666  // _statusline_ -- if displaying the bildstatus page
    646   // _pagebanner_ -- may be set to _collector:plainbanner_ for some pages
     667  // _header_ -- may be set for pages that require it
    647668
    648669  text_t &collector_page = args["cp"];
     
    653674  disp.setmacro ("pagescriptextra", "collector", "_" + collector_page + "scriptextra_");
    654675
    655   // set _pagebanner_ for those pages that don't want a fancy header (e.g. those
    656   // displayed in frames
    657676  if (collector_page == "bildstatus") {
    658     disp.setmacro ("pagebanner", "collector", "_plainbanner_");
     677    disp.setmacro ("header", "collector", "_" + collector_page + "header_");
    659678  }
    660679
Note: See TracChangeset for help on using the changeset viewer.