tazwok annotate web/index.php @ rev 440

Fix configure_tazchroot()
author Antoine Bodin <gokhlayeh@slitaz.org>
date Mon Mar 14 17:23:38 2011 +0100 (2011-03-14)
parents eb6a2f0a9faa
children 4f141b1588b2
rev   line source
gokhlayeh@186 1 <?php
gokhlayeh@371 2 $version_in_url=$_GET["version"];
gokhlayeh@371 3 if (file_exists("conf-$version_in_url.php")) {
gokhlayeh@371 4 include("conf-$version_in_url.php");
gokhlayeh@186 5 }
gokhlayeh@235 6 else {
gokhlayeh@235 7 if (file_exists("conf.php")) {
gokhlayeh@235 8 include("conf.php");
gokhlayeh@235 9 }
gokhlayeh@235 10 }
gokhlayeh@267 11
gokhlayeh@267 12 function include_and_link($file)
gokhlayeh@267 13 {
gokhlayeh@267 14 global $log_dir, $version;
pascal@393 15 if (($str = file_get_contents($file)) === FALSE) return;
pascal@393 16 $lines = explode("\n",$str);
pascal@393 17 sort($lines);
pascal@393 18 foreach ($lines as $pkg) {
gokhlayeh@267 19 if (file_exists("$log_dir/$pkg.html"))
pascal@380 20 echo "<a href=\"log.php?version=$version&amp;package=".
pascal@380 21 urlencode($pkg)."\" target=\"_blank\">$pkg</a>\n";
pascal@436 22 else if ($pkg != "") echo "$pkg\n";
gokhlayeh@267 23 }
gokhlayeh@267 24 }
gokhlayeh@267 25
gokhlayeh@267 26 function list_last_cooked($dir, $suffix)
gokhlayeh@267 27 {
gokhlayeh@267 28 global $version;
gokhlayeh@267 29 $path=basename($dir);
gokhlayeh@267 30 system("cd $dir && ls -1t *.$suffix | head -20 | \
gokhlayeh@267 31 while read file; do echo -n \$(stat -c '%y' $dir/\$file | \
pascal@376 32 cut -d. -f1); echo ' <a href=\"download.php?version=$version&amp;package=$path/'\$file'\">'\$file'</a>'; done");
gokhlayeh@267 33 }
gokhlayeh@267 34
gokhlayeh@186 35 ?>
gokhlayeh@186 36 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
gokhlayeh@186 37 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
gokhlayeh@186 38 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
gokhlayeh@186 39 <head>
gokhlayeh@186 40 <title>SliTaz Build Bot</title>
gokhlayeh@186 41 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
gokhlayeh@186 42 <meta name="description" content="Tazbb web interface" />
pascal@363 43 <?php
pascal@363 44 if (isset($_GET["refresh"]))
pascal@363 45 echo " <meta http-equiv=\"refresh\" content=\""
pascal@377 46 .$_GET["refresh"]."\" />\n";
pascal@363 47 ?> <meta name="robots" content="index nofollow" />
gokhlayeh@235 48 <link rel="shortcut icon" href="web/favicon.ico" />
gokhlayeh@235 49 <link rel="stylesheet" type="text/css" href="web/slitaz.css" />
gokhlayeh@186 50 </head>
gokhlayeh@235 51 <body>
gokhlayeh@186 52
gokhlayeh@186 53 <!-- Header -->
gokhlayeh@186 54 <div id="header">
gokhlayeh@235 55 <!-- Access -->
gokhlayeh@235 56 <div id="access">
gokhlayeh@235 57 <?php
gokhlayeh@235 58 $versions_list = fopen('repositories.list', 'r');
gokhlayeh@235 59 if($versions_list)
gokhlayeh@235 60 {
gokhlayeh@235 61 $otherversion = '';
gokhlayeh@235 62 while(!feof($versions_list))
gokhlayeh@235 63 {
gokhlayeh@235 64 $otherversion = fgets($versions_list);
gokhlayeh@235 65 echo "<a href=\"?version=$otherversion\">$otherversion</a>";
gokhlayeh@235 66 }
gokhlayeh@235 67 fclose($versions_list);
gokhlayeh@235 68 }
gokhlayeh@235 69 ?>
gokhlayeh@235 70 </div>
gokhlayeh@186 71 <a href="http://bb.slitaz.org/"><img id="logo"
gokhlayeh@235 72 src="web/logo.png"
gokhlayeh@235 73 title="bb.slitaz.org" alt="bb.slitaz.org" /></a>
gokhlayeh@235 74 <p id="titre">#!/Build/Bot/<?php echo $version; ?></p>
gokhlayeh@186 75 </div>
gokhlayeh@186 76
gokhlayeh@186 77 <!-- Content -->
gokhlayeh@235 78 <div id="content-full">
gokhlayeh@186 79
gokhlayeh@235 80 <!-- Block begin -->
gokhlayeh@235 81 <div class="block">
gokhlayeh@235 82 <!-- Nav block begin -->
gokhlayeh@235 83 <div id="block_nav">
gokhlayeh@235 84 <h3><img src="pics/website/development.png" alt="" />Developers</h3>
gokhlayeh@235 85 <ul>
gokhlayeh@235 86 <li><a href="http://www.slitaz.org/en/devel/">Website/devel</a></li>
gokhlayeh@235 87 <li><a href="http://labs.slitaz.org/">Laboratories</a></li>
gokhlayeh@235 88 <li><a href="http://hg.slitaz.org/">Mercurial Repos</a></li>
gokhlayeh@235 89 <li><a href="http://people.slitaz.org/">People Stuff</a></li>
gokhlayeh@235 90 <li><a href="http://scn.slitaz.org/">Community Network</a></li>
gokhlayeh@235 91 </ul>
gokhlayeh@235 92 <!-- Nav block end -->
gokhlayeh@235 93 </div>
gokhlayeh@235 94 <!-- Top block begin -->
gokhlayeh@235 95 <div id="block_top">
gokhlayeh@235 96 <h1>Build Bot</h1>
gokhlayeh@235 97 <p>
gokhlayeh@334 98 Tazwok is a <a href="http://www.slitaz.org/">SliTaz GNU/Linux</a>
pankso@348 99 Build Bot, it automatically cooks and tests packages. SliTaz
pankso@348 100 <a href="http://pkgs.slitaz.org/">packages</a> are cooked on
pankso@348 101 <a href="http://tank.slitaz.org">Tank</a>, the project main
pankso@348 102 server. This web interface gives the current status of the
pankso@348 103 build bot and the last report about any packages modified by
pankso@348 104 contributors in the Mercurial repositories, aka
gokhlayeh@235 105 <a href="http://hg.slitaz.org/">Hg repos</a>.
gokhlayeh@235 106 </p>
pankso@348 107 <p>
pankso@348 108 Note: Flavors/Iso build logs are named "iso-?flavor",
pankso@348 109 Temporary toolchain logs are named "tmp-toolchain-?package"
paul@418 110 and the check-incoming log is named "incoming".
pankso@348 111 </p>
gokhlayeh@235 112 <!-- Top block end -->
gokhlayeh@235 113 </div>
gokhlayeh@235 114 <!-- Block end -->
gokhlayeh@235 115 </div>
gokhlayeh@235 116
pascal@369 117 <a name="Cooklog"></a>
gokhlayeh@235 118 <h2>Cooklog</h2>
gokhlayeh@186 119
gokhlayeh@186 120 <p>
pascal@376 121 </p>
pascal@376 122 <div>
gokhlayeh@235 123 <form action="log.php" method="get">
gokhlayeh@235 124 <input type="hidden" name="version" value="<?php
gokhlayeh@235 125 echo "$version";
gokhlayeh@235 126 ?>
gokhlayeh@235 127 " />
pascal@370 128 Show pkg log:
pankso@341 129 <input type="text" name="package" style="width: 320px;" />
gokhlayeh@235 130 <!-- <input type="submit" value="Show" /> -->
pankso@348 131 </form>
pascal@376 132 </div>
gokhlayeh@186 133
pascal@369 134 <a name="Summary"></a>
gokhlayeh@247 135 <h2>Summary</h2>
pascal@372 136 <?php if (strpos($_SERVER["SERVER_NAME"],"slitaz.org") !== FALSE) { ?>
pankso@378 137 <a href="http://tank.slitaz.org/">
pankso@378 138 <img src="http://tank.slitaz.org/pics/rrd/cpu-day.png"
pankso@378 139 title="cpu daily" alt="cpu daily" />
pascal@375 140 </a>
pascal@372 141 <?php } ?>
pankso@378 142
pankso@378 143 <div class="infobox">
gokhlayeh@186 144 <?php
pankso@342 145 // Check curent status (update in real time) and display summary.
pascal@349 146 $status = "Chroot is not mounted";
pankso@342 147 if (file_exists($lockfile)) {
pascal@350 148 $status = "Chroot is mounted";
pankso@342 149 }
pascal@349 150 if (file_exists("$log_dir/step")) {
pascal@369 151 $duration = time() - filemtime("$log_dir/step");
pascal@369 152 if ($duration < 60)
pascal@369 153 $duration .= "s";
pascal@369 154 else if ($duration < 3600)
pascal@369 155 $duration = floor($duration / 60). " min";
pascal@369 156 else $duration = sprintf("%dH%02d",floor($duration / 3600),
pascal@369 157 ($duration / 60) % 60);
pascal@370 158 $status .= ". ".file_get_contents("$log_dir/step")." ($duration ago)";
pascal@349 159 if (file_exists("$log_dir/package")) {
pascal@349 160 $pkg = file_get_contents("$log_dir/package");
pascal@351 161 $pkg = chop($pkg);
pascal@349 162 if (file_exists("$log_dir/$pkg.html"))
pascal@376 163 $status .= " <a href=\"log.php?version=$version&amp;package=$pkg\" target=\"_blank\">$pkg</a>";
pascal@351 164 else $status .= " $pkg";
pascal@349 165 }
pankso@342 166 }
pankso@378 167 echo date(DATE_RFC822).": $status\n";
gokhlayeh@371 168 // Set $version_in_url.
gokhlayeh@371 169 if ("$version_in_url") {
gokhlayeh@371 170 $version_in_url="?version=$version_in_url";
gokhlayeh@371 171 }
pascal@372 172 else if (strpos($_SERVER["REQUEST_URI"],"?") !== FALSE)
pascal@372 173 $version_in_url="?";
gokhlayeh@186 174 ?>
pankso@378 175 </div>
pankso@378 176
pascal@379 177 <table width="100%">
pascal@379 178 <tr>
pascal@379 179 <td>
pankso@378 180 <ul>
pascal@370 181 <li><a href="http://hg.slitaz.org/wok<?php
pascal@370 182 if ($version != "cooking") echo "-$version";
pascal@375 183 echo "\" target=\"_blank\">Packages in the wok</a>: ";
pankso@342 184 system("cd $wok && ls -1 | wc -l"); ?></li>
pankso@342 185 <li>Packages in the main repository: <?php
pankso@344 186 system("cd $packages && ls -1t *.tazpkg | wc -l"); ?></li>
gokhlayeh@371 187 <li><?php
gokhlayeh@371 188 echo "<a href=\"$version_in_url#cooked\">Packages in the incoming repository</a>: ";
pankso@344 189 system("cd $incoming && ls -1t *.tazpkg | wc -l"); ?></li>
gokhlayeh@371 190 <li><?php
gokhlayeh@371 191 echo "<a href=\"$version_in_url#Commit\">Commited packages</a>: ";
pascal@347 192 system("wc -l < $db_dir/commit"); ?></li>
pascal@379 193 </ul>
pascal@379 194 </td>
pascal@379 195 <td>
pascal@379 196 <ul>
gokhlayeh@371 197 <li><?php
gokhlayeh@371 198 echo "<a href=\"$version_in_url#Cooklist\">Packages to cook</a>: ";
pascal@347 199 system("wc -l < $db_dir/cooklist"); ?></li>
gokhlayeh@371 200 <li><?php
gokhlayeh@371 201 echo "<a href=\"$version_in_url#Broken\">Broken packages</a>: ";
pascal@347 202 system("wc -l < $db_dir/broken"); ?></li>
gokhlayeh@371 203 <li><?php
gokhlayeh@371 204 echo "<a href=\"$version_in_url#Blocked\">Blocked packages</a>: ";
pascal@347 205 system("wc -l < $db_dir/blocked"); ?></li>
gokhlayeh@265 206 </ul>
pascal@379 207 </td>
pascal@379 208 </tr>
pascal@379 209 </table>
gokhlayeh@186 210
pascal@363 211 <?php
pascal@363 212 if (!isset($_GET["summary"])) {
pascal@363 213 ?>
pascal@369 214 <a name="Commit"></a>
gokhlayeh@186 215 <h3>Commit</h3>
gokhlayeh@186 216 <pre class="package">
gokhlayeh@186 217 <?php
gokhlayeh@186 218 include("$db_dir/commit");
gokhlayeh@186 219 ?>
gokhlayeh@186 220 </pre>
gokhlayeh@186 221
pascal@369 222 <a name="Cooklist"></a>
gokhlayeh@186 223 <h3>Cooklist</h3>
gokhlayeh@186 224 <pre class="package">
gokhlayeh@186 225 <?php
gokhlayeh@186 226 include("$db_dir/cooklist");
gokhlayeh@186 227 ?>
gokhlayeh@186 228 </pre>
gokhlayeh@186 229
pascal@369 230 <a name="Broken"></a>
gokhlayeh@186 231 <h3>Broken</h3>
gokhlayeh@186 232 <pre class="package">
pascal@436 233 <?php include_and_link("$db_dir/broken"); ?>
gokhlayeh@186 234 </pre>
gokhlayeh@186 235
pascal@369 236 <a name="Blocked"></a>
gokhlayeh@186 237 <h3>Blocked</h3>
gokhlayeh@186 238 <pre class="package">
pascal@436 239 <?php include_and_link("$db_dir/blocked"); ?>
gokhlayeh@186 240 </pre>
gokhlayeh@186 241
pascal@369 242 <a name="cooked"></a>
gokhlayeh@186 243 <h3>Last cooked packages</h3>
gokhlayeh@186 244 <pre class="package">
gokhlayeh@186 245 <?php
gokhlayeh@267 246 list_last_cooked($incoming, "tazpkg");
gokhlayeh@267 247 ?>
gokhlayeh@186 248 </pre>
gokhlayeh@186 249
pascal@369 250 <a name="removed"></a>
gokhlayeh@186 251 <h3>Last removed packages</h3>
gokhlayeh@186 252 <pre class="package">
gokhlayeh@186 253 <?php
gokhlayeh@186 254 include("$db_dir/removed");
gokhlayeh@186 255 ?>
gokhlayeh@186 256 </pre>
gokhlayeh@186 257
pascal@369 258 <a name="flavors"></a>
gokhlayeh@186 259 <h3>Last cooked flavors</h3>
gokhlayeh@186 260 <pre class="package">
gokhlayeh@186 261 <?php
gokhlayeh@267 262 list_last_cooked($packages, "flavor");
gokhlayeh@267 263 ?>
gokhlayeh@186 264 </pre>
gokhlayeh@186 265
pascal@363 266 <?php
pascal@363 267 } // isset summary
pascal@363 268 ?>
gokhlayeh@235 269 <!-- End of content -->
gokhlayeh@186 270 </div>
gokhlayeh@186 271
gokhlayeh@235 272 <!-- Footer -->
gokhlayeh@235 273 <div id="footer">
gokhlayeh@235 274 <div class="right_box">
gokhlayeh@235 275 <h4>SliTaz Network</h4>
gokhlayeh@235 276 <ul>
gokhlayeh@235 277 <li><a href="http://www.slitaz.org/">Main Website</a></li>
gokhlayeh@235 278 <li><a href="http://doc.slitaz.org/">Documentation</a></li>
gokhlayeh@235 279 <li><a href="http://forum.slitaz.org/">Support Forum</a></li>
gokhlayeh@235 280 <li><a href="http://scn.slitaz.org/">Community Network</a></li>
gokhlayeh@235 281 <li><a href="http://labs.slitaz.org/">Laboratories</a></li>
gokhlayeh@235 282 <li><a href="http://twitter.com/slitaz">SliTaz on Twitter</a></li>
pankso@344 283 <li><a href="http://www.facebook.com/slitaz">SliTaz on Facebook</a></li>
gokhlayeh@235 284 </ul>
gokhlayeh@235 285 </div>
gokhlayeh@235 286 <h4>SliTaz Website</h4>
gokhlayeh@235 287 <ul>
gokhlayeh@235 288 <li><a href="#header">Top of the page</a></li>
gokhlayeh@235 289 <li>Copyright &copy; <span class="year"></span>
gokhlayeh@235 290 <a href="http://www.slitaz.org/">SliTaz</a></li>
gokhlayeh@235 291 <li><a href="http://www.slitaz.org/en/about/">About the project</a></li>
gokhlayeh@235 292 <li><a href="http://www.slitaz.org/netmap.php">Network Map</a></li>
gokhlayeh@235 293 <li>Page modified the <?php echo (date( "d M Y", getlastmod())); ?></li>
gokhlayeh@235 294 <li><a href="http://validator.w3.org/check?uri=referer"><img
gokhlayeh@235 295 src="pics/website/xhtml10.png" alt="Valid XHTML 1.0"
gokhlayeh@235 296 title="Code validé XHTML 1.0"
gokhlayeh@235 297 style="width: 80px; height: 15px; vertical-align: middle;" /></a></li>
gokhlayeh@235 298 </ul>
gokhlayeh@186 299 </div>
gokhlayeh@186 300
gokhlayeh@186 301 </body>
gokhlayeh@186 302 </html>