3 # TeX Live 2012 seems to dislike files produces by doxygen (1.8.x.y)
4 # In particular, makeindex(1) program creates invalid index entries like
6 # (note the trailing underscore in the page number). This breaks automatic
7 # builds and is very annoying. Hence this script. It replaces (broken)
8 # \hyperpage{NNN_} with \hyperpage{NNN}.
9 # Note: this is an ugly work around, a proper fix is welcome.
13 """ Fix \\hyperpage{NNN_} entries in the ind file @var{fname} """
14 tmpout = fname + '.tmp'
16 out = open(tmpout, 'wt')
17 rx = re.compile('(hyperpage)[{]([0-9]+)[_][}]')
19 out.write(re.sub(rx, '\\1{\\2}', line))
23 os.rename(tmpout, fname)
25 if __name__ == '__main__':
26 if len(sys.argv) <= 1: