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