summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2013-05-14 17:02:25 +0200
committerJonathan Bauer2013-05-14 17:02:25 +0200
commit0c0d757862934517e6792ae0d07a258096c2ddb6 (patch)
treef5f39a1438c36e90c0abcd4e1129a1cfa25dca75
parentopenbox (diff)
parentMerge branch 'master' of openslx:openslx-ng/tm-scripts (diff)
downloadtm-scripts-0c0d757862934517e6792ae0d07a258096c2ddb6.tar.gz
tm-scripts-0c0d757862934517e6792ae0d07a258096c2ddb6.tar.xz
tm-scripts-0c0d757862934517e6792ae0d07a258096c2ddb6.zip
Merge branch 'master' of git:openslx-ng/tm-scripts
-rwxr-xr-xuseful/ultrastrace.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/useful/ultrastrace.php b/useful/ultrastrace.php
index ea8161ea..0caaf64a 100755
--- a/useful/ultrastrace.php
+++ b/useful/ultrastrace.php
@@ -14,6 +14,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");
@@ -41,17 +47,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);