diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2015-09-05 12:20:19 +0100 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2015-09-05 12:20:19 +0100 |
commit | f70522e5ebb52030132c2a0357371bc0fcb18845 (patch) | |
tree | c5aadb3fcd9ce5a0fd8544ae7ac1e58ea6acf573 | |
parent | b6834dc7c69d563dab0807af990122d0b785b702 (diff) |
More work
-rw-r--r-- | gitmaildirsource.py | 52 | ||||
-rwxr-xr-x | master.cfg | 9 | ||||
-rwxr-xr-x | moduleset_parser.py | 6 |
3 files changed, 60 insertions, 7 deletions
diff --git a/gitmaildirsource.py b/gitmaildirsource.py index 40e7664..2cfe4d3 100644 --- a/gitmaildirsource.py +++ b/gitmaildirsource.py @@ -26,6 +26,40 @@ class GitMaildirSource(MaildirSource): repository = "" branch = "" + list = m["list-id"] + log.msg("list '%s'" % list) + + if "xorg-commit.lists.x.org" in list: + repopathmap = { 'xorg' : [ 'xserver' ], + 'xorg/app' : [ 'appres' , 'bdftopcf', 'bitmap', 'editres', 'iceauth', 'luit', 'mkfontdir', 'mkfontscale', 'rendercheck', 'rgb', 'rstart', 'scripts', 'sessreg', 'setxkbmap', 'smproxy', 'twm', + 'x11perf', 'xauth', 'xbacklight', 'xcalc', 'xclipboard', 'xclock', 'xcmsdb', 'xconsole', 'xcursorgen', 'xditview', 'xdm', 'xdpyinfo', 'xdriinfo', 'xev', 'xeyes', 'xfd', 'xfontsel', 'xfs', + 'xfsinfo', 'xgamma', 'xhost', 'xinit', 'xinput', 'xkbcomp', 'xkbevd', 'xkbutils', 'xkill', 'xload', 'xlogo', 'xlsatoms', 'xlsclients', 'xman', 'xmodmap', 'xpr', 'xprop', 'xrandr', 'xrdb', + 'xrefresh', 'xset', 'xsetroot', 'xsm', 'xstdcmap', 'xvidtune', 'xvinfo', 'xwd', 'xwininfo', 'xwud' ], + 'xorg/doc' : [ 'xorg-docs', 'xorg-sgml-doctools' ], + 'xorg/driver' : [ 'xf86-video-dummy', 'xf86-video-nested' ], + 'xorg/font' : [ 'util', 'encodings', 'adobe-100dpi', 'adobe-75dpi', 'adobe-utopia-100dpi', 'adobe-utopia-75dpi', 'adobe-utopia-type1', 'arabic-misc', 'bh-100dpi', 'bh-75dpi', 'bh-lucidatypewriter-100dpi', + 'bh-lucidatypewriter-75dpi', 'bh-ttf', 'bh-type1', 'bitstream-100dpi', 'bitstream-75dpi', 'bitstream-type1', 'cronyx-cyrillic', 'cursor-misc', 'daewoo-misc', 'dec-misc', 'ibm-type1', + 'isas-misc', 'jis-misc', 'micro-misc', 'misc-cyrillic', 'misc-ethiopic', 'misc-meltho', 'misc-misc', 'mutt-misc', 'schumacher-misc', 'screen-cyrillic', 'sony-misc', 'sun-misc', + 'winitzki-cyrillic', 'xfree86-type1', 'alias' ], + 'xorg/lib' : [ 'libAppleWM', 'libFS', 'libICE', 'libpciaccess', 'libSM', 'libX11', 'libXScrnSaver', 'libXau', 'libXaw', 'libXaw3d', 'libXcomposite', 'libXcursor', 'libXdamage', 'libXdmcp', 'libXext', + 'libXfixes', 'libXfont', 'libXft', 'libXi', 'libXinerama', 'libXmu', 'libXpm', 'libXrandr', 'libXrender', 'libXRes', 'libXt', 'libXtst', 'libXv', 'libXvMC', 'libXxf86dga', 'libXxf86vm', + 'libdmx', 'libfontenc', 'libxkbfile', 'libxshmfence', 'libxtrans', 'libWindowsWM' ], + 'xorg/proto' : [ 'applewmproto', 'bigreqsproto', 'compositeproto', 'damageproto', 'dri2proto', 'dri3proto', 'dmxproto', 'fixesproto', 'fontsproto', 'glproto', 'inputproto', 'kbproto', 'presentproto', + 'randrproto', 'recordproto', 'renderproto', 'resourceproto', 'scrnsaverproto', 'videoproto', 'windowswmproto', 'xcmiscproto', 'xextproto', 'xf86bigfontproto', 'xf86dgaproto', 'xf86driproto', + 'xf86vidmodeproto', 'xineramaproto', 'x11proto' ], + 'xorg/util' : [ 'macros', 'makedepend' ], + '' : [ 'pixman' ] } + repobaseurl = 'git://anongit.freedesktop.org/git/' + elif "mesa-commit.lists.freedesktop.org" in list: + repopathmap = { 'mesa' : [ 'mesa' , 'demos', 'glu', 'glut' ] } + repobaseurl = 'git://anongit.freedesktop.org/git/' + else: + log.msg("unknown list '%s'" % list) + # xkeyboard-config ? + # xcb ? + # fontconfig ? + # xts ? + subject = m["subject"] # log.msg("subject '%s'" % subject) @@ -38,19 +72,27 @@ class GitMaildirSource(MaildirSource): else: match = re.search(r"^(.*) \((.*)\):", subject) if match: - repository = 'mesa/' + match.group(1).lower() + repository = match.group(1).lower() branch = match.group(2) log.msg("repository '%s'" % repository) log.msg("branch '%s'" % branch) else: return None - # Generate a list object from the email - lines = list(body_line_iterator(m, decode=True)) + # map from the short repository name to the repository path + for k in repopathmap: + if repository in repopathmap[k]: + repository = k + '/' + repository + break + log.msg("repo name mapped to path '%s'" % repository) + + # make the repository URL + repository = repobaseurl + repository + log.msg("repo URL '%s'" % repository) # Iterate over all the lines in the message, getting values for # single-line variables (author, branch). - for line in lines: + for line in body_line_iterator(m, decode=True): # log.msg("%s " % (line)) # Mails sent by post-receive-email hook may contain more than @@ -71,7 +113,7 @@ class GitMaildirSource(MaildirSource): revision = line[7:].strip() log.msg("revision '%s'" % revision) - match = re.search(r" (.*) +| +\d* [-+]*", line) + match = re.search(r" (\S*) +\| +\d* [-+]*", line) if match: file = match.group(1) log.msg("file '%s'" % file) @@ -33,6 +33,15 @@ c['change_source'] = [] c['change_source'].append(gitmaildirsource.GitMaildirSource('/var/lib/buildbot/Maildir')) c['change_source'].extend(moduleset_parser.changesources()) +####### REVLINKS + +from buildbot.revlinks import RevlinkMatch + +c['revlink'] = RevlinkMatch([r'git://anongit.freedesktop.org/git/(.*)'], + r'http://cgit.freedesktop.org/\1/commit/?id=%s') +#c['revlink'] = RevlinkMatch([r'https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api/(.*)'], +# r'https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api/\1?p=%s') + ####### SCHEDULERS # Configure the Schedulers, which decide how to react to incoming changes. diff --git a/moduleset_parser.py b/moduleset_parser.py index b75f16e..46d57e4 100755 --- a/moduleset_parser.py +++ b/moduleset_parser.py @@ -207,13 +207,15 @@ def schedulers(): # a scheduler which builds the repo when changes occur in that repo if repo.get('type') == 'git': - filter = ChangeFilter(repository=b.get('module'), branch='master') + repo_url = repo.get('href') + b.get('module') + filter = ChangeFilter(repository=repo_url, branch='master') +# print("filter on repo %s" % repo_url) result.append(SingleBranchScheduler( name=m.get('id'), change_filter=filter, treeStableTimer=None, builderNames=[m.get('id')], - reason='repository change triggered this build')) + reason='A repository change triggered this build')) elif repo.get('type') == 'svn': repo_url = repo.get('href') + repo.get('trunk-template') filter = ChangeFilter(repository=repo_url, branch='trunk') |