summaryrefslogtreecommitdiff
path: root/tools/upalyzer
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-12-19 09:26:21 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-12-19 09:26:21 +0000
commit51be336ded6996c02050d2d5142ca818c07119ff (patch)
tree9530b803c2575e02accb76c08a32770a938357be /tools/upalyzer
parent171e3f1b4c0117a7ea0160e2977d1e08e6612c0a (diff)
downloadmana-client-51be336ded6996c02050d2d5142ca818c07119ff.tar.gz
mana-client-51be336ded6996c02050d2d5142ca818c07119ff.tar.bz2
mana-client-51be336ded6996c02050d2d5142ca818c07119ff.tar.xz
mana-client-51be336ded6996c02050d2d5142ca818c07119ff.zip
Fixed association of entries to update, added no-cache headers, added a bit of
error reporting in case of invalid zip files, kept original ordering of the update list and sorted the list of entries on their filename.
Diffstat (limited to 'tools/upalyzer')
-rw-r--r--tools/upalyzer/analyze.php26
1 files changed, 20 insertions, 6 deletions
diff --git a/tools/upalyzer/analyze.php b/tools/upalyzer/analyze.php
index 36842a6d..7a3c3e30 100644
--- a/tools/upalyzer/analyze.php
+++ b/tools/upalyzer/analyze.php
@@ -18,6 +18,11 @@
* along with upalyzer; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+header("Content-type: text/html");
+header("Cache-Control: no-store, no-cache, must-revalidate");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
+
?>
<html>
<head><title>Update analysis</title></head>
@@ -66,15 +71,18 @@ foreach ($update_file as $update_line)
$update['size'] += $entry_size;
if ($entry_used) {
+ $update_entries[$entry_name] = $update['file'];
$update['used_entry_count']++;
$update['used_size'] += $entry_size;
}
- $update_entries[$entry_name] = $update['file'];
$update_entry_maxlen = max($update_entry_maxlen, strlen($entry_name));
}
zip_close($zip);
}
+ else {
+ $update['zip_error'] = true;
+ }
$update['entries'] = $entries;
$update['used_percentage'] = $update['used_size'] / $update['size'];
@@ -86,15 +94,19 @@ foreach ($update_file as $update_line)
$data_overhead_size += $update['filesize'] - $update['size'];
}
-foreach ($updates as &$update)
+foreach (array_reverse($updates) as $update)
{
printf("%-{$update_file_maxlen}s ", $update['file']);
echo $update['adler32'];
printf(" %4d kb", $update['filesize'] / 1024);
- printf(" %4d kb", $update['uncompressed_size'] / 1024);
- printf(" %3d%% used (%d/%d files)", $update['used_percentage'] * 100,
- $update['used_entry_count'],
- count($update['entries']));
+ if (!$update['zip_error']) {
+ printf(" %4d kb", $update['uncompressed_size'] / 1024);
+ printf(" %3d%% used (%d/%d files)", $update['used_percentage'] * 100,
+ $update['used_entry_count'],
+ count($update['entries']));
+ } else {
+ printf(" Error!");
+ }
echo "\n";
}
@@ -109,6 +121,8 @@ printf("Obsoleted data: %4d kb (%d%%)\n",
printf("\n");
+ksort($update_entries);
+
foreach ($update_entries as $entry => $update)
{
printf("%-{$update_entry_maxlen}s %s\n", $entry, $update);