| |
@@ -555,11 +555,6 @@
|
| |
|
| |
def build_srpm(self, specfile, sourcedir, source_cmd):
|
| |
self.session.host.setBuildRootState(self.id,'BUILDING')
|
| |
- alt_sources_dir = "%s/SOURCES" % sourcedir
|
| |
- if self.options.support_rpm_source_layout and os.path.isdir(alt_sources_dir):
|
| |
- sources_dir = alt_sources_dir
|
| |
- else:
|
| |
- sources_dir = sourcedir
|
| |
if source_cmd:
|
| |
# call the command defined by source_cmd in the chroot so any required files not stored in
|
| |
# the SCM can be retrieved
|
| |
@@ -571,6 +566,12 @@
|
| |
self.expire()
|
| |
raise koji.BuildError("error retrieving sources, %s" % self._mockResult(rv))
|
| |
|
| |
+ alt_sources_dir = "%s/SOURCES" % sourcedir
|
| |
+ if self.options.support_rpm_source_layout and os.path.isdir(alt_sources_dir):
|
| |
+ sources_dir = alt_sources_dir
|
| |
+ else:
|
| |
+ sources_dir = sourcedir
|
| |
+
|
| |
args = ['--no-clean', '--buildsrpm', '--spec', specfile, '--sources', sources_dir,
|
| |
'--target', 'noarch']
|
| |
|
| |
In the RPM layout, it's possible that the SOURCES directory might be
completely empty save for the lookaside payload. In this case a SOURCES
directory wouldn't exist in SCM, and wouldn't be created until the
sources command is run.
Moving this code block down lets us run the sources command before we try to decide if we should look for the RPM layout or not.