| |
@@ -2345,7 +2345,7 @@
|
| |
yield archive
|
| |
return _iter_archives()
|
| |
|
| |
- def repo_init(tag, with_src=False, with_debuginfo=False, event=None):
|
| |
+ def repo_init(tag, with_src=False, with_debuginfo=False, event=None, with_separate_src=False):
|
| |
"""Create a new repo entry in the INIT state, return full repo data
|
| |
|
| |
Returns a dictionary containing
|
| |
@@ -2355,9 +2355,11 @@
|
| |
state = koji.REPO_INIT
|
| |
tinfo = get_tag(tag, strict=True, event=event)
|
| |
koji.plugin.run_callbacks('preRepoInit', tag=tinfo, with_src=with_src, with_debuginfo=with_debuginfo,
|
| |
- event=event, repo_id=None)
|
| |
+ event=event, repo_id=None, with_separate_src=with_separate_src)
|
| |
tag_id = tinfo['id']
|
| |
repo_arches = {}
|
| |
+ if with_separate_src:
|
| |
+ repo_arches['src'] = 1
|
| |
if tinfo['arches']:
|
| |
for arch in tinfo['arches'].split():
|
| |
arch = koji.canonArch(arch)
|
| |
@@ -2420,6 +2422,8 @@
|
| |
if with_src:
|
| |
for repoarch in repo_arches:
|
| |
pkglist[repoarch].write(relpath)
|
| |
+ if with_separate_src:
|
| |
+ pkglist[arch].write(relpath)
|
| |
elif arch == 'noarch':
|
| |
for repoarch in repo_arches:
|
| |
pkglist[repoarch].write(relpath)
|
| |
@@ -2474,7 +2478,7 @@
|
| |
_write_maven_repo_metadata(artifact_dir, artifacts)
|
| |
|
| |
koji.plugin.run_callbacks('postRepoInit', tag=tinfo, with_src=with_src, with_debuginfo=with_debuginfo,
|
| |
- event=event, repo_id=repo_id)
|
| |
+ event=event, repo_id=repo_id, with_separate_src=with_separate_src)
|
| |
return [repo_id, event_id]
|
| |
|
| |
def _write_maven_repo_metadata(destdir, artifacts):
|
| |
@@ -2519,7 +2523,8 @@
|
| |
# note: we need to match args from the other preRepoInit callback
|
| |
koji.plugin.run_callbacks('preRepoInit', tag=tinfo, with_src=False,
|
| |
with_debuginfo=False, event=event, repo_id=None,
|
| |
- dist=True, keys=keys, arches=arches, task_opts=task_opts)
|
| |
+ dist=True, keys=keys, arches=arches, task_opts=task_opts,
|
| |
+ with_separate_src=False)
|
| |
if not event:
|
| |
event = get_event()
|
| |
repo_id = nextval('repo_id_seq')
|
| |
@@ -2540,7 +2545,7 @@
|
| |
koji.plugin.run_callbacks('postRepoInit', tag=tinfo, with_src=False,
|
| |
with_debuginfo=False, event=event, repo_id=repo_id,
|
| |
dist=True, keys=keys, arches=arches, task_opts=task_opts,
|
| |
- repodir=repodir)
|
| |
+ repodir=repodir, with_reparate_src=False)
|
| |
return repo_id, event
|
| |
|
| |
|
| |
@@ -10521,7 +10526,7 @@
|
| |
task_opts['event'] = event_id
|
| |
return make_task('distRepo', [tag, repo_id, keys, task_opts], priority=15, channel='createrepo')
|
| |
|
| |
- def newRepo(self, tag, event=None, src=False, debuginfo=False):
|
| |
+ def newRepo(self, tag, event=None, src=False, debuginfo=False, separate_src=False):
|
| |
"""Create a newRepo task. returns task id"""
|
| |
if context.session.hasPerm('regen-repo'):
|
| |
pass
|
| |
@@ -10532,6 +10537,8 @@
|
| |
opts['event'] = event
|
| |
if src:
|
| |
opts['src'] = True
|
| |
+ if separate_src:
|
| |
+ opts['separate_src'] = True
|
| |
if debuginfo:
|
| |
opts['debuginfo'] = True
|
| |
args = koji.encode_args(tag, **opts)
|
| |
@@ -12699,11 +12706,11 @@
|
| |
|
| |
return br.updateArchiveList(archives, project)
|
| |
|
| |
- def repoInit(self, tag, with_src=False, with_debuginfo=False, event=None):
|
| |
+ def repoInit(self, tag, with_src=False, with_debuginfo=False, event=None, with_separate_src=False):
|
| |
"""Initialize a new repo for tag"""
|
| |
host = Host()
|
| |
host.verify()
|
| |
- return repo_init(tag, with_src=with_src, with_debuginfo=with_debuginfo, event=event)
|
| |
+ return repo_init(tag, with_src=with_src, with_debuginfo=with_debuginfo, event=event, with_separate_src=with_separate_src)
|
| |
|
| |
def repoAddRPM(self, repo_id, path):
|
| |
"""Add an uploaded rpm to a repo"""
|
| |
Fixes #1266
Currently Koji has an option that can be used to include source rpms in each of generated arch repos. Howewer it makes repositories significantly bigger and slower to generate. Source metadata is duplicated across all arch repos. Increased metadata size makes builds slower.
This pull request takes a slightly different approach - it makes it possible to generate build repos with source rpms in separate repos. Such repos don't change size of each arch repo and can be generated faster - generation is done in a separate createrepo task that can run on separate host. For example:
CC @ignatenkobrain