[272958] separate trains from generate1.php, craft a 'promote' build script
diff --git a/classes/export/generate1.php b/classes/export/generate1.php
index 45d9ca9..ef9952a 100755
--- a/classes/export/generate1.php
+++ b/classes/export/generate1.php
@@ -37,9 +37,13 @@
# Command-line parameter for the release train
# bug 272958
+# b: build id
+# t: (optional: train id)
+
+$options = getopt("b:t:");
$argv_train = "";
-if(isset($argv[1])) {
- $argv_train = $argv[1];
+if(isset($options['t'])) {
+ $argv_train = $options['t'];
if(array_key_exists($argv_train, $train_result)) {
# Picked a valid train .. remove all others
foreach ($train_result as $train_id => $train_version) {
@@ -50,6 +54,16 @@
}
}
+$buildid = "";
+if(!isset($options['b'])) {
+ usage();
+ exit();
+}
+else {
+ $buildid = $options['b'];
+}
+
+
$dbc = new DBConnection();
@@ -100,24 +114,12 @@
*/
exec("mkdir -p $babel_language_packs_dir");
$language_pack_links_file = fopen("${babel_language_packs_dir}${train_id}.php", "w");
- fwrite($language_pack_links_file, "<?php\n\$pageTitle = \"Babel Language Packs for ${train_id}\";");
- fwrite($language_pack_links_file, "\ninclude \$_SERVER['DOCUMENT_ROOT'] . '/eclipse.org-common/themes/Phoenix/header.php';");
- fwrite($language_pack_links_file, "\n\$language_pack_leader = \"\";");
- fwrite($language_pack_links_file, "\n?>");
- fwrite($language_pack_links_file, "\n\t<div id='maincontent'>");
- fwrite($language_pack_links_file, "\n\t<div id='midcolumn'>");
- fwrite($language_pack_links_file, "\n\t<style>");
- fwrite($language_pack_links_file, "\n\t\th3 {");
- fwrite($language_pack_links_file, "\n\t\t\tbackground-color: SteelBlue;");
- fwrite($language_pack_links_file, "\n\t\t\tcolor: white;");
- fwrite($language_pack_links_file, "\n\t\t}");
- fwrite($language_pack_links_file, "\n");
- fwrite($language_pack_links_file, "\n\t\th4 {");
- fwrite($language_pack_links_file, "\n\t\t\tbackground-color: LightSteelBlue;");
- fwrite($language_pack_links_file, "\n\t\t}");
- fwrite($language_pack_links_file, "\n\t</style>");
+ fwrite($language_pack_links_file, "<?php\n");
+ # copy page_header.html here
+ $header = file_get_contents("${source_files_dir}page_header.html");
+ fwrite($language_pack_links_file, $header);
fwrite($language_pack_links_file, "\n\t<h1>Babel Language Packs for ${train_id}</h1>" .
- "\n\t<h2>Build ID: $timestamp</h2>" .
+ "\n\t<h2>Build ID: $buildid</h2>" .
"\n\t<p>The following language packs are based on the community translations entered into the <a href='http://babel.eclipse.org/'>Babel Translation Tool</a>, and may not be complete or entirely accurate. If you find missing or incorrect translations, please use the <a href='http://babel.eclipse.org/'>Babel Translation Tool</a> to update them." .
"\n\tAll downloads are provided under the terms and conditions of the <a href='http://www.eclipse.org/legal/epl/notice.php'>Eclipse Foundation Software User Agreement</a> unless otherwise specified.</p>");
@@ -547,4 +549,13 @@
$alloutput = fopen($output_dir."langpack_output_".date("m_d_Y"), "w");
fwrite($alloutput,ob_get_contents());
+
+function usage() {
+ echo "\n";
+ echo "generate1.php -b <build_id> [-t <train_id>]\n";
+ echo " -b <build_id>: The Build ID for this build.\n";
+ echo " -t <train_id>: Optional: train to build (europa, ganymede, galileo.";
+ echo "\n";
+}
+
?>
\ No newline at end of file
diff --git a/classes/export/source_files_for_generate/page_header.html b/classes/export/source_files_for_generate/page_header.html
new file mode 100644
index 0000000..6fec615
--- /dev/null
+++ b/classes/export/source_files_for_generate/page_header.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><title>Babel Language Packs</title><meta name="author" content="" /><meta name="keywords" content="" /><link rel="stylesheet" type="text/css" href="/eclipse.org-common/themes/Phoenix/css/small.css" title="small" /><link rel="alternate stylesheet" type="text/css" href="/eclipse.org-common/themes/Phoenix/css/large.css" title="large" /><link rel="stylesheet" type="text/css" href="/eclipse.org-common/themes/Phoenix/css/visual.css" media="screen" /><link rel="stylesheet" type="text/css" href="/eclipse.org-common/themes/Phoenix/css/layout.css" media="screen" />
+<!--[if IE]> <link rel="stylesheet" type="text/css" href="/eclipse.org-common/themes/Phoenix/css/ie_style.css" media="screen"/> <![endif]-->
+<!--[if IE 6]> <link rel="stylesheet" type="text/css" href="/eclipse.org-common/themes/Phoenix/css/ie6_style.css" media="screen"/> <![endif]-->
+<link rel="stylesheet" type="text/css" href="/eclipse.org-common/themes/Phoenix/css/print.css" media="print" />
+<link rel="stylesheet" type="text/css" href="/eclipse.org-common/themes/Phoenix/css/header.css" media="screen" />
+<script type="text/javascript" src="/eclipse.org-common/themes/Phoenix/styleswitcher.js"></script>
+</head>
+
+<body>
+ <style>
+ h3 {
+ background-color: SteelBlue;
+ color: white;
+ }
+
+ h4 {
+ background-color: LightSteelBlue;
+ }
+ </style>
+<div id="header">
+ <div id="header-graphic" class="eclipse-main">
+ <a href="/"><img src="/eclipse.org-common/themes/Phoenix/images/eclipse_home_header.jpg" alt="" /></a><h1>Eclipse</h1>
+ </div>
+
+ <div id="header-global-holder" class="eclipse-main-global">
+ <div id="header-global-links"><ul>
+<li><a href="/org/foundation/contact.php" class="first_one">Contact</a></li><li><a href="/legal/">Legal</a></li>
+ </ul>
+ </div>
+ <div id="header-icons">
+<a href="http://live.eclipse.org"><img src="/eclipse.org-common/themes/Phoenix/images/Icon_Live.png" width="28" height="28" alt="Eclipse Live" title="Eclipse Live" /></a>
+<a href="http://www.eclipseplugincentral.com"><img src="/eclipse.org-common/themes/Phoenix/images/Icon_plugin.png" width="28" height="28" alt="Eclipse Plugin Central" title="Eclipse Plugin Central" /></a>
+<a href="http://www.planeteclipse.org"><img src="/eclipse.org-common/themes/Phoenix/images/Icon_planet.png" width="28" height="28" alt="Planet Eclipse" title="Planet Eclipse" /></a>
+ </div>
+
+ </div></div> <div id='maincontent'>
+ <div id='midcolumn'>
+