1 | <html>
|
---|
2 | <head>
|
---|
3 | <title>Caveat Emptor</title>
|
---|
4 | <style type="text/css">
|
---|
5 | body { font-family: monospace; }
|
---|
6 | td { padding: 0 20px 0 0; text-align:right; }
|
---|
7 | td:first-child { text-align: left; }
|
---|
8 | h1,h2,h3,h4,h5,h6 { margin-bottom: .2em; }
|
---|
9 |
|
---|
10 | /* CSS to display an cross-out icon if the URL contains "diffcol-FAIL".
|
---|
11 | Based on:
|
---|
12 |
|
---|
13 | http://www.devwebpro.com/developer-icon-sets-collection-of-the-best-free-to-both-personal-commercial-use-icon-sets/
|
---|
14 | http://www.electrictoolbox.com/add-offsite-link-icon-after-external-links-css/
|
---|
15 | http://webcodertools.com/imagetobase64converter
|
---|
16 | http://www.greywyvern.com/code/php/binary2base64
|
---|
17 | Use this tool to create data streams for embedding images (or any type of file) in (X)HTML, CSS and XML.
|
---|
18 | http://stackoverflow.com/questions/49368/css2-attribute-selectors-with-regex
|
---|
19 | http://tools.css3.info/selectors-test/test.html
|
---|
20 | http://tools.css3.info/selectors-test/test-attribute-contains.html#attribute-contains
|
---|
21 | */
|
---|
22 | a[href*="diffcol-FAIL-"] {
|
---|
23 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAMCAYAAAC0qUeeAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAAd0SU1FB90LDQYPCR0HlEQAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAB20lEQVQozwXBT0hTcQDA8e/v9/bb1uZWY2mjqI6RXZK6dg+pLhVBh7KDGP0xIqOOdQmCTMv8AwVBnvqLWF3qnl2iUNAwJSc2nJvP7W3v7b239/br8xE69DWeT9+FHo52HUZJA0MHVEtrKEOwuLzK4MRzyHYgtG3rB/03uHv5CjJoApra2l+kvYVjVdDRNKOv33B/+gPiYW+fHui5xPz3Gbwtk4jfZGciTr20xu5cB8UNC5nLMfRpGqFnfujZr1+IRkO045DwBMmowmpUqJoVcm27CKIJyqk40i0WSWqNWy5x8NxZRNhi06zyezlP1+07BHYNv1wk7TeRnuvQ8hxink/+5ST7eq8yt1Kge3iE8ru3xI0GKjRJ6DpyeyaD13DIpNpoODbvB25yZmyE+VeTLBX+UXFrtLSP0QqQTatORERYNzdYXP3D6bHHLEy+oPPieZrJbTgqjkpn8T2FJKJwwxCQnBp8RH78KeWVJb49e8Kxa9dRsSiFSo2alohfQ+N6c26WlG+REiFGRICMUKu7KKXYLBfI7N2P2HMAI428d+RQJ9RtHNOEIMSzLHYYMVqeS1t7FjraGf34GaGrdd3ffZxbJ04SbqwjgwAZtNC2jVYGbibJ8NQUEz8X+A8Zn+eqFS9aTQAAAABJRU5ErkJggg==) center left no-repeat;
|
---|
24 | padding-left: 13px;
|
---|
25 | }
|
---|
26 | </style>
|
---|
27 | </head>
|
---|
28 | <body>
|
---|
29 |
|
---|
30 | <?php
|
---|
31 |
|
---|
32 | //chdir("/greenstone/greenstone.org/base/caveat-emptor");
|
---|
33 | if ( $_GET['latest'] ) {
|
---|
34 | chdir("/greenstone/greenstone.org/base/caveat-emptor/latest");
|
---|
35 | } else {
|
---|
36 | chdir("/greenstone/greenstone.org/base/caveat-emptor");
|
---|
37 | }
|
---|
38 | $handle = opendir( "." );
|
---|
39 | if ( $handle === false ) exit;
|
---|
40 | $todayFiles = array();
|
---|
41 |
|
---|
42 | if ( $_GET['offset']) {
|
---|
43 | $todayStart = strtotime(date("Y-m-d",strtotime($_GET['offset'] . " days")));
|
---|
44 | } else {
|
---|
45 | $todayStart = strtotime(date("Y-m-d"));
|
---|
46 | }
|
---|
47 | $tomorrowStart = strtotime("+1 days", $todayStart );
|
---|
48 |
|
---|
49 | $today = date("Y.m.d", $todayStart);
|
---|
50 | $todayWithHyphens = date("Y-m-d", $todayStart);
|
---|
51 |
|
---|
52 | $nextRelease2 = trim(file_get_contents("/greenstone/greenstone.org/base/next-release.txt"));
|
---|
53 | $nextRelease3 = trim(file_get_contents("/greenstone/greenstone.org/base/next-release-greenstone3.txt"));
|
---|
54 |
|
---|
55 | while ( ($file = readdir($handle)) !== false ) {
|
---|
56 | if ( substr($file,0,1) == "." ) continue;
|
---|
57 | if ( $file === "index.php" ) continue;
|
---|
58 | if ( $_GET['latest'] ) {
|
---|
59 | $todayFiles[$file] = true;
|
---|
60 | continue;
|
---|
61 | }
|
---|
62 |
|
---|
63 | if ( filemtime($file) >= $todayStart && filemtime($file) < $tomorrowStart ) {
|
---|
64 |
|
---|
65 | $todayFiles[$file] = true;
|
---|
66 | }
|
---|
67 | }
|
---|
68 | closedir( $handle );
|
---|
69 |
|
---|
70 | // sort array keys (filenames) in ascending order (array values are true/false)
|
---|
71 | // see http://www.php.net/manual/en/function.ksort.php
|
---|
72 | ksort($todayFiles);
|
---|
73 |
|
---|
74 | define( 'TOTAL_COLS', 3 );
|
---|
75 | function heading( $text, $level = 3 ) {
|
---|
76 | ?>
|
---|
77 | <tr>
|
---|
78 | <td colspan="<?php echo TOTAL_COLS; ?>">
|
---|
79 | <?php echo "<h" . $level . ">"; ?>
|
---|
80 | <?php echo $text; ?>
|
---|
81 | <?php echo "</h" . $level . ">"; ?>
|
---|
82 | </td>
|
---|
83 | </tr>
|
---|
84 | <?php
|
---|
85 | }
|
---|
86 |
|
---|
87 | function anchorheading( $text, $id, $level = 3 ) {
|
---|
88 | ?>
|
---|
89 | <tr>
|
---|
90 | <td colspan="<?php echo TOTAL_COLS; ?>">
|
---|
91 | <?php echo "<h" . $level . " id=\"".$id."\">"; ?>
|
---|
92 | <?php echo $text; ?>
|
---|
93 | <?php echo "</h" . $level . ">"; ?>
|
---|
94 | </td>
|
---|
95 | </tr>
|
---|
96 | <?php
|
---|
97 | }
|
---|
98 |
|
---|
99 |
|
---|
100 | function gap() {
|
---|
101 | ?>
|
---|
102 |
|
---|
103 | <tr><td colspan="<?php echo TOTAL_COLS; ?>"><br/></td></tr>
|
---|
104 | <?php
|
---|
105 | }
|
---|
106 |
|
---|
107 | function show( $file, $forceShow, $extra_info, $rename ) {
|
---|
108 | global $todayFiles;
|
---|
109 |
|
---|
110 | if ( $_GET['latest'] ) {
|
---|
111 | //echo "XXX $file";
|
---|
112 |
|
---|
113 | $regex = preg_replace( "/\d{4}.\d{2}\.\d{2}/", "\d{4}.\d{2}.\d{2}", $file );
|
---|
114 | $regex = preg_replace( "/\./", "\.", $regex );
|
---|
115 |
|
---|
116 | //echo " ZZZ $regex <br />";
|
---|
117 |
|
---|
118 | foreach( $todayFiles as $filename=>$notShown ) {
|
---|
119 | if ( $notShown && preg_match( "/^$regex$/", $filename ) ) {
|
---|
120 | //echo "BBB $filename<br />";
|
---|
121 | //$todayFiles[$file] = false;
|
---|
122 | $file = $filename;
|
---|
123 |
|
---|
124 | }
|
---|
125 | }
|
---|
126 |
|
---|
127 | }
|
---|
128 | $todayFiles[$file] = false;
|
---|
129 | //echo "CCC $file <br />";
|
---|
130 |
|
---|
131 | if ( file_exists($file) || $forceShow ) {
|
---|
132 | if ( $_GET['latest'] ) {
|
---|
133 |
|
---|
134 | $filepath="latest/".$file;
|
---|
135 | } else {
|
---|
136 | $filepath=$file;
|
---|
137 | }
|
---|
138 | ?>
|
---|
139 | <tr>
|
---|
140 | <td><a href="<?php echo $filepath; ?>"><?php if($rename) { echo $rename; } else { echo $file; } ?></a><?php if($extra_info) { echo " - ".$extra_info; } ?></td>
|
---|
141 | <td><?php echo date("h:ia",filemtime($file)); ?></td>
|
---|
142 | <td><?php echo formatBytes(filesize($file)); ?></td>
|
---|
143 | </tr>
|
---|
144 | <?php
|
---|
145 | } else {
|
---|
146 | ?>
|
---|
147 | <tr>
|
---|
148 | <td><?php echo $file; ?><?php if($extra_info) { echo " - ".$extra_info; } ?></td>
|
---|
149 | <td>-</td>
|
---|
150 | <td>-</td>
|
---|
151 | </tr>
|
---|
152 | <?php
|
---|
153 | }
|
---|
154 |
|
---|
155 | }
|
---|
156 | function formatBytes($bytes, $precision = 2) {
|
---|
157 | $units = array('B', 'KB', 'MB', 'GB', 'TB');
|
---|
158 |
|
---|
159 | $bytes = max($bytes, 0);
|
---|
160 | $pow = floor(($bytes ? log($bytes) : 0) / log(1024));
|
---|
161 | $pow = min($pow, count($units) - 1);
|
---|
162 |
|
---|
163 | $bytes /= pow(1024, $pow);
|
---|
164 |
|
---|
165 | return round($bytes, $precision) . ' ' . $units[$pow];
|
---|
166 | }
|
---|
167 |
|
---|
168 | function showAllMatching( $regex ) {
|
---|
169 | global $todayFiles;
|
---|
170 |
|
---|
171 | // in the latest folder, display the bin/src link for any available date
|
---|
172 | // (there should only be one)
|
---|
173 | if($_GET['latest']) {
|
---|
174 | $regex = preg_replace( "/\d{4}.\d{2}\.\d{2}/", "\d{4}.\d{2}.\d{2}", $regex );
|
---|
175 | }
|
---|
176 |
|
---|
177 | //echo "Regex: $regex<br />\n";
|
---|
178 |
|
---|
179 |
|
---|
180 | foreach( $todayFiles as $file=>$notShown ) {
|
---|
181 | if ( $notShown && preg_match( "/$regex/", $file ) ) {
|
---|
182 | show( $file );
|
---|
183 | }
|
---|
184 | }
|
---|
185 | }
|
---|
186 |
|
---|
187 | //show time machine
|
---|
188 | if ($_GET['latest'] ) {
|
---|
189 | echo "latest ";
|
---|
190 | } else {
|
---|
191 | echo "<a href=\"?latest=latest\">latest</a> ";
|
---|
192 | }
|
---|
193 | for ( $i=4; $i>=0; $i-- ) {
|
---|
194 | $d = date("Y-m-d",strtotime("-$i days"));
|
---|
195 | if ( $d == $todayWithHyphens && ! $_GET['latest']) {
|
---|
196 | echo $d;
|
---|
197 | } else {
|
---|
198 | ?>
|
---|
199 | <a href="?offset=-<?php echo $i; ?>"><?php echo $d; ?></a>
|
---|
200 | <?php
|
---|
201 | }
|
---|
202 | }
|
---|
203 |
|
---|
204 | echo "<br/><br/>";
|
---|
205 |
|
---|
206 | echo "<table>\n";
|
---|
207 | heading( "Greenstone3 Binary Releases" );
|
---|
208 | show("Greenstone-$nextRelease3-candidate-$today-linux");
|
---|
209 | show("Greenstone-$nextRelease3-candidate-$today-linux-x64");
|
---|
210 | show("Greenstone-$nextRelease3-candidate-$today-windows.exe");
|
---|
211 | showAllMatching("Greenstone-$nextRelease3-candidate-$today-MacOS-intel.dmg", 0, "for (Snow) Leopards (v10.5-10.6)", "Greenstone-$nextRelease3-candidate-$today-Leopard-MacOS-intel.dmg");
|
---|
212 | show("Greenstone-$nextRelease3-candidate-$today-Lion-MacOS-intel.dmg", 0, "for (Mountain) Lions (v10.7-10.8)");
|
---|
213 | //this picks up similar releases of other version numbers lying around
|
---|
214 | showAllMatching("Greenstone-3\..*-candidate-$today-linux$");
|
---|
215 | showAllMatching("Greenstone-3\..*-candidate-$today-windows.exe$");
|
---|
216 | showAllMatching("Greenstone-3\..*-candidate-$today-MacOS-intel.dmg$", 0, "for (Snow) Leopards (v10.5-10.6)");
|
---|
217 | showAllMatching("Greenstone-3\..*-candidate-$today-Lion-MacOS-intel.dmg$", 0, "for (Mountain) Lions (v10.7-10.8)");
|
---|
218 | gap();
|
---|
219 |
|
---|
220 | heading( "Greenstone3 Source Releases" );
|
---|
221 | showAllMatching("Greenstone-3\..*-candidate-$today-source-distribution.tar.gz");
|
---|
222 | showAllMatching("Greenstone-3\..*-candidate-$today-source-distribution.zip");
|
---|
223 | showAllMatching("Greenstone-3\..*-candidate-$today-source-component.tar.gz");
|
---|
224 | showAllMatching("Greenstone-3\..*-candidate-$today-source-component.zip");
|
---|
225 | gap();
|
---|
226 |
|
---|
227 | heading( "Greenstone2 Binary Releases" );
|
---|
228 | show("Greenstone-$nextRelease2-candidate-$today-linux");
|
---|
229 | show("Greenstone-$nextRelease2-candidate-$today-linux-x64");
|
---|
230 | show("Greenstone-$nextRelease2-candidate-$today-windows.exe");
|
---|
231 | showAllMatching("Greenstone-$nextRelease2-candidate-$today-MacOS-intel.dmg", 0, "for (Snow) Leopards (v10.5-10.6)","Greenstone-$nextRelease2-candidate-$today-Leopard-MacOS-intel.dmg");
|
---|
232 | show("Greenstone-$nextRelease2-candidate-$today-Lion-MacOS-intel.dmg", 0, "for (Mountain) Lions (v10.7-10.8)");
|
---|
233 |
|
---|
234 | showAllMatching("Greenstone-2\..*-candidate-$today-linux$");
|
---|
235 | showAllMatching("Greenstone-2\..*-candidate-$today-linux-x64$");
|
---|
236 | showAllMatching("Greenstone-2\..*-candidate-$today-windows.exe$");
|
---|
237 | showAllMatching("Greenstone-2\..*-candidate-$today-MacOS-intel.dmg$", 0, "for Snow Leopards (v10.5-10.6)");
|
---|
238 | showAllMatching("Greenstone-2\..*-candidate-$today-Lion-MacOS-intel.dmg$", 0, "for (Mountain) Lions (v10.7-10.8)");
|
---|
239 | gap();
|
---|
240 |
|
---|
241 | heading( "Greenstone2 Source Releases" );
|
---|
242 | showAllMatching("Greenstone-2\..*-candidate-$today-source-distribution.tar.gz");
|
---|
243 | showAllMatching("Greenstone-2\..*-candidate-$today-source-distribution.zip");
|
---|
244 | showAllMatching("Greenstone-2\..*-candidate-$today-source-component.tar.gz");
|
---|
245 | showAllMatching("Greenstone-2\..*-candidate-$today-source-component.zip");
|
---|
246 | gap();
|
---|
247 |
|
---|
248 | heading("Documented Examples" );
|
---|
249 | show("Greenstone-documented-examples-$today.tar.gz");
|
---|
250 | show("Greenstone-documented-examples-$today.zip");
|
---|
251 | gap();
|
---|
252 |
|
---|
253 | if ( ! $_GET['latest'] ) {
|
---|
254 | heading("Nightly Build Logs");
|
---|
255 | showAllMatching("\.txt$");
|
---|
256 | gap();
|
---|
257 | anchorheading("Regression Test Reports", "regression");
|
---|
258 | showAllMatching("\.html?$");
|
---|
259 | gap();
|
---|
260 | }
|
---|
261 |
|
---|
262 | heading( "Other Files" );
|
---|
263 | foreach( $todayFiles as $file=>$notShown ) {
|
---|
264 | if ( $notShown ) show( $file );
|
---|
265 | }
|
---|
266 | show("IsisGdl.bin32", 1,"","IsisGdl.linux32"); // temporary
|
---|
267 | show("IsisGdl.macleopard", 1); // temporary
|
---|
268 | gap();
|
---|
269 |
|
---|
270 | echo "</table>\n";
|
---|
271 |
|
---|
272 | ?>
|
---|
273 |
|
---|
274 | </body>
|
---|
275 | </html>
|
---|