CC-3072: Test upgrade to 2.0.0 from 1.8.0 and up (including minor versions, except 1.9.1)

This commit is contained in:
Martin Konecny 2011-11-23 13:59:10 -05:00
parent 8231df6c44
commit d71c2289ac
4 changed files with 54 additions and 7 deletions

View file

@ -7,6 +7,11 @@
* Checks if a current version of Airtime is installed.
* If so, the user is presented with the help menu and can
* choose -r to reinstall.
*
* Returns 0 if Airtime is not installed
* Returns 1 if a previous version of Airtime installed
* Returns 2 if the same version of Airtime is installed
* Returns 3 if a version of Airtime that we can't upgrade from is installed.
*/
require_once(dirname(__FILE__).'/AirtimeInstall.php');
require_once(__DIR__.'/airtime-constants.php');
@ -15,24 +20,32 @@ AirtimeInstall::ExitIfNotRoot();
$opts = AirtimeInstall::getOpts();
if ($opts == NULL) {
exit(1);
exit(2);
}
if (isset($opts->h)) {
AirtimeInstall::printUsage($opts);
exit(1);
exit(2);
}
$version = AirtimeInstall::GetVersionInstalled();
// The current version is already installed.
if (isset($version) && ($version != false) && ($version == AIRTIME_VERSION) && !isset($opts->r)) {
echo "Airtime $version is already installed.".PHP_EOL;
AirtimeInstall::printUsage($opts);
exit(1);
echo "* Checking for existing install of Airtime...".PHP_EOL;
if (isset($version) && ($version != false)){
if (($version == AIRTIME_VERSION) && !isset($opts->r)) {
echo "Airtime $version is already installed.".PHP_EOL;
AirtimeInstall::printUsage($opts);
exit(2);
} else if (strcmp($version, AIRTIME_VERSION) < 0){
echo " * Found previous version: $version".PHP_EOL;
exit(1);
}
} else {
echo " * Not Found".PHP_EOL;
}
if($version === false){
echo "A version of Airtime older than 1.7.0 detected, please upgrade to 1.7.0 first.\n";
echo "You will then be able to upgrade to 1.9.0 using this installer.\n";
exit(3);
}
}