mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
Clean _tmproot. Move config listing to the setbuilder module.
Add the mising _tmprool clean. Move the list printing out of the build which now just returns a list of config files to the location of the options.
This commit is contained in:
parent
ebc505ccf3
commit
8d7624e1d4
@ -428,10 +428,16 @@ class build:
|
|||||||
if not self.opts.no_clean():
|
if not self.opts.no_clean():
|
||||||
buildroot = self.config.abspath('buildroot')
|
buildroot = self.config.abspath('buildroot')
|
||||||
builddir = self.config.abspath('_builddir')
|
builddir = self.config.abspath('_builddir')
|
||||||
_notice(self.opts, 'cleanup: %s' % (buildroot))
|
tmproot = self.config.abspath('_tmproot')
|
||||||
|
if self.opts.trace():
|
||||||
|
_notice(self.opts, 'cleanup: %s' % (buildroot))
|
||||||
self.rmdir(buildroot)
|
self.rmdir(buildroot)
|
||||||
_notice(self.opts, 'cleanup: %s' % (builddir))
|
if self.opts.trace():
|
||||||
|
_notice(self.opts, 'cleanup: %s' % (builddir))
|
||||||
self.rmdir(builddir)
|
self.rmdir(builddir)
|
||||||
|
if self.opts.trace():
|
||||||
|
_notice(self.opts, 'cleanup: %s' % (tmproot))
|
||||||
|
self.rmdir(tmproot)
|
||||||
|
|
||||||
def make(self):
|
def make(self):
|
||||||
packages = self.config.packages()
|
packages = self.config.packages()
|
||||||
@ -460,7 +466,7 @@ class build:
|
|||||||
package = packages['main']
|
package = packages['main']
|
||||||
return package.name()
|
return package.name()
|
||||||
|
|
||||||
def list_configs(opts, _defaults, ext = '.cfg'):
|
def get_configs(opts, _defaults, ext = '.cfg'):
|
||||||
|
|
||||||
def _scan(_path, ext):
|
def _scan(_path, ext):
|
||||||
configs = []
|
configs = []
|
||||||
@ -471,15 +477,18 @@ def list_configs(opts, _defaults, ext = '.cfg'):
|
|||||||
configs += [path.join(prefix, file)]
|
configs += [path.join(prefix, file)]
|
||||||
return configs
|
return configs
|
||||||
|
|
||||||
|
paths = []
|
||||||
configs = []
|
configs = []
|
||||||
|
files = []
|
||||||
for cp in opts.expand('%{_configdir}', _defaults).split(':'):
|
for cp in opts.expand('%{_configdir}', _defaults).split(':'):
|
||||||
print 'Examining: %s' % (path.host(path.abspath(cp)))
|
paths += [path.host(path.abspath(cp))]
|
||||||
configs += _scan(cp, ext)
|
files += _scan(cp, ext)
|
||||||
for c in sorted(configs):
|
for f in sorted(files):
|
||||||
config = c # path.basename(c)
|
config = f
|
||||||
if config.endswith(ext):
|
if config.endswith(ext):
|
||||||
config = config[:0 - len(ext)]
|
config = config[:0 - len(ext)]
|
||||||
print ' ', config
|
configs += [config]
|
||||||
|
return paths, configs
|
||||||
|
|
||||||
def run(args):
|
def run(args):
|
||||||
try:
|
try:
|
||||||
|
@ -69,7 +69,8 @@ class buildset:
|
|||||||
topdir = self.opts.expand('%{_topdir}', self.defaults)
|
topdir = self.opts.expand('%{_topdir}', self.defaults)
|
||||||
what = '%s -> %s' % \
|
what = '%s -> %s' % \
|
||||||
(path.host(src[len(topdir) + 1:]), path.host(dst[len(topdir) + 1:]))
|
(path.host(src[len(topdir) + 1:]), path.host(dst[len(topdir) + 1:]))
|
||||||
_notice(self.opts, 'installing: %s' % (what))
|
if self.opts.trace():
|
||||||
|
_notice(self.opts, 'installing: %s' % (what))
|
||||||
if not self.opts.dry_run():
|
if not self.opts.dry_run():
|
||||||
try:
|
try:
|
||||||
files = distutils.dir_util.copy_tree(path.host(src),
|
files = distutils.dir_util.copy_tree(path.host(src),
|
||||||
@ -234,10 +235,16 @@ def run():
|
|||||||
if not opts.force():
|
if not opts.force():
|
||||||
raise error.general('host build environment is not set up correctly (use --force to proceed)')
|
raise error.general('host build environment is not set up correctly (use --force to proceed)')
|
||||||
_notice(opts, 'warning: forcing build with known host setup problems')
|
_notice(opts, 'warning: forcing build with known host setup problems')
|
||||||
if opts.get_arg('--list-configs'):
|
if opts.get_arg('--list-configs') or opts.get_arg('--list-bsets'):
|
||||||
build.list_configs(opts, _defaults)
|
if opts.get_arg('--list-configs'):
|
||||||
elif opts.get_arg('--list-bsets'):
|
ext = '.cfg'
|
||||||
build.list_configs(opts, _defaults, ext = '.bset')
|
else:
|
||||||
|
ext = '.bset'
|
||||||
|
paths, configs = build.get_configs(opts, _defaults, ext = ext)
|
||||||
|
for p in paths:
|
||||||
|
print 'Examining: %s' % (os.path.relpath(p))
|
||||||
|
for c in configs:
|
||||||
|
print ' %s' % (c)
|
||||||
else:
|
else:
|
||||||
for bset in opts.params():
|
for bset in opts.params():
|
||||||
c = buildset(bset, _defaults = _defaults, opts = opts)
|
c = buildset(bset, _defaults = _defaults, opts = opts)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user