diff --git a/buildLogAnalyzer.py b/buildLogAnalyzer.py index fa7445d3d3c..18cd6fed455 100755 --- a/buildLogAnalyzer.py +++ b/buildLogAnalyzer.py @@ -380,6 +380,11 @@ def makeHTMLSummaryPage(self): def makeHTMLLogFile(self, pkg): """docstring for makeHTMLFile""" + linePartsUrl = re.compile( + r"(?P(?:.*/" + + self.release + + r"/)?src(?P/[^:(]+)[:(](?P\d+)\)?):" + ) if not pkg.name() in self.tagList: return @@ -410,6 +415,21 @@ def makeHTMLLogFile(self, pkg): ) # do this first to not escape it again in the next subs newLine = newLine.replace("<", "<").replace(">", ">") if lineNo in pkg.errLines.keys(): + m = linePartsUrl.match(newLine.strip()) + if m: + url = ( + "https://github.com/cms-sw/cmssw/blob/" + + self.release + + m.group("file") + + "#L" + + m.group("line") + ) + + newLine = newLine.replace( + m.group("full_path"), + '' + m.group("full_path") + "", + 1, + ) newLine = ( "