diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b28720b --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +*.exe +*.bz2 +*.dmg +*.zip +*.bak +*~ +*.log +lib/source/* +lib/singularity_revisions* diff --git a/.hgignore b/.hgignore deleted file mode 100644 index 6c2cfbb..0000000 --- a/.hgignore +++ /dev/null @@ -1,7 +0,0 @@ -syntax: glob -*.exe -*.bak -*~ -*.log -lib/source/* -lib/signularity_revisions* \ No newline at end of file diff --git a/buildsite.css b/buildsite.css new file mode 100644 index 0000000..f465405 --- /dev/null +++ b/buildsite.css @@ -0,0 +1,92 @@ +html { + padding: 0; + margin: 0; + background-color: #1e1e1e; +} + +image { + border: none; +} + +body, select { + padding: 0; + margin: 0; + background-color: #1e1e1e; + font: normal 10pt "Lucida Grande","Lucida Sans Unicode",sans-serif; + color: #a0a0a0; +} + +div { + display: block; + padding: 0; + margin: 0; +} + +#everything { + background: url(images/body-bg.png) top repeat-x; + min-height: 100%; +} + +#page-wrapper { + margin: 0 auto; + width: 960px; +} + +#header { + margin-bottom: 10px; + width: 100%; + height: 144px; + background: url(images/singularity_logo.gif) left top no-repeat; + border-bottom: solid 2px black; +} + +.container { + padding: 5px; + margin-bottom: 10px; + background: url(images/container-bg.gif) top repeat-x; + border-bottom: solid 2px black; + background-color: #1b1b1b; +} + +a, a:link, a:hover, a:visited, a:active { + text-decoration: none; + color: #e0e0e0; +} + +a.dimmer { + color: #a0a0a0; +} + +.bottom-links { + text-align: center; +} + +td, th { + text-align: left; + margin: 0; + padding: 3px 3px 3px 3px; + vertical-align: top; + display: table-cell; + border: none; +} + +th { + border-bottom: solid 1px #404040; + background: url(images/container-bg.gif) top repeat-x; + padding: 5px 3px 10px 3px; +} + +.build-list { + padding: 0; + margin: 0; + border-spacing: 0; + width: 100%; + border: solid 1px #404040; +} + +pre { + font-family: monospace; + font-size: 8pt; + white-space: pre-wrap; + word-wrap: break-word; +} \ No newline at end of file diff --git a/feed.php b/feed.php new file mode 100644 index 0000000..0d12385 --- /dev/null +++ b/feed.php @@ -0,0 +1,126 @@ + $email, "email" => ""); + if (preg_match("|([^\<]*)<([^>]*)>|", $email, $m)) { + $ret["name"] = trim($m[1]); + $ret["email"] = trim($m[2]); + } + return $ret; +} + + +function sort_by_date($a, $b) +{ + if ($a["time"] < $b["time"]) { + return 1; + } else if ($a["time"] > $b["time"]) { + return -1; + } + return 0; +} + +function print_changeset($row) +{ + $author = parse_email($row["author"]); + $gid = md5($author["email"]); + $avatar = (USE_SSL ? "https://secure.gravatar.com" : "http://www.gravatar.com") . + "/avatar/$gid?r=x&d=mm&s=48"; + return 'Avatar
' + . htmlspecialchars($author["name"]) . '' + . '' . htmlspecialchars($row["hash"]) . '
' + . htmlspecialchars($row["time"]). "

\n\n
" 
+		. htmlspecialchars($row["message"]) . '
'; +} + +function print_changes($current, $next) +{ + global $DB; + + $ret = ""; + + $revs = array(); + if (!($res = $DB->query(kl_str_sql("select revisions from changes where build<=!i and build>!i order by build desc", $current->nr, $next->nr)))) { + return $ret; + } else { + while ($row = $DB->fetchRow($res)) { + $revs = array_merge($revs, explode(",", $row["revisions"])); + } + } + + if ($res = $DB->query("select * from revs where hash in ('" . implode("','", $revs) . "')")) { + $ret .= ''; + + $changesets = array(); + + while ($row = $DB->fetchRow($res)) { + $changesets[] = $row; + } + + usort($changesets, "sort_by_date"); + + foreach ($changesets as $change) { + $ret .= print_changeset($change); + } + + $ret .= '
'; + } + + return $ret; +} + +$buildFeed = new FeedWriter(ATOM); +$buildFeed->setTitle('Singularity Automatic Development Builds'); +$buildFeed->setLink('http://files.streamgrid.net/singularity/'); +$buildFeed->setDescription('Latest automated build of the Singularity Viewer project'); +// $buildFeed->setImage('Testing the RSS writer class', +// 'http://www.ajaxray.com/projects/rss', +// 'http://www.rightbrainsolution.com/images/logo.gif'); + +$chan = "SingularityAlpha"; + +$pageSize = 20; + +$builds = array(); + +if ($res = $DB->query(kl_str_sql("select * from builds where chan=!s order by nr desc limit !i", $chan, $pageSize + 1))) { + while ($row = $DB->fetchRow($res)) { + + $build = new stdClass; + $DB->loadFromDbRow($build, $res, $row); + $builds[] = $build; + } +} + +$nrBuilds = count($builds); + +if ($nrBuilds) { + for ($i = 0; $i < $pageSize; $i++) { + if (!isset($builds[$i])) continue; + $newItem = $buildFeed->createNewItem(); + $newItem->setTitle("Singularity Alpha build " . $builds[$i]->nr); + $newItem->setLink("http://files.streamgrid.net/singularity/?build_id=" . $builds[$i]->nr); + $newItem->setDate($builds[$i]->modified); + if (isset($builds[$i+1])) { + $newItem->setDescription(print_changes($builds[$i], $builds[$i + 1])); + } + $buildFeed->addItem($newItem); + } + + $buildFeed->genarateFeed(); + +} + + +/* + * 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 + */ diff --git a/images/body-bg.png b/images/body-bg.png new file mode 100644 index 0000000..6731269 Binary files /dev/null and b/images/body-bg.png differ diff --git a/images/container-bg.gif b/images/container-bg.gif new file mode 100644 index 0000000..fe2b531 Binary files /dev/null and b/images/container-bg.gif differ diff --git a/images/dl.gif b/images/dl.gif new file mode 100644 index 0000000..e94f1f0 Binary files /dev/null and b/images/dl.gif differ diff --git a/images/favicon.ico b/images/favicon.ico new file mode 100644 index 0000000..f145db8 Binary files /dev/null and b/images/favicon.ico differ diff --git a/images/singularity_logo.gif b/images/singularity_logo.gif new file mode 100644 index 0000000..a5f3023 Binary files /dev/null and b/images/singularity_logo.gif differ diff --git a/index.php b/index.php new file mode 100644 index 0000000..74fc9bc --- /dev/null +++ b/index.php @@ -0,0 +1,219 @@ + $email, "email" => ""); + if (preg_match("|([^\<]*)<([^>]*)>|", $email, $m)) { + $ret["name"] = trim($m[1]); + $ret["email"] = trim($m[2]); + } + return $ret; +} + +function print_changeset($row) +{ + $author = parse_email($row["author"]); + $gid = md5(strtolower($author["email"])); + $avatar = (USE_SSL ? "https://secure.gravatar.com" : "http://www.gravatar.com") . + "/avatar/$gid?r=x&d=mm&s=48"; + print ' + + Avatar
' . + htmlspecialchars($author["name"]) . ' + ' . htmlspecialchars($row["hash"]) . ' + ' . htmlspecialchars($row["time"]). + ' (' . Layout::since(strtotime($row["time"])) . ' ago) + + +
' . htmlspecialchars($row["message"]) . '
+ '; +} + +function sort_by_date($a, $b) +{ + if ($a["time"] < $b["time"]) { + return 1; + } else if ($a["time"] > $b["time"]) { + return -1; + } + return 0; +} + +function print_changes($current, $next, $chan) +{ + global $DB; + $revs = array(); + if (!($res = $DB->query(kl_str_sql("select revisions from changes where chan=!s and build<=!i and build>!i order by build desc", $chan, $current->nr, $next->nr)))) { + return; + } else { + while ($row = $DB->fetchRow($res)) { + $revs = array_merge($revs, explode(",", $row["revisions"])); + } + } + + if ($res = $DB->query(kl_str_sql("select * from revs where chan=!s and hash in ('" . implode("','", $revs) . "')", $chan))) { + + $changesets = array(); + + while ($row = $DB->fetchRow($res)) { + $changesets[] = $row; + } + + if (count($changesets) == 0) return; + + print ''; + + usort($changesets, "sort_by_date"); + + foreach ($changesets as $change) { + print_changeset($change); + } + + print '
'; + } +} + +Function print_build($current, $next, $buildNr, $chan) +{ + print " + + nr}\">Build " . htmlspecialchars($current->nr). "
"; + + + if ($next) { + if (($current->linux_file && $current->osx_file && $current->linux64_file)) { + print "

"; + } + elseif (($current->linux_file && $current->osx_file)) { + print "
"; + } + print ' + ' . + ($buildNr ? 'Hide changes <<' : 'Show changes >>') . ''; + } + + print "" . htmlspecialchars($current->modified). " (" . Layout::since(strtotime($current->modified)) . " ago) + " . htmlspecialchars($current->chan). " + \"Download Windows   +           Build Log"; + + if ($current->linux_file) { + print "
\"Download Linux (32 bit)"; + if (file_exists($current->linux_file . ".log")) { + print "      Build Log"; + } + + } + + + if ($current->linux64_file) { + print "
\"Download Linux (64 bit)"; + if (file_exists($current->linux64_file . ".log")) { + print "      Build Log"; + } + } + + if ($current->osx_file) { + print "
\"Download Mac OS X"; + if (file_exists($current->osx_file . ".log")) { + print "            Build Log"; + } + } + + print ""; + + if ($next) { + print '