~ubuntu-branches/ubuntu/natty/jhbuild/natty

« back to all changes in this revision

Viewing changes to jhbuild/buildbot/changes.py

  • Committer: Bazaar Package Importer
  • Author(s): Emilio Pozuelo Monfort, Loic Minier, Emilio Pozuelo Monfort
  • Date: 2009-11-09 20:28:48 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20091109202848-m9ec7dmzptqtchtj
Tags: 2.28.0-1
[ Loic Minier ]
* Cleanups.
* Ship scripts.
* Don't set GNOME_MODULE as it equals the name of the source package.

[ Emilio Pozuelo Monfort ]
* New upstream release. Closes: #524504.
  - Use 'git rev-parse' rather than 'git-rev-parse'. Closes: #544642.
* Ship install-check. Closes: #441008.
* Uploaders list regenerated. Closes: #523542, #554071.
* debian/control.in,
  debian/rules:
  - Stop shipping a copy of subprocess.py. Require python >= 2.4.
  - Switch to python-support.
* debian/control.in:
  - Bump Standards-Version to 3.8.3, no changes needed.
  - Build depend on intltool >= 0.35.0.
  - Build depend on pkg-config, gnome-doc-utils and rarian-compat to build
    the documentation.
  - Make jhbuild arch any since install-check is a binary. Depend on
    ${shlibs:Depends}.
  - Recommend, and not suggest, git-core. Also recommend mercurial.
* debian/watch:
  - Added.
* debian/patches/01_import_from_pkgdatadir.patch:
  - Added, import jhbuild from pkgdatadir if everything else fails.
    This way we can ship the jhbuild private modules in /usr/sharejhbuild.
* debian/jhbuild.docs:
  - Removed, the necessary docs are now installed by the upstream Makefile.
* debian/rules:
  - Include autotools.mk and gnome.mk.
  - Remove all the manual build process, autotools.mk does everything now.
  - Install the jhbuild modules in /usr/share/jhbuild.
* debian/install:
  - Install the modulesets and patches from here since the upstream build
    system doesn't install them.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# jhbuild - a build script for GNOME 1.x and 2.x
 
2
# Copyright (C) 2008  Igalia S.L., John Carr, Frederic Peters
 
3
#
 
4
#   changes.py: parsing of svn-commits-list messages
 
5
#
 
6
# This program is free software; you can redistribute it and/or modify
 
7
# it under the terms of the GNU General Public License as published by
 
8
# the Free Software Foundation; either version 2 of the License, or
 
9
# (at your option) any later version.
 
10
#
 
11
# This program is distributed in the hope that it will be useful,
 
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
# GNU General Public License for more details.
 
15
#
 
16
# You should have received a copy of the GNU General Public License
 
17
# along with this program; if not, write to the Free Software
 
18
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
19
 
 
20
from buildbot import util
 
21
from buildbot.changes.mail import MaildirSource
 
22
from buildbot.changes import changes
 
23
 
 
24
from email.Utils import parseaddr
 
25
from email.Iterators import body_line_iterator
 
26
 
 
27
import base64
 
28
 
 
29
class GnomeMaildirSource(MaildirSource):
 
30
 
 
31
    name = "Gnome svn-commits-list"
 
32
 
 
33
    def parse(self, m, prefix=None):
 
34
        if m is None:
 
35
            # not a mail at all
 
36
            return None
 
37
 
 
38
        from_header = m['from']
 
39
        if '<' in from_header:
 
40
            from_email = m['from'].split('<')[1][:-1]
 
41
        else:
 
42
            from_email = m['from']
 
43
 
 
44
        # From is account@src.gnome.org
 
45
        name, domain = from_email.split("@")
 
46
 
 
47
        # If this e-mail is valid, it will come from an svn/src.gnome.org email
 
48
        if domain != 'src.gnome.org':
 
49
            return None
 
50
 
 
51
        # we take the time of receipt as the time of checkin. Not correct, but it
 
52
        # avoids the out-of-order-changes issue. See the comment in parseSyncmail
 
53
        # about using the 'Date:' header
 
54
        when = util.now()
 
55
 
 
56
        revision = None
 
57
        files = []
 
58
        comments = ""
 
59
        isdir = 0
 
60
        links = []
 
61
 
 
62
        subject = m['subject']
 
63
 
 
64
        if not subject.startswith('['):
 
65
            # not a git message, abort
 
66
            return None
 
67
 
 
68
        # git message
 
69
        revision = m.get('X-Git-Newrev')
 
70
        if not revision:
 
71
            # not a new git revision, may be a new tag, a new branch, etc.
 
72
            return None
 
73
 
 
74
        if m.get('X-Git-Refname', '').startswith('refs/tags/'):
 
75
            # ignore tags
 
76
            return None
 
77
 
 
78
        try:
 
79
            project = subject[1:subject.index(']')]
 
80
        except ValueError:
 
81
            return None # old git commit message format; ignored
 
82
 
 
83
        if '/' in project:
 
84
            # remove the branch part (ex: [anjal/inline-composer-quotes])
 
85
            project = project.split('/')[0]
 
86
 
 
87
        if ':' in project:
 
88
            # remove the patch number part (ex: [anjal: 3/3])
 
89
            project = project.split(':')[0]
 
90
 
 
91
        if 'Created branch' in subject:
 
92
            # new branches don't have to trigger rebuilds
 
93
            return None
 
94
 
 
95
        if 'Merge branch' in subject:
 
96
            comments = subject[subject.index('Merge branch'):]
 
97
        elif 'Merge commit' in subject:
 
98
            comments = subject[subject.index('Merge commit'):]
 
99
        else:
 
100
            lines = list(body_line_iterator(m, m['Content-Transfer-Encoding']))
 
101
            after_date = False
 
102
            in_files = False
 
103
            while lines:
 
104
                line = lines.pop(0)
 
105
                if line.startswith('Date:'):
 
106
                    after_date = True
 
107
                    continue
 
108
                if not after_date:
 
109
                    continue
 
110
                if len(line) > 3 and line[0] == ' ' and line[1] != ' ' and '|' in line:
 
111
                    in_files = True
 
112
                if line.startswith('---'):
 
113
                    break
 
114
                if in_files:
 
115
                    if not '|' in line:
 
116
                        break
 
117
                    files.append(line.split()[0])
 
118
                else:
 
119
                    comments += line[4:] + '\n'
 
120
 
 
121
            comments = unicode(comments.strip(), m.get_content_charset() or 'ascii', 'ignore')
 
122
 
 
123
        c = changes.Change(name, files, comments, isdir, revision=revision, links=links, when=when)
 
124
        c.project = project # custom attribute
 
125
        return c
 
126