tazwok view web/index.php @ rev 300

Fix a typo (thanks Godane)
author Antoine Bodin <gokhlayeh@slitaz.org>
date Wed Feb 16 23:34:27 2011 +0100 (2011-02-16)
parents 093de6dde7f8
children 3271becd1c47
line source
3 <?php
4 $version=$_GET["version"];
5 if (file_exists("conf-$version.php")) {
6 include("conf-$version.php");
7 }
8 else {
9 if (file_exists("conf.php")) {
10 include("conf.php");
11 }
12 }
14 function include_and_link($file)
15 {
16 global $log_dir, $version;
17 if (($fp = fopen($file,"r")) === false) return;
18 while (($pkg = fgets($fp)) !== false) {
19 $pkg = chop($pkg);
20 if (file_exists("$log_dir/$pkg.html"))
21 echo "<a href=\"log.php?version=$version&package=$pkg\">$pkg</a>\n";
22 else echo "$pkg\n";
23 }
24 fclose($fp);
25 }
27 function list_last_cooked($dir, $suffix)
28 {
29 global $version;
30 $path=basename($dir);
31 system("cd $dir && ls -1t *.$suffix | head -20 | \
32 while read file; do echo -n \$(stat -c '%y' $dir/\$file | \
33 cut -d. -f1); echo ' <a href=\"download.php?version=$version&package=$path/'\$file'\">'\$file'</a>'; done");
34 }
36 ?>
37 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
38 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
39 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
40 <head>
41 <title>SliTaz Build Bot</title>
42 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
43 <meta name="description" content="Tazbb web interface" />
44 <meta name="robots" content="index nofollow" />
45 <link rel="shortcut icon" href="web/favicon.ico" />
46 <link rel="stylesheet" type="text/css" href="web/slitaz.css" />
47 </head>
48 <body>
50 <!-- Header -->
51 <div id="header">
52 <!-- Access -->
53 <div id="access">
54 <?php
55 $versions_list = fopen('repositories.list', 'r');
56 if($versions_list)
57 {
58 $otherversion = '';
59 while(!feof($versions_list))
60 {
61 $otherversion = fgets($versions_list);
62 echo "<a href=\"?version=$otherversion\">$otherversion</a>";
63 }
64 fclose($versions_list);
65 }
66 ?>
67 </div>
68 <a href="http://bb.slitaz.org/"><img id="logo"
69 src="web/logo.png"
70 title="bb.slitaz.org" alt="bb.slitaz.org" /></a>
71 <p id="titre">#!/Build/Bot/<?php echo $version; ?></p>
72 </div>
74 <!-- Content -->
75 <div id="content-full">
77 <!-- Block begin -->
78 <div class="block">
79 <!-- Nav block begin -->
80 <div id="block_nav">
81 <h3><img src="pics/website/development.png" alt="" />Developers</h3>
82 <ul>
83 <li><a href="http://www.slitaz.org/en/devel/">Website/devel</a></li>
84 <li><a href="http://labs.slitaz.org/">Laboratories</a></li>
85 <li><a href="http://hg.slitaz.org/">Mercurial Repos</a></li>
86 <li><a href="http://people.slitaz.org/">People Stuff</a></li>
87 <li><a href="http://scn.slitaz.org/">Community Network</a></li>
88 </ul>
89 <!-- Nav block end -->
90 </div>
91 <!-- Top block begin -->
92 <div id="block_top">
93 <h1>Build Bot</h1>
94 <p>
95 Tazwok-experimental is a <a href="http://www.slitaz.org/">SliTaz GNU/Linux</a>
96 Build Bot, it automatically cooks and tests packages commited in
97 the wok. SliTaz <a href="http://pkgs.slitaz.org/">packages</a> are
98 cooked on the project main server: code name
99 <a href="http://tank.slitaz.org">Tank</a>. This web interface gives
100 the current status of the build bot and the last report
101 about any packages modified by the SliTaz contributors in
102 the Mercurial repositories, aka
103 <a href="http://hg.slitaz.org/">Hg repos</a>.
104 </p>
105 <!-- Top block end -->
106 </div>
107 <!-- Block end -->
108 </div>
110 <h2>Cooklog</h2>
112 <p>
113 <form action="log.php" method="get">
114 <input type="hidden" name="version" value="<?php
115 echo "$version";
116 ?>
117 " />
118 Show pkg log:<br />
119 <input type="text" name="package" />
120 <!-- <input type="submit" value="Show" /> -->
121 </form><br />
122 Note:<br />
123 Flavors/Iso build log are named iso-?flavor <br />
124 Temporary toolchain log are named tmp-toolchain-?package <br />
125 </p>
127 <h2>Summary</h2>
128 <pre class="package">
129 <?php
130 // Check curent status (update in real time) and display summary.
131 if (file_exists($lockfile)) {
132 echo "Status : Chroot is mounted\n";
133 }
134 else {
135 echo "Status : Chroot is not mounted\n";
136 }
137 include("$db_dir/summary");
138 ?>
139 </pre>
140 <ul>
141 <li>Packages in the wok: <?php
142 system("cd $wok && ls -1 | wc -l"); ?></li>
143 <li>Packages in the main repository: <?php
144 system("cd $packages && ls -1t *.tazpkg | wc -l"); ?></li>
145 <li>Packages in the incoming repository: <?php
146 system("cd $incoming && ls -1t *.tazpkg | wc -l"); ?></li>
147 <li>Commited packages: <?php
148 system("wc -l $packages/commit | cut -f 1 -d ' '"); ?></li>
149 <li>Packages to cook: <?php
150 system("wc -l $packages/cooklist | cut -f 1 -d ' '"); ?></li>
151 <li>Broken packages: <?php
152 system("wc -l $packages/broken | cut -f 1 -d ' '"); ?></li>
153 <li>Blocked packages: <?php
154 system("wc -l $packages/blocked | cut -f 1 -d ' '"); ?></li>
155 </ul>
157 <h3>Commit</h3>
158 <pre class="package">
159 <?php
160 include("$db_dir/commit");
161 ?>
162 </pre>
164 <h3>Cooklist</h3>
165 <pre class="package">
166 <?php
167 include("$db_dir/cooklist");
168 ?>
169 </pre>
171 <h3>Broken</h3>
172 <pre class="package">
173 <?php
174 include_and_link("$db_dir/broken");
175 ?>
176 </pre>
178 <h3>Blocked</h3>
179 <pre class="package">
180 <?php
181 include_and_link("$db_dir/blocked");
182 ?>
183 </pre>
185 <h3>Last cooked packages</h3>
186 <pre class="package">
187 <?php
188 list_last_cooked($incoming, "tazpkg");
189 ?>
190 </pre>
192 <h3>Last removed packages</h3>
193 <pre class="package">
194 <?php
195 include("$db_dir/removed");
196 ?>
197 </pre>
199 <h3>Last cooked flavors</h3>
200 <pre class="package">
201 <?php
202 list_last_cooked($packages, "flavor");
203 ?>
204 </pre>
206 <!-- End of content -->
207 </div>
209 <!-- Footer -->
210 <div id="footer">
211 <div class="right_box">
212 <h4>SliTaz Network</h4>
213 <ul>
214 <li><a href="http://www.slitaz.org/">Main Website</a></li>
215 <li><a href="http://doc.slitaz.org/">Documentation</a></li>
216 <li><a href="http://forum.slitaz.org/">Support Forum</a></li>
217 <li><a href="http://scn.slitaz.org/">Community Network</a></li>
218 <li><a href="http://labs.slitaz.org/">Laboratories</a></li>
219 <li><a href="http://twitter.com/slitaz">SliTaz on Twitter</a></li>
220 </ul>
221 </div>
222 <h4>SliTaz Website</h4>
223 <ul>
224 <li><a href="#header">Top of the page</a></li>
225 <li>Copyright &copy; <span class="year"></span>
226 <a href="http://www.slitaz.org/">SliTaz</a></li>
227 <li><a href="http://www.slitaz.org/en/about/">About the project</a></li>
228 <li><a href="http://www.slitaz.org/netmap.php">Network Map</a></li>
229 <li>Page modified the <?php echo (date( "d M Y", getlastmod())); ?></li>
230 <li><a href="http://validator.w3.org/check?uri=referer"><img
231 src="pics/website/xhtml10.png" alt="Valid XHTML 1.0"
232 title="Code validé XHTML 1.0"
233 style="width: 80px; height: 15px; vertical-align: middle;" /></a></li>
234 </ul>
235 </div>
237 </body>
238 </html>