Ejemplo n.º 1
0
def clean():
    print("* Emptying install directory")
    _empty_dir(config.install_dir)

    print("* Emptying build directory")
    _empty_dir(config.get_build_dir())

    for module in config.load_modules():
        if not module.out_of_source:
            if git.get_module(module).clean():
                print("* Cleaning %s" % module.name)
Ejemplo n.º 2
0
def _pull_module(module, revision=None):
    print("* Pulling %s" % module.name)

    git_module = git.get_module(module)

    try:
        git_module.update(revision)
    except subprocess.CalledProcessError:
        return False

    return True
Ejemplo n.º 3
0
def pull(revisions={}, lazy=False):
    to_pull = []
    for module in config.load_modules():
        git_module = git.get_module(module)
        if not lazy or not os.path.exists(git_module.local):
            to_pull.append(module)

    if to_pull:
        print("\n= Pulling =\n")

    for module in to_pull:
        revision = revisions.get(module.name, None)
        if not _pull_module(module, revision):
            return False

    return True
Ejemplo n.º 4
0
def _distribute_autotools(module):
    makefile = parse_makefile("Makefile")
    filename = makefile["DIST_ARCHIVES"]
    version = makefile["VERSION"]

    git_module = git.get_module(module)

    version_revision = None
    description = git_module.describe()
    if description != "v%s" % version:
        match = re.match(r"(v[\d\.]+)", description)
        if match is None:
            print("No version tag was found")
            return False
        else:
            version_revision = match.groups()[0]

    if version_revision is not None:
        git_module.checkout(version_revision)

    return command.run(["make", "distcheck"])