Removed MultiWear, style update, xhtml compliance

This commit is contained in:
Latif Khalifa
2012-12-26 17:29:44 +01:00
parent 8633f024f9
commit c01cc40bab
6 changed files with 98 additions and 20 deletions

View File

@@ -60,7 +60,7 @@ a, a:link, a:hover, a:visited, a:active {
td, th {
text-align: left;
margin: 0;
padding: 3px 20px 3px 3px;
padding: 3px 3px 3px 3px;
vertical-align: top;
display: table-cell;
border: none;
@@ -69,6 +69,7 @@ td, th {
th {
border-bottom: solid 1px #404040;
background: url(images/container-bg.gif) top repeat-x;
padding: 5px 3px 10px 3px;
}
.build-list {

View File

@@ -55,7 +55,6 @@ function print_changes($current, $next, $chan)
}
if ($res = $DB->query(kl_str_sql("select * from revs where chan=!s and hash in ('" . implode("','", $revs) . "')", $chan))) {
print '<table style="width: 100%;">';
$changesets = array();
@@ -63,8 +62,12 @@ function print_changes($current, $next, $chan)
$changesets[] = $row;
}
usort($changesets, "sort_by_date");
if (count($changesets) == 0) return;
print '<table style="width: 99%;">';
usort($changesets, "sort_by_date");
foreach ($changesets as $change) {
print_changeset($change);
}
@@ -77,8 +80,19 @@ Function print_build($current, $next, $buildNr, $chan)
{
print "
<tr style=\"background-color: #303030;\">
<th><a href=\"" . URL_ROOT ."?build_id={$current->nr}\">Build " . htmlspecialchars($current->nr). "</a></th>
<th>" . htmlspecialchars($current->modified). " (" . Layout::since(strtotime($current->modified)) . " ago)</th>
<th><a href=\"" . URL_ROOT ."?build_id={$current->nr}\">Build " . htmlspecialchars($current->nr). "</a><br/>";
if ($next) {
if (($current->linux_file && $current->osx_file)) {
print "<br/>";
}
print '
<a href="javascript:void(0)" id="toggle_link_'. $current->nr . '" onclick="javascript:toggleChanges('. $current->nr . ')">' .
($buildNr ? 'Hide changes &lt;&lt;' : 'Show changes &gt;&gt;') . '</a>';
}
print "</th><th>" . htmlspecialchars($current->modified). " (" . Layout::since(strtotime($current->modified)) . " ago)</th>
<th>" . htmlspecialchars($current->chan). "</th>
<th><a href='" . URL_ROOT . "/" . $current->file . "'><img src=\"" . IMG_ROOT . "/dl.gif\" alt=\"Download Windows Build\"/>&nbsp;Windows</a>&nbsp;&nbsp;
<a href='" . URL_ROOT . "/" . $current->file . ".log'>Build Log</a>";
@@ -92,27 +106,25 @@ Function print_build($current, $next, $buildNr, $chan)
}
print "</th></tr>";
if ($next) {
print '<tr><td colspan="4">
<a href="javascript:void(0)" id="toggle_link_'. $current->nr . '" onclick="javascript:toggleChanges('. $current->nr . ')">' .
($buildNr ? 'Hide changes &lt;&lt' : 'Show changes &gt;&gt;') .
'</a><div ' . ($buildNr ? '' : 'style="display: none;"') . ' id="changes_' . $current->nr . '">';
print '<tr' . ($buildNr ? '' : ' style="display: none;"') . ' id="changes_' . $current->nr . '"><td colspan="4">';
print_changes($current, $next, $chan);
print "</div></td></tr>";
print "</td></tr>";
}
}
function chan_selector($current_chan)
{
// return;
// return;
global $CHANS;
print '<form method="GET">';
print '<form method="get" action="index.php">';
print 'Select channel&nbsp;<select name="chan" onchange="this.form.submit()">';
foreach($CHANS as $chan => $ref) {
print "<option value=\"$chan\"" . ($current_chan == $chan ? " selected" : "") . ">$chan</option>";
print "<option value=\"$chan\"" . ($current_chan == $chan ? " selected=\"selected\"" : "") . ">$chan</option>";
}
print '</select><noscript><input type="submit" value="Change"></noscript></form>';
print '</select><noscript><input type="submit" value="Change"/></noscript></form><br />';
}

View File

@@ -48,11 +48,11 @@ class Layout
var link = document.getElementById("toggle_link_" + id);
if (change) {
if (change.style.display == "block") {
if (change.style.display == "") {
change.style.display = "none";
link.innerHTML = "Show changes &gt;&gt;";
} else {
change.style.display = "block";
change.style.display = "";
link.innerHTML = "Hide changes &lt;&lt;";
}
}

62
lib/cleanup.php Executable file
View File

@@ -0,0 +1,62 @@
#!/usr/bin/php
<?php
define("SITE_ROOT", realpath(dirname(__file__) . "/.."));
require_once SITE_ROOT . "/lib/init.php";
function get_old_builds($chan, $nrToKeep)
{
global $DB;
$builds = array();
if ($res = $DB->query(kl_str_sql("select * from builds where chan=!s and nr not in (select nr from builds where chan=!s order by nr desc limit !i)", $chan, $chan, $nrToKeep))) {
while ($row = $DB->fetchRow($res)) {
$build = new stdClass;
$DB->loadFromDbRow($build, $res, $row);
$linux_file = "SingularityAlpha-i686-{$build->version}.tar.bz2";
$build->linux_file = file_exists($linux_file) ? $linux_file : false;
$osx_file = "SingularityAlpha_" . str_replace(".", "_", $build->version) . ".dmg";
$build->osx_file = file_exists($osx_file) ? $osx_file : false;
$builds[] = $build;
}
}
return $builds;
}
chdir(SITE_ROOT);
$builds = get_old_builds("SingularityAlpha", 21);
$nrBuilds = count($builds);
for ($i=0; $i<$nrBuilds; $i++) {
$b = $builds[$i];
$f = array();
$f[] = $b->file;
if ($b->linux_file) $f[] = $b->linux_file;
if ($b->osx_file) $f[] = $b->osx_file;
print "Cleaning build nr.: {$b->nr}\n";
for ($j=0; $j<count($f); $j++) {
print " Deleting {$f[$j]}\n";
@unlink(SITE_ROOT . "/" . $f[$j]);
@unlink(SITE_ROOT . "/" . $f[$j] . ".log");
}
$DB->query(kl_str_sql("delete from builds where nr=!i and chan=!s", $b->nr, $b->chan));
}
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/

View File

@@ -80,9 +80,10 @@ function update_revs()
foreach ($CHANS as $chan => $branch) {
exec("git fetch --all 2>&1");
if ($branch != "HEAD") {
exec("git reset --soft $branch 2>&1");
if ($branch == "HEAD") {
$branch = "FETCH_HEAD";
}
exec("git reset --soft $branch 2>&1");
$DB->query("begin transaction");
@@ -116,7 +117,7 @@ function update_revs()
$revs = $newRevs;
$changesAt[$build] = $changes;
print $nrChanges . " changes in build $build\n";
if ($build < 2169) break; // this is when we started building
if ($build < 2883) break; // this is when we started building
}
}
save_build_changes($changesAt, $chan);

View File

@@ -55,7 +55,9 @@ if (!defined('IMG_ROOT')) {
}
$CHANS = array("SingularityAlpha" => "HEAD", "SingularityMultiWearable" => "refs/remotes/shyotl/V2MultiWear");
// $CHANS = array("SingularityAlpha" => "HEAD", "SingularityMultiWearable" => "refs/remotes/shyotl/V2MultiWear");
$CHANS = array("SingularityAlpha" => "HEAD");
$DB = new DBH();
$DB_NAME = SITE_ROOT . '/lib/singularity_revisions.db';