Ejemplo n.º 1
0
def filelist(pkgtype, env):
    '''Outputs default filelist as json (see details)

    Generates and prints to stdout a filelist json that can be modified and
    used with package.ini's "filelist" option to override the default.

    Useful for setting file modes in RPMs'''
    if not env.exists('rootdir'):
        build(pkgtype, env)
    packager.Package('package.ini', env).filelist()
Ejemplo n.º 2
0
def package(version=None, pkgtype='deb', env=defenv):
    'Creates deployable packages'
    if not version:
        version = prompt("What version did you want packaged there, hotshot?")
    if not env.exists('builddir'):
        warn('Implicitly invoking build')
        build(pkgtype, env)

    pkg = packager.Package('package.ini', env, pkgtype)
    pkg.build(version)
Ejemplo n.º 3
0
def filelist(pkgtype='deb', builddir='_build'):
    '''Outputs default filelist as json (see details)

    Generates and prints to stdout a filelist json that can be modified and
    used with package.ini's "filelist" option to override the default.

    Useful for setting file modes in RPMs'''
    if not os.path.exists(builddir):
        build(pkgtype, builddir)
    packager.Package('package.ini', builddir).filelist()
Ejemplo n.º 4
0
def package(version=None, config=None, pkgtype='deb', rootdir=None):
    'Creates deployable packages'
    cleanitup = False
    if not version:
        version = prompt("What version did you want packaged there, hotshot?")
    if not rootdir:
        rootdir = tempfile.mkdtemp(prefix='builder-root-')
        cleanitup = True
        build(version, config, rootdir)
    elif not os.path.exists(rootdir):
        os.mkdir(rootdir)
        build(version, config, rootdir)

    for pkgtype in 'deb','rpm':
        if config.has_section(pkgtype):
            pkg = packager.Package(config, rootdir, pkgtype)
            pkg.build(version)

    if cleanitup:
        local('rm -rf %s' % rootdir)
Ejemplo n.º 5
0
def package(version=None, config=None, env=None):
    'Creates deployable packages'
    cleanitup = False
    if not env:
        env = builder.BuildEnv()
    if not version:
        version = prompt("What version did you want packaged there, hotshot?")
    if not env.rootdir:
        env.rootdir = tempfile.mkdtemp(prefix='builder-root-')
        cleanitup = True
        build(version, config, env)
    elif not env.exists('rootdir'):
        build(version, config, rootdir)

    for pkgtype in 'deb', 'rpm':
        if config.has_section(pkgtype):
            pkg = packager.Package(config, env, pkgtype)
            pkg.build(version)

    if cleanitup:
        _local('rm -rf %s' % env.rootdir)