diff --git a/buildLogAnalyzer.py b/buildLogAnalyzer.py index 95387739d77..49db1827236 100755 --- a/buildLogAnalyzer.py +++ b/buildLogAnalyzer.py @@ -123,6 +123,8 @@ def __init__( "ok": "ok", } + self.cmsswVersion = os.getenv("CMSSW_VERSION", "master") + # get the lists separately for "priority" treatment ... self.errMap = {} for key in self.errorKeys: @@ -380,7 +382,11 @@ def makeHTMLSummaryPage(self): def makeHTMLLogFile(self, pkg): """docstring for makeHTMLFile""" - linePartsUrl = re.compile(r"\s*(src(/[^:]+):(\d+)):.*") + linePartsUrl = re.compile( + r"\s+(?P(?:.*/" + + self.cmsswVersion + + r"/)?(?Psrc/[^:(]+)[:(](?P\d+)\)?):" + ) if not pkg.name() in self.tagList: return @@ -413,9 +419,17 @@ def makeHTMLLogFile(self, pkg): if lineNo in pkg.errLines.keys(): m = linePartsUrl.match(newLine) if m: - branch = os.getenv("CMSSW_VERSION", "master") - url = "https://github.com/cms-sw/cmssw/blob/" + branch + m[2] + "#L" + m[3] - newLine = newLine.replace(m[1], '' + m[1] + "", 1) + url = ( + "https://github.com/cms-sw/cmssw/blob/" + + self.cmsswVersion + + m["file"] + + "#L" + + m["line"] + ) + + newLine = newLine.replace( + m["full_path"], '' + m["full_path"] + "", 1 + ) newLine = ( "