Skip to content

Commit 8d77e1b

Browse files
committed
Ensure --addrepo option also affects bootstrap
Fixes: #1414
1 parent 78f2fc5 commit 8d77e1b

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

mock/py/mockbuild/util.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,11 +991,16 @@ def add_local_repo(config_opts, baseurl, repoid=None, bootstrap=None):
991991
best=1
992992
""".format(repoid=repoid, baseurl=baseurl)
993993

994-
config_opts['{0}.conf'.format(config_opts['package_manager'])] += localyumrepo
994+
def _fix_cfg(cfg):
995+
cfg['dnf.conf'] += localyumrepo
996+
997+
_fix_cfg(config_opts)
995998

996999
if bootstrap is None:
9971000
return
9981001

1002+
_fix_cfg(bootstrap.config)
1003+
9991004
if not baseurl.startswith("file:///") and not baseurl.startswith("/"):
10001005
return
10011006

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
The `--addrepo` option has been updated to affect both the bootstrap chroot
2+
installation and the buildroot installation, as requested in [issue#1414][].
3+
However, be cautious, as Mock [aggressively caches the bootstrap][issue#1289].
4+
Always remember to run `mock -r <chroot> --scrub=bootstrap` first.
5+
Additionally, as more chroots are being switched to `bootstrap_image_ready =
6+
True`, you'll likely need to use `--addrepo` **in combination with**
7+
`--no-bootstrap-image`; otherwise, the bootstrap chroot installation will remain
8+
unaffected.

0 commit comments

Comments
 (0)