~ubuntu-branches/ubuntu/lucid/jhbuild/lucid

« back to all changes in this revision

Viewing changes to jhbuild/commands/checkbranches.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) 2001-2004  James Henstridge
 
3
#
 
4
#   checkbranches.py: check GNOME module sets for missing branches definition
 
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 optparse import make_option
 
21
 
 
22
import jhbuild.moduleset
 
23
from jhbuild.commands import Command, register_command
 
24
from jhbuild.utils.cmds import get_output
 
25
from jhbuild.errors import CommandError
 
26
 
 
27
class cmd_checkbranches(Command):
 
28
    doc = N_('Check modules in GNOME Git repository have the correct branch definition')
 
29
    name = 'checkbranches'
 
30
    
 
31
    def __init__(self):
 
32
        Command.__init__(self, [
 
33
            make_option('-b', '--branch', metavar = 'BRANCH',
 
34
                    action = 'store', dest = 'branch', default = None)])
 
35
 
 
36
    def run(self, config, options, args):
 
37
        if options.branch:
 
38
            branch = options.branch
 
39
        else:
 
40
            if type(config.moduleset) is list:
 
41
                branch = config.moduleset[0].replace('.', '-')
 
42
            else:
 
43
                branch = config.moduleset.replace('.', '-')
 
44
            branch = branch.replace('gnome-suites-', 'gnome-')
 
45
 
 
46
        module_set = jhbuild.moduleset.load(config)
 
47
        module_list = module_set.get_module_list(args or config.modules)
 
48
        for mod in module_list:
 
49
            if mod.type in ('meta', 'tarball'):
 
50
                continue
 
51
            if not mod.branch or not mod.branch.repository.__class__.__name__ == 'GitRepository':
 
52
                continue
 
53
            if not 'git.gnome.org' in mod.branch.repository.href:
 
54
                continue
 
55
            if mod.branch.branch:
 
56
                # there is already a branch defined
 
57
                continue
 
58
 
 
59
            try:
 
60
                if get_output(['git', 'ls-remote',
 
61
                        'git://git.gnome.org/%s' % mod.name,
 
62
                        'refs/heads/%s' % branch]):
 
63
                    uprint(_('%(module)s is missing branch definition for %(branch)s') % {'module': mod.name, 'branch': branch})
 
64
            except CommandError:
 
65
                pass
 
66
 
 
67
 
 
68
register_command(cmd_checkbranches)