diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-12-19 09:26:21 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-12-19 09:26:21 +0000 |
commit | 51be336ded6996c02050d2d5142ca818c07119ff (patch) | |
tree | 9530b803c2575e02accb76c08a32770a938357be | |
parent | 171e3f1b4c0117a7ea0160e2977d1e08e6612c0a (diff) | |
download | mana-51be336ded6996c02050d2d5142ca818c07119ff.tar.gz mana-51be336ded6996c02050d2d5142ca818c07119ff.tar.bz2 mana-51be336ded6996c02050d2d5142ca818c07119ff.tar.xz mana-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.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | tools/upalyzer/analyze.php | 26 |
2 files changed, 27 insertions, 6 deletions
@@ -1,3 +1,10 @@ +2007-12-19 Bjørn Lindeijer <bjorn@lindeijer.nl> + + * tools/upalyzer/analyse.php: 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. + 2007-12-18 Bjørn Lindeijer <bjorn@lindeijer.nl> * src/main.cpp: Remember to delete the progressbar and label also when 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); |