On 10/22/2014 03:55 AM, Thomas wrote:
I updated your patch so it does not assume sourcedir=chrootdir
But it's not yet the perfect solution.
This looks reasonable, except that you dropped the directory existence
check, which makes the code /require/ the new layout if
support_rpm_source_layout is enabled. This is something of an interim
solution and I'd rather not break things for other folks (esp since
support_rpm_source_layout defaults to True).
I think the fix is something like this:
For reference the layout is:
diff --git a/builder/kojid b/builder/kojid
index 821f19d..4210823 100755
@@ -455,6 +455,10 @@ class BuildRoot(object):
def build_srpm(self, specfile, sourcedir, source_cmd):
+ if self.options.support_rpm_source_layout:
+ sources_dir = "%s/SOURCES" % sourcedir
+ sources_dir = sourcedir
# call the command defined by source_cmd in the chroot so
any required files not stored in
# the SCM can be retrieved
@@ -466,7 +470,7 @@ class BuildRoot(object):
raise koji.BuildError, "error retrieving sources, %s"
- args = ['--no-clean', '--buildsrpm', '--spec',
+ args = ['--no-clean', '--buildsrpm', '--spec',
rv = self.mock(args)
@@ -3793,10 +3797,7 @@ class BuildSRPMFromSCMTask(BaseBuildTask):
self.logger.debug("Running srpm build")
- sources_dir = "%s/SOURCES" % sourcedir
- if not self.options.support_rpm_source_layout or not
- sources_dir = sourcedir
- broot.build_srpm(spec_file, sources_dir, scm.source_cmd)
+ broot.build_srpm(spec_file, sourcedir, scm.source_cmd)
srpms = glob.glob('%s/*.src.rpm' % broot.resultdir())
if len(srpms) == 0:
On Fri, Aug 15, 2014 at 12:10 AM, Mike McLean <mikem(a)redhat.com> wrote:
> On 08/13/2014 06:05 PM, Mike McLean wrote:
>> This much gets you halfway there, but it looks like the system is just
>> going to choke later on having the sources under SOURCES instead of the
>> git root dir.
>> I guess you could set up a source_cmd to move or link the sources
>> around, but that's hardly a clean solution.
>> I wouldn't mind teaching koji to handle this layout, but it looks like
>> it might be a little more involved than just the spec portion (unless
>> I'm missing something). Did you have a solution for the SOURCES dir?
> Actually not that complicated after all. I did add an option to turn the
> support off in case it causes a problem (possible that someone could
> have a SOURCES dir in their checkout for some other reason).
> Anyway, here is where I'm at. Seems to be working.