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;
|
gokhlayeh@267
|
15 if (($fp = fopen($file,"r")) === false) return;
|
gokhlayeh@267
|
16 while (($pkg = fgets($fp)) !== false) {
|
gokhlayeh@267
|
17 $pkg = chop($pkg);
|
gokhlayeh@267
|
18 if (file_exists("$log_dir/$pkg.html"))
|
gokhlayeh@267
|
19 echo "<a href=\"log.php?version=$version&package=$pkg\">$pkg</a>\n";
|
gokhlayeh@267
|
20 else echo "$pkg\n";
|
gokhlayeh@267
|
21 }
|
gokhlayeh@267
|
22 fclose($fp);
|
gokhlayeh@267
|
23 }
|
gokhlayeh@267
|
24
|
gokhlayeh@267
|
25 function list_last_cooked($dir, $suffix)
|
gokhlayeh@267
|
26 {
|
gokhlayeh@267
|
27 global $version;
|
gokhlayeh@267
|
28 $path=basename($dir);
|
gokhlayeh@267
|
29 system("cd $dir && ls -1t *.$suffix | head -20 | \
|
gokhlayeh@267
|
30 while read file; do echo -n \$(stat -c '%y' $dir/\$file | \
|
gokhlayeh@267
|
31 cut -d. -f1); echo ' <a href=\"download.php?version=$version&package=$path/'\$file'\">'\$file'</a>'; done");
|
gokhlayeh@267
|
32 }
|
gokhlayeh@267
|
33
|
gokhlayeh@186
|
34 ?>
|
gokhlayeh@186
|
35 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
gokhlayeh@186
|
36 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
gokhlayeh@186
|
37 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
gokhlayeh@186
|
38 <head>
|
gokhlayeh@186
|
39 <title>SliTaz Build Bot</title>
|
gokhlayeh@186
|
40 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
|
gokhlayeh@186
|
41 <meta name="description" content="Tazbb web interface" />
|
pascal@363
|
42 <?php
|
pascal@363
|
43 if (isset($_GET["refresh"]))
|
pascal@363
|
44 echo " <meta http-equiv=\"refresh\" content=\""
|
pascal@363
|
45 .$_GET["refresh"]."; URL=\""
|
pascal@363
|
46 .$_SERVER["REQUEST_URI"].">\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"
|
pankso@348
|
110 and 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>
|
gokhlayeh@235
|
121 <form action="log.php" method="get">
|
gokhlayeh@235
|
122 <input type="hidden" name="version" value="<?php
|
gokhlayeh@235
|
123 echo "$version";
|
gokhlayeh@235
|
124 ?>
|
gokhlayeh@235
|
125 " />
|
pascal@370
|
126 Show pkg log:
|
pankso@341
|
127 <input type="text" name="package" style="width: 320px;" />
|
gokhlayeh@235
|
128 <!-- <input type="submit" value="Show" /> -->
|
pankso@348
|
129 </form>
|
gokhlayeh@186
|
130 </p>
|
gokhlayeh@186
|
131
|
pascal@369
|
132 <a name="Summary"></a>
|
gokhlayeh@247
|
133 <h2>Summary</h2>
|
pascal@372
|
134 <?php if (strpos($_SERVER["SERVER_NAME"],"slitaz.org") !== FALSE) { ?>
|
pascal@372
|
135 <img src="http://tank.slitaz.org/pics/rrd/cpu-day.png" title="cpu dailey" alt="cpu daily" />
|
pascal@372
|
136 <?php } ?>
|
pankso@342
|
137 <ul>
|
gokhlayeh@186
|
138 <?php
|
pankso@342
|
139 // Check curent status (update in real time) and display summary.
|
pascal@349
|
140 $status = "Chroot is not mounted";
|
pankso@342
|
141 if (file_exists($lockfile)) {
|
pascal@350
|
142 $status = "Chroot is mounted";
|
pankso@342
|
143 }
|
pascal@349
|
144 if (file_exists("$log_dir/step")) {
|
pascal@369
|
145 $duration = time() - filemtime("$log_dir/step");
|
pascal@369
|
146 if ($duration < 60)
|
pascal@369
|
147 $duration .= "s";
|
pascal@369
|
148 else if ($duration < 3600)
|
pascal@369
|
149 $duration = floor($duration / 60). " min";
|
pascal@369
|
150 else $duration = sprintf("%dH%02d",floor($duration / 3600),
|
pascal@369
|
151 ($duration / 60) % 60);
|
pascal@370
|
152 $status .= ". ".file_get_contents("$log_dir/step")." ($duration ago)";
|
pascal@349
|
153 if (file_exists("$log_dir/package")) {
|
pascal@349
|
154 $pkg = file_get_contents("$log_dir/package");
|
pascal@351
|
155 $pkg = chop($pkg);
|
pascal@349
|
156 if (file_exists("$log_dir/$pkg.html"))
|
pascal@349
|
157 $status .= " <a href=\"log.php?version=$version&package=$pkg\">$pkg</a>";
|
pascal@351
|
158 else $status .= " $pkg";
|
pascal@349
|
159 }
|
pankso@342
|
160 }
|
pascal@363
|
161 echo "<li>".date(DATE_RFC822).": $status</li>\n";
|
gokhlayeh@371
|
162 // Set $version_in_url.
|
gokhlayeh@371
|
163 if ("$version_in_url") {
|
gokhlayeh@371
|
164 $version_in_url="?version=$version_in_url";
|
gokhlayeh@371
|
165 }
|
pascal@372
|
166 else if (strpos($_SERVER["REQUEST_URI"],"?") !== FALSE)
|
pascal@372
|
167 $version_in_url="?";
|
gokhlayeh@186
|
168 ?>
|
pascal@370
|
169 <li><a href="http://hg.slitaz.org/wok<?php
|
pascal@370
|
170 if ($version != "cooking") echo "-$version";
|
pascal@370
|
171 echo "\">Packages in the wok</a>: ";
|
pankso@342
|
172 system("cd $wok && ls -1 | wc -l"); ?></li>
|
pankso@342
|
173 <li>Packages in the main repository: <?php
|
pankso@344
|
174 system("cd $packages && ls -1t *.tazpkg | wc -l"); ?></li>
|
gokhlayeh@371
|
175 <li><?php
|
gokhlayeh@371
|
176 echo "<a href=\"$version_in_url#cooked\">Packages in the incoming repository</a>: ";
|
pankso@344
|
177 system("cd $incoming && ls -1t *.tazpkg | wc -l"); ?></li>
|
gokhlayeh@371
|
178 <li><?php
|
gokhlayeh@371
|
179 echo "<a href=\"$version_in_url#Commit\">Commited packages</a>: ";
|
pascal@347
|
180 system("wc -l < $db_dir/commit"); ?></li>
|
gokhlayeh@371
|
181 <li><?php
|
gokhlayeh@371
|
182 echo "<a href=\"$version_in_url#Cooklist\">Packages to cook</a>: ";
|
pascal@347
|
183 system("wc -l < $db_dir/cooklist"); ?></li>
|
gokhlayeh@371
|
184 <li><?php
|
gokhlayeh@371
|
185 echo "<a href=\"$version_in_url#Broken\">Broken packages</a>: ";
|
pascal@347
|
186 system("wc -l < $db_dir/broken"); ?></li>
|
gokhlayeh@371
|
187 <li><?php
|
gokhlayeh@371
|
188 echo "<a href=\"$version_in_url#Blocked\">Blocked packages</a>: ";
|
pascal@347
|
189 system("wc -l < $db_dir/blocked"); ?></li>
|
gokhlayeh@265
|
190 </ul>
|
gokhlayeh@186
|
191
|
pascal@363
|
192 <?php
|
pascal@363
|
193 if (!isset($_GET["summary"])) {
|
pascal@363
|
194 ?>
|
pascal@369
|
195 <a name="Commit"></a>
|
gokhlayeh@186
|
196 <h3>Commit</h3>
|
gokhlayeh@186
|
197 <pre class="package">
|
gokhlayeh@186
|
198 <?php
|
gokhlayeh@186
|
199 include("$db_dir/commit");
|
gokhlayeh@186
|
200 ?>
|
gokhlayeh@186
|
201 </pre>
|
gokhlayeh@186
|
202
|
pascal@369
|
203 <a name="Cooklist"></a>
|
gokhlayeh@186
|
204 <h3>Cooklist</h3>
|
gokhlayeh@186
|
205 <pre class="package">
|
gokhlayeh@186
|
206 <?php
|
gokhlayeh@186
|
207 include("$db_dir/cooklist");
|
gokhlayeh@186
|
208 ?>
|
gokhlayeh@186
|
209 </pre>
|
gokhlayeh@186
|
210
|
pascal@369
|
211 <a name="Broken"></a>
|
gokhlayeh@186
|
212 <h3>Broken</h3>
|
gokhlayeh@186
|
213 <pre class="package">
|
gokhlayeh@186
|
214 <?php
|
gokhlayeh@267
|
215 include_and_link("$db_dir/broken");
|
gokhlayeh@186
|
216 ?>
|
gokhlayeh@186
|
217 </pre>
|
gokhlayeh@186
|
218
|
pascal@369
|
219 <a name="Blocked"></a>
|
gokhlayeh@186
|
220 <h3>Blocked</h3>
|
gokhlayeh@186
|
221 <pre class="package">
|
gokhlayeh@186
|
222 <?php
|
gokhlayeh@267
|
223 include_and_link("$db_dir/blocked");
|
gokhlayeh@186
|
224 ?>
|
gokhlayeh@186
|
225 </pre>
|
gokhlayeh@186
|
226
|
pascal@369
|
227 <a name="cooked"></a>
|
gokhlayeh@186
|
228 <h3>Last cooked packages</h3>
|
gokhlayeh@186
|
229 <pre class="package">
|
gokhlayeh@186
|
230 <?php
|
gokhlayeh@267
|
231 list_last_cooked($incoming, "tazpkg");
|
gokhlayeh@267
|
232 ?>
|
gokhlayeh@186
|
233 </pre>
|
gokhlayeh@186
|
234
|
pascal@369
|
235 <a name="removed"></a>
|
gokhlayeh@186
|
236 <h3>Last removed packages</h3>
|
gokhlayeh@186
|
237 <pre class="package">
|
gokhlayeh@186
|
238 <?php
|
gokhlayeh@186
|
239 include("$db_dir/removed");
|
gokhlayeh@186
|
240 ?>
|
gokhlayeh@186
|
241 </pre>
|
gokhlayeh@186
|
242
|
pascal@369
|
243 <a name="flavors"></a>
|
gokhlayeh@186
|
244 <h3>Last cooked flavors</h3>
|
gokhlayeh@186
|
245 <pre class="package">
|
gokhlayeh@186
|
246 <?php
|
gokhlayeh@267
|
247 list_last_cooked($packages, "flavor");
|
gokhlayeh@267
|
248 ?>
|
gokhlayeh@186
|
249 </pre>
|
gokhlayeh@186
|
250
|
pascal@363
|
251 <?php
|
pascal@363
|
252 } // isset summary
|
pascal@363
|
253 ?>
|
gokhlayeh@235
|
254 <!-- End of content -->
|
gokhlayeh@186
|
255 </div>
|
gokhlayeh@186
|
256
|
gokhlayeh@235
|
257 <!-- Footer -->
|
gokhlayeh@235
|
258 <div id="footer">
|
gokhlayeh@235
|
259 <div class="right_box">
|
gokhlayeh@235
|
260 <h4>SliTaz Network</h4>
|
gokhlayeh@235
|
261 <ul>
|
gokhlayeh@235
|
262 <li><a href="http://www.slitaz.org/">Main Website</a></li>
|
gokhlayeh@235
|
263 <li><a href="http://doc.slitaz.org/">Documentation</a></li>
|
gokhlayeh@235
|
264 <li><a href="http://forum.slitaz.org/">Support Forum</a></li>
|
gokhlayeh@235
|
265 <li><a href="http://scn.slitaz.org/">Community Network</a></li>
|
gokhlayeh@235
|
266 <li><a href="http://labs.slitaz.org/">Laboratories</a></li>
|
gokhlayeh@235
|
267 <li><a href="http://twitter.com/slitaz">SliTaz on Twitter</a></li>
|
pankso@344
|
268 <li><a href="http://www.facebook.com/slitaz">SliTaz on Facebook</a></li>
|
gokhlayeh@235
|
269 </ul>
|
gokhlayeh@235
|
270 </div>
|
gokhlayeh@235
|
271 <h4>SliTaz Website</h4>
|
gokhlayeh@235
|
272 <ul>
|
gokhlayeh@235
|
273 <li><a href="#header">Top of the page</a></li>
|
gokhlayeh@235
|
274 <li>Copyright © <span class="year"></span>
|
gokhlayeh@235
|
275 <a href="http://www.slitaz.org/">SliTaz</a></li>
|
gokhlayeh@235
|
276 <li><a href="http://www.slitaz.org/en/about/">About the project</a></li>
|
gokhlayeh@235
|
277 <li><a href="http://www.slitaz.org/netmap.php">Network Map</a></li>
|
gokhlayeh@235
|
278 <li>Page modified the <?php echo (date( "d M Y", getlastmod())); ?></li>
|
gokhlayeh@235
|
279 <li><a href="http://validator.w3.org/check?uri=referer"><img
|
gokhlayeh@235
|
280 src="pics/website/xhtml10.png" alt="Valid XHTML 1.0"
|
gokhlayeh@235
|
281 title="Code validé XHTML 1.0"
|
gokhlayeh@235
|
282 style="width: 80px; height: 15px; vertical-align: middle;" /></a></li>
|
gokhlayeh@235
|
283 </ul>
|
gokhlayeh@186
|
284 </div>
|
gokhlayeh@186
|
285
|
gokhlayeh@186
|
286 </body>
|
gokhlayeh@186
|
287 </html>
|