chown the source tree after patches are applied, in case the patches created new files/directories

This commit is contained in:
Mike Bonnet 2011-01-13 16:22:33 -05:00
parent c27c9d24ef
commit 35d4aa0739

View file

@ -1228,15 +1228,6 @@ class BuildMavenTask(BaseTaskHandler):
patchcheckoutdir = patch_scm.checkout(patchdir, self.session, uploadpath, patchlog)
self._zip_dir(patchcheckoutdir, os.path.join(outputdir, 'patches.zip'))
# Set ownership of the entire source tree to the mock user
if mockuid != None:
cmd = ['/bin/chown', '-R', str(mockuid), scmdir, outputdir, repodir]
if self.opts.get('patches'):
cmd.append(patchdir)
ret = log_output(self.session, cmd[0], cmd, logfile, uploadpath, logerror=1, append=1)
if ret:
raise koji.BuildError, 'error changing ownership of the source, repo, and output directories'
# Apply patches, if present
if self.opts.get('patches'):
# filter out directories and files beginning with . (probably scm metadata)
@ -1252,6 +1243,15 @@ class BuildMavenTask(BaseTaskHandler):
if ret:
raise koji.BuildError, 'error applying patches from %s, see patches.log for details' % self.opts.get('patches')
# Set ownership of the entire source tree to the mock user
if mockuid != None:
cmd = ['/bin/chown', '-R', str(mockuid), scmdir, outputdir, repodir]
if self.opts.get('patches'):
cmd.append(patchdir)
ret = log_output(self.session, cmd[0], cmd, logfile, uploadpath, logerror=1, append=1)
if ret:
raise koji.BuildError, 'error changing ownership of the source, repo, and output directories'
build_pom = os.path.join(sourcedir, 'pom.xml')
if not os.path.exists(build_pom):
raise koji.BuildError, 'no pom.xml found in checkout'