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()
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)
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()
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)
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)