Last active
January 3, 2016 05:49
-
-
Save soyo42/8418055 to your computer and use it in GitHub Desktop.
ODL - analyze dependency convergence log
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import re | |
if len(sys.argv) != 2: | |
sys.stderr.write('usage:: {0} <project name>\n'.format(sys.argv[0])) | |
sys.stderr.write('usage:: + redirect log into std input') | |
sys.exit(1) | |
prjName = sys.argv[1] | |
startDepError = re.compile('^Dependency convergence error for ') | |
depLine = re.compile('^ *\+-(.+)$') | |
depLineSeparator = re.compile('^(|and)$') | |
inError = False | |
versions = [] | |
lastDepLine = None | |
nameFound = False | |
myDependency = False | |
for i in sys.stdin: | |
i = i.strip() | |
if not inError: | |
mach = startDepError.match(i) | |
if mach: | |
inError = True | |
print i | |
else: | |
mach = depLine.match(i) | |
if mach: | |
#print '.', | |
lastDepLine = mach.group(1) | |
if lastDepLine.find(prjName) > -1: | |
nameFound = True | |
myDependency = True | |
continue | |
mach = depLineSeparator.match(i) | |
if mach: | |
#print '+', | |
if myDependency: | |
lastDepLine += ' *' | |
myDependency = False | |
versions.append(lastDepLine) | |
if mach.group(1) != '': | |
continue | |
inError = False | |
if nameFound: | |
for v in versions: | |
print v | |
versions = [] | |
lastDepLine = None | |
nameFound = False | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$2" ]; then | |
echo "usage:: $0 <convergence log file> <project name, e.g.:openflowplugin>" | |
exit 1 | |
fi | |
sed -nr '30,/Failed while enforcing releasability the error/ p' "$1" \ | |
| sed -nr '/^Dependency convergence error/,/^\]?$/ p' \ | |
| ./analyzeDepVersions.py "$2" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# help | |
./digConvergenceErrors.sh | |
# read "logFile" and focus on project "openflowplugin" | |
./digConvergenceErrors.sh logFile openflowplugin | less | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment