Пример #1
0
        print('Untarring base system')
        for base in opt.base:
            run('tar', 'xf', base, '-C', build_env['INSTALL_DIR'],
                '--strip-components', '1')
        fix_install_paths(build_env['INSTALL_DIR'], arch)

    # This must happen after untarring the base system,
    # as perhaps cache will be found there.
    if opt.ccache:

        try:
            ccache_path = findfile('ccache', build_env['PATH'])
        except:
            # If could not find ccache, build it.
            print("\n========== Building: %s ==========" % ccache.__name__)
            Package.build(ccache(build_env.copy_set_default()))
            ccache_path = findfile('ccache', build_env['PATH'])

        new = dict(
            CC=P.join(compiler_dir, build_env['CC']),
            CXX=P.join(compiler_dir, build_env['CXX']),
        )

        subprocess.check_call(['ln', '-sf', ccache_path, new['CC']])
        subprocess.check_call(['ln', '-sf', ccache_path, new['CXX']])
        build_env.update(new)

    modes = dict(all=lambda pkg: Package.build(pkg, skip_fetch=False),
                 fetch=lambda pkg: pkg.fetch(),
                 nofetch=lambda pkg: Package.build(pkg, skip_fetch=True))
Пример #2
0
    else:
        build = (globals()[pkg] for pkg in args)

    if opt.pretend:
        info('I want to build:\n%s' % ' '.join(map(lambda x: x.__name__, build)))
        summary(e)
        sys.exit(0)

    makelink(opt.build_root, 'last-run')

    if opt.base:
        print('Untarring base system')
    for base in opt.base:
        run('tar', 'xf', base, '-C', e['INSTALL_DIR'], '--strip-components', '1')

    modes = dict(
        all     = lambda pkg : Package.build(pkg, skip_fetch=False),
        fetch   = lambda pkg : pkg.fetch(),
        nofetch = lambda pkg : Package.build(pkg, skip_fetch=True))

    try:
        for pkg in build:
            modes[opt.mode](pkg(e.copy_set_default()))
    except PackageError, e:
        die(e)

    makelink(opt.build_root, 'last-completed-run')

    info('\n\nAll done!')
    summary(e)
Пример #3
0
    if opt.base and not opt.resume:
        print('Untarring base system')
        for base in opt.base:
            run('tar', 'xf', base, '-C', build_env['INSTALL_DIR'], '--strip-components', '1')
        fix_install_paths(build_env['INSTALL_DIR'], arch)

    # This must happen after untarring the base system,
    # as perhaps cache will be found there.
    if opt.ccache:

        try:
            ccache_path = findfile('ccache', build_env['PATH'])
        except:
            # If could not find ccache, build it.
            print("\n========== Building: %s ==========" % ccache.__name__)
            Package.build(ccache(build_env.copy_set_default()))
            ccache_path = findfile('ccache', build_env['PATH'])

        new = dict(
            CC  = P.join(compiler_dir, build_env['CC']),
            CXX = P.join(compiler_dir, build_env['CXX']),
        )

        subprocess.check_call(['ln', '-sf', ccache_path, new['CC']])
        subprocess.check_call(['ln', '-sf', ccache_path, new['CXX']])
        build_env.update(new)

    modes = dict(
        all     = lambda pkg : Package.build(pkg, skip_fetch=False),
        fetch   = lambda pkg : pkg.fetch(),
        nofetch = lambda pkg : Package.build(pkg, skip_fetch=True))
Пример #4
0
    #             ccache_path = find_file('ccache', build_env['PATH'])

    #         print(compiler_dir)
    #         new = dict(
    #             CC  = P.join(compiler_dir, os.path.basename(build_env['CC'])),
    #             CXX = P.join(compiler_dir, os.path.basename(build_env['CXX'])),
    #         )
    #         print(new)
    #         print(ccache_path)

    #         print(['ln', '-sf', ccache_path, new['CC']])
    #         subprocess.check_call(['ln', '-sf', ccache_path, new['CC']])
    #         subprocess.check_call(['ln', '-sf', ccache_path, new['CXX']])
    #         build_env.update(new)

    modes = dict(all=lambda pkg: Package.build(pkg, skip_fetch=False),
                 fetch=lambda pkg: pkg.fetch(),
                 nofetch=lambda pkg: Package.build(pkg, skip_fetch=True))

    # Build the packages, skipping the ones already done
    done_file = opt.build_root + "/done.txt"
    done = read_done(done_file)
    try:
        for pkg in build:
            name = pkg.__name__
            if name in done and name != 'binarybuilder':
                print("Package %s was already built, skipping" % name)
                continue
            print("\n========== Building: %s ==========" % name)
            # Make several attempts, perhaps the servers are down.
            num = 10