summaryrefslogtreecommitdiffstats
path: root/useful
diff options
context:
space:
mode:
authorSimon Rettberg2013-05-14 16:41:46 +0200
committerSimon Rettberg2013-05-14 16:41:46 +0200
commit4d0c663f1fcc93dd3e12089fba060c21f17da8d0 (patch)
tree75b21b64d975825a54a6d4dbf60d1d3cd6175fc5 /useful
parentTweak mod loading in stage31 (diff)
downloadtm-scripts-4d0c663f1fcc93dd3e12089fba060c21f17da8d0.tar.gz
tm-scripts-4d0c663f1fcc93dd3e12089fba060c21f17da8d0.tar.xz
tm-scripts-4d0c663f1fcc93dd3e12089fba060c21f17da8d0.zip
ultrastracke 2
Diffstat (limited to 'useful')
-rwxr-xr-xuseful/ultrastrace.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/useful/ultrastrace.php b/useful/ultrastrace.php
index eeff80c2..8c826ee5 100755
--- a/useful/ultrastrace.php
+++ b/useful/ultrastrace.php
@@ -13,6 +13,12 @@ $found = array();
array_shift($argv);
+$unique = false;
+if ($argv[0] == '-u') {
+ array_shift($argv);
+ $unique = true;
+}
+
foreach ($argv as $fname) {
$fh = fopen($fname, 'r');
if ($fh === false) die("File not found: $fname\n");
@@ -40,17 +46,22 @@ foreach ($argv as $fname) {
$file = basename($out['lib']);
$file = preg_replace('/\.so(\.\d+)*$/', '', $file);
if ($out['ret'] < 0) {
+ $str = ':-( ' . $out['lib'] . ' *** (' . (isset($out['err']) ? $out['err'] : 'Unknown Error') . ') (' . $out[ 'action'] . ')';
if (isset($found[$file])) {
- $found[$file][] = ':-( ' . $out['lib'] . ' *** (' . (isset($out['err']) ? $out['err'] : 'Unknown Error') . ') (' . $out['action'] . ')';
+ if (!$unique || !in_array($str, $found[$file]))
+ $found[$file][] = $str;
} else {
- $failed[$file][] = ':-( ' . $out['lib'] . ' *** (' . (isset($out['err']) ? $out['err'] : 'Unknown Error') . ') (' . $out['action'] . ')';
+ if (!$unique || !isset($failed[$file]) || !in_array($str, $failed[$file]))
+ $failed[$file][] = $str;
}
} else {
if (isset($failed[$file])) {
$found[$file] = $failed[$file];
unset($failed[$file]);
}
- $found[$file][] = ':-) ' . $out['lib'] . ' (' . $out['action'] . ')';
+ $str = ':-) ' . $out['lib'] . ' (' . $out['action'] . ')';
+ if (!$unique || !isset($found[$file]) || !in_array($str, $found[$file]))
+ $found[$file][] = $str;
}
}
fclose($fh);