def bosm(args): args.target = _fuzzy_target(args.target) ## cleanup all existing logs if 'clean' in args.target: try: shutil.rmtree(Bos.logdir) except: pass ## BOS internal environments required by logging system. os.environ['_BOS_DEBUG_'] = 'yes' if args.debug == True else 'no' os.environ['_BOS_TRACE_'] = 'yes' if args.trace == True else 'no' os.environ['_BOS_VERBOSE_'] = 'yes' if args.verbose == True else 'no' ### bootstrap build system Bos.setup() Blog.debug("entering to build system, topdir: %s" % Bos.topdir) if _bootstrapcheck(): Blog.debug("bootstrap required.") Bos.touch(os.path.join(Bos.cachedir, '.rebootstrap')) Bos.touch(os.path.join(Bos.cachedir, '.rebuild')) ret = 0 if not 'bootstrap' in args.target: Blog.debug("checking to bootstrap ...") ret = call(['make', '-C', Bos.cachedir, '-f', Bos.topdir + 'bos/mk/bootstrap.mk', '--no-print-directory']) if 0 != ret: Blog.fatal('unable to bootstrap') ## from this point on, build system is bootstraped and ready: ## - all envorinments are in place and ready to consume build target if 'info' in args.target: _print_info() if 'all' in args.target: _check_package_version() if 0 == ret: for target in args.target: if target[-5:] == '-info': _print_pkg_info(target[:-5]) Blog.debug("package %s top-level make" % target) call(['make', '-C', Bos.cachedir, '-f', Bos.topdir + 'bos/mk/main.mk', '-j' + str(args.jobs) if args.jobs else '-j', '--no-print-directory', target]) print '' print 'build summary at: {0}'.format(Blog.name())