Changeset 1783


Ignore:
Timestamp:
2000-12-12T11:51:57+13:00 (23 years ago)
Author:
sjboddie
Message:

Added a check to make sure perl is functional before using the collector

Location:
trunk/gsdl
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/lib/gsdltools.cpp

    r1678 r1783  
    167167  return rv;
    168168}
     169
     170// attempts to work out if perl is functional
     171bool perl_ok () {
     172  int i = system ("perl -e exit(-10)");
     173  return (i == -10);
     174}
  • trunk/gsdl/lib/gsdltools.h

    r1678 r1783  
    7070int gsdl_call_perl (char *perl_cmd, ...);
    7171
     72// attempts to work out if perl is functional
     73bool perl_ok ();
    7274
    7375#endif
  • trunk/gsdl/src/recpt/collectoraction.cpp

    r1778 r1783  
    996996  }
    997997
     998  // make sure we have perl
     999  if (!perl_ok()) {
     1000    textout << outconvert
     1001        << "<html>\n"
     1002        << "<head>\n"
     1003        << "<title>Perl not found</title>\n"
     1004        << "</head>\n"
     1005        << "<body bgcolor=\"#ffffff\" text=\"#000000\" link=\"#006666\" "
     1006        << "alink=\"#cc9900\" vlink=\"#666633\">\n"
     1007        << "<h2>Perl not found</h2>\n"
     1008        << "Greenstone could not detect perl on this system. The Collector\n"
     1009        << "end-user collection building facility is therefore not available.\n"
     1010        << "\n</body>\n"
     1011        << "</html>\n";
     1012    return true;
     1013
     1014  }
     1015
    9981016  text_t &collector_page = args["cp"];
    9991017  text_t &collection = args["bc1dirname"];
Note: See TracChangeset for help on using the changeset viewer.