
// default values
//
// no update until we found a valid version
$update = false;
// is it a complete install file or a diff. If its a diff, set
// it to "partial". For major Update, only comlete update will be provided.
$update_patchType = "partial";
$update_complete = false;
$update_partial = false;
//By default, this update is a "Minor" update
$update_type = "minor";
// If set to false, only minor update can be downloaded.
{
    my $c = esmith::ConfigDB->open_ro('Mozus');
    my $major_enabled = $c->get('Mozus')->prop('enablemajor') || "disabled";
    if ( $major_enabled eq 'enabled'){
	$OUT .= "\$major_update_enabled = true;\n";
    }elsif ($major_enabled eq 'disabled'){
	$OUT .= "\$major_update_enabled = false;\n";
    }
    my @authorized_version = split('@', $c->get('Mozus')->prop('version') || "10");
    $OUT .= "\$authorized_version = array(";
    my $count_version = 0;
    foreach my $auth_version (@authorized_version) {
	$OUT .= "\"$auth_version\"";
	$count_version++;
	if ( $count_version != scalar(@authorized_version) ) {
		$OUT .= ",";
	}else{
		$OUT .= ");";
	}
    }		
}
$major = false;
// A simple HTML page that is shown during the update process. Usually
// contains new features or relevant information for the update. (Not supported for now)
$update_detailsURL = "http://www.{ $DomainName }/moz-updates/moz-updates.html";
// default lang. Will be pushed regardless of the client language 
// if the language requested not stored.
{
    my $c = esmith::ConfigDB->open_ro('Mozus');
    my $DefaultLang = $c->get('Mozus')->prop('DefaultLang') || "fr";
    $OUT .= "\$update_lang = \"". $DefaultLang ."\";";
}
//Allow Thunderbird or Firefox for updates
{
    my $c = esmith::ConfigDB->open_ro('Mozus');
    my $ff_enabled = $c->get('Mozus')->prop('firefox') || "disabled";
    my $tb_enabled = $c->get('Mozus')->prop('thunderbird') || "disabled";
    if ($ff_enabled eq 'enabled'){
	$OUT .= "\$update_firefox = true;\n";
    }elsif ($ff_enabled eq 'disabled'){
	$OUT .= "\$update_firefox = false;\n";
    }
    if ($tb_enabled eq 'enabled'){
	$OUT .= "\$update_thunderbird = true;\n";
    }elsif ($tb_enabled eq 'disabled'){
	$OUT .= "\$update_thunderbird = false;\n";
    }
}


