| |
@@ -486,11 +486,11 @@
|
| |
else:
|
| |
os.makedirs(resultsdir)
|
| |
|
| |
- # Git sources are treated specially.
|
| |
- if source.startswith(("git://", "http://", "https://")):
|
| |
- builder = SCMBuilder(mock_config, resultsdir, source, artifact_name)
|
| |
+ if source.endswith('.src.rpm'):
|
| |
+ builder = SRPMBuilder(mock_config, resultsdir, source)
|
| |
else:
|
| |
- builder = LocalBuilder(mock_config, resultsdir, source)
|
| |
+ # Otherwise, assume we're building from some scm repo
|
| |
+ builder = SCMBuilder(mock_config, resultsdir, source, artifact_name)
|
| |
return self.build_srpm(artifact_name, source, build_id, builder)
|
| |
|
| |
@staticmethod
|
| |
@@ -524,9 +524,9 @@
|
| |
execute_cmd(self.cmd, stdout=stdout, stderr=stderr)
|
| |
|
| |
|
| |
- class LocalBuilder(BaseBuilder):
|
| |
+ class SRPMBuilder(BaseBuilder):
|
| |
def __init__(self, config, resultsdir, source):
|
| |
- super(LocalBuilder, self).__init__(config, resultsdir)
|
| |
+ super(SRPMBuilder, self).__init__(config, resultsdir)
|
| |
self.cmd.extend(["--rebuild", source])
|
| |
|
| |
|
| |
First, rename LocalBuilder to SRPMBuilder. Reading the manpage for mock tells
me that the
--rebuild
option is specifically for rebuilding a given srpm.The class was just named poorly (imo).
Second, change the type detection. The bug I'm trying to fix is if you try to
pass a string for the
repository:
in your modulemd likefile:///home/user/repos/libfoo/
. The old logic here would assume that it isan srpm since it didn't start with "git" or "http", but that's not correct. We
have people who want to experiment with building modules with components that
are not publicly accessible over the network - which are only local. This
change allows that.