Changeset 2706

Show
Ignore:
Timestamp:
10/15/06 20:04:33 (7 years ago)
Author:
qldrob
Message:

Add temporary support for non-release versions of Asterisk, and make engine checking a bit more modular

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk/install_amp

    r2703 r2706  
    8888  out("  --force-version <ver>    Force upgrade from version <ver>"); 
    8989  out("  --no-files               Just run updates without installing files"); 
     90  out("  --my-svn-is-correct      Ignore Asterisk version, assume it is correct"); 
     91  out("  --engine <name>          Use the specified PBX Engine ('asterisk' or 'openpbx')"); 
    9092} 
    9193 
     
    575577// **** Parse out command-line options 
    576578$shortopts = "h?u:p:"; 
    577 $longopts = array("help","debug","dry-run","username=","password=","force-version=","dbhost=","no-files","dbname="); 
     579$longopts = array("help","debug","dry-run","username=","password=","force-version=","dbhost=","no-files","dbname=","my-svn-is-correct","engine"); 
    578580 
    579581$args = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), $shortopts, $longopts); 
     
    587589$dryrun = false; 
    588590$install_files = true; 
     591$override_astvers = false; 
    589592 
    590593//initialize variables to avoid php notices 
     
    631634      $install_files = false; 
    632635      out("Running upgrade only, without installing files."); 
     636    break; 
     637    case "--my-svn-is-correct": 
     638      $override_astvers = true; 
     639    break; 
     640    case "--engine": 
     641      $pbx_engine = $arg[1]; 
     642      if ($pbx_engine != 'asterisk') { 
     643        fatal('Currently only "asterisk" is supported as a PBX engine'); 
     644      } 
    633645    break; 
    634646/*    case "--fopwebroot": 
     
    783795if (isset($asterisk_conf['astlogdir'])) { $amp_conf['ASTLOGDIR'] = $asterisk_conf['astlogdir']; } 
    784796 
     797if (!isset($pbx_engine)) { $pbx_engine='asterisk'; } 
     798out("Using $pbx_engine as PBX Engine"); 
     799$amp_conf["AMPENGINE"]=$pbx_engine; 
     800 
    785801write_amportal_conf(AMP_CONF, $amp_conf); 
    786802 
     
    813829  } 
    814830  out("OK"); 
     831} elseif (preg_match('/^Asterisk SVN.+/', $verinfo)) { 
     832  out("FAIL"); 
     833  out("*** WARNING ***"); 
     834  out("You are not using a released version of Asterisk. We are unable to verify"); 
     835  out("that your Asterisk version is compatible with FreePBX. Whilst this probably"); 
     836  out("won't cause any problems, YOU NEED TO BE CERTAIN that it is compatible"); 
     837  out("with at least the released Asterisk version ".REQ_ASTERISK_VERSION."." ); 
     838  if ($override_astvers==false) { 
     839    out("If you are SURE that this is compatible, you can re-run ".$argv[0]." with"); 
     840    out("the parameter --my-svn-is-correct"); 
     841    exit; 
     842  } else { 
     843    out("--my-svn-is-correct specified, continuing"); 
     844  } 
    815845} else { 
    816846  fatal("Could not determine asterisk version (got: \"".$verinfo."\" please report this)");