summaryrefslogtreecommitdiff
path: root/tools/upalyzer/analyze.php
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-11-23 22:16:43 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-01-05 21:13:12 +0100
commit185dbecf089c20c82c7cde533cb4995cd22e463d (patch)
tree8f27bba8cdd9c67843844ca4926d08644dfd19d4 /tools/upalyzer/analyze.php
parent83a903287438f43033231880f8fc42e9c7e46ddc (diff)
downloadmana-client-185dbecf089c20c82c7cde533cb4995cd22e463d.tar.gz
mana-client-185dbecf089c20c82c7cde533cb4995cd22e463d.tar.bz2
mana-client-185dbecf089c20c82c7cde533cb4995cd22e463d.tar.xz
mana-client-185dbecf089c20c82c7cde533cb4995cd22e463d.zip
Take into account removed files for obsoleted data
Also ripped out the Subversion stuff and made the download links local. (cherry picked from commit 5523ebb7850d99ecf750009b853dad6cb914e9e5)
Diffstat (limited to 'tools/upalyzer/analyze.php')
-rw-r--r--tools/upalyzer/analyze.php36
1 files changed, 18 insertions, 18 deletions
diff --git a/tools/upalyzer/analyze.php b/tools/upalyzer/analyze.php
index 3758eae4..43057af1 100644
--- a/tools/upalyzer/analyze.php
+++ b/tools/upalyzer/analyze.php
@@ -31,9 +31,8 @@ header("Pragma: no-cache");
List of current updates:
<?php
-$svn_url_base = 'http://themanaworld.svn.sourceforge.net/viewvc/themanaworld/tmwdata/trunk/';
-$download_url_base = 'http://themanaworld.svn.sourceforge.net/viewvc/*checkout*/themanaworld/tmwdata/trunk/';
-$svn_checkout_path = '/home/eathena/public_html/updates/tmwdata/';
+$download_url_base = 'http://updates.themanaworld.org/tmwdata/';
+$checkout_path = '/home/eathena/public_html/updates/tmwdata/';
$update_file = array_filter(array_reverse(file('resources2.txt')));
$updates = array();
$update_file_maxlen = 0;
@@ -65,16 +64,20 @@ foreach ($update_file as $update_line)
$update['uncompressed_size'] += zip_entry_filesize($zip_entry);
$entry_name = zip_entry_name($zip_entry);
$entry_size = zip_entry_compressedsize($zip_entry);
+ $entry_exists = file_exists($checkout_path . $entry_name);
$entry_used = !array_key_exists($entry_name, $update_entries);
$entries[$entry_name] = array(
'name' => $entry_name,
'size' => $entry_size,
- 'used' => $entry_used);
+ 'used' => $entry_used,
+ 'obsolete' => !$entry_exists);
$update['size'] += $entry_size;
if ($entry_used) {
- $update['used_entry_count']++;
- $update['used_size'] += $entry_size;
+ if ($entry_exists) {
+ $update['used_entry_count']++;
+ $update['used_size'] += $entry_size;
+ }
$update_entries[$entry_name] = $update;
}
@@ -143,20 +146,14 @@ ksort($update_entries);
foreach ($update_entries as $entry => $update)
{
- $exists = file_exists($svn_checkout_path . $entry);
+ $exists = file_exists($checkout_path . $entry);
printf("<span style=\"color: %s;\">%-{$update_entry_maxlen}s</span> ",
$exists ? "black" : "rgb(100,100,100)",
$entry);
print_update_name($update, true);
- if ($exists) {
- // Temporary hack to make URLs to map files work
- $entry = str_replace('.tmx.gz', '.tmx', $entry);
-
- printf(' <a href="%s%s?view=log">svn</a>', $svn_url_base, $entry);
- if (substr($entry, strlen($entry) - 1) != '/')
- printf(' <a href="%s%s">download</a>', $download_url_base, $entry);
- }
+ if ($exists && substr($entry, strlen($entry) - 1) != '/')
+ printf(' <a href="%s%s">download</a>', $download_url_base, $entry);
echo "\n";
}
@@ -168,10 +165,13 @@ foreach (array_reverse($updates) as $update)
print "\n<a name=\"".$update['file']."\"/><b>".$update['file']."</b>\n";
foreach ($update['entries'] as $entry_name => $entry) {
- printf("%-{$update_entry_maxlen}s", $entry_name);
- if ($entry['used']) {
+ printf("%s%-{$update_entry_maxlen}s%s",
+ $entry['obsolete'] ? "<span style=\"color: rgb(100,100,100);\">" : "",
+ $entry_name,
+ $entry['obsolete'] ? "</span>" : "");
+ if ($entry['used'] && !$entry['obsolete']) {
echo ' *';
- } else {
+ } elseif (!$entry['obsolete']) {
echo ' ';
print_update_name($update_entries[$entry_name], false);
}