add the --package option to maven-build, to enable installation of additional packages into the chroot

This commit is contained in:
Mike Bonnet 2011-03-30 17:28:17 -04:00
parent a6c16232a7
commit 3483700817
2 changed files with 15 additions and 1 deletions

View file

@ -1069,6 +1069,8 @@ class MavenTask(MultiPlatformTask):
build_opts['properties'] = opts['properties']
if opts.get('patches'):
build_opts['patches'] = opts['patches']
if opts.get('packages'):
build_opts['packages'] = opts['packages']
if opts.get('jvm_options'):
build_opts['jvm_options'] = opts['jvm_options']
if opts.get('maven_options'):
@ -1175,6 +1177,15 @@ class BuildMavenTask(BaseTaskHandler):
self.logger.debug("Initializing buildroot")
buildroot.init()
packages = opts.get('packages')
if packages:
rv = buildroot.mock(['--install'] + packages)
self.session.host.setBuildRootState(buildroot.id, 'BUILDING')
self.session.host.updateBuildRootList(buildroot.id, buildroot.getPackageList())
if rv:
buildroot.expire()
raise koji.BuildrootError, 'error installing packages, %s' % buildroot._mockResult(rv, logfile='mock_output.log')
if not os.path.exists('%s/usr/bin/mvn' % buildroot.rootdir()):
raise koji.BuildError, '/usr/bin/mvn was not found in the buildroot'