Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion mock/py/mockbuild/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def __init__(self, config, uid_manager, plugins, state, buildroot, bootstrap_bui
self.external = ExternalDeps(buildroot, bootstrap_buildroot, uid_manager)

self.rpmbuild_arch = config['rpmbuild_arch']
self.clean_the_chroot = config['clean']

self.build_results = []

Expand Down Expand Up @@ -91,6 +90,8 @@ def clean(self):
self.backup_results()
self.state.start("clean chroot")
self.buildroot.delete()
if self.bootstrap_buildroot is not None:
self.bootstrap_buildroot.delete()
self.state.finish("clean chroot")

@traceLog()
Expand Down Expand Up @@ -120,6 +121,8 @@ def scrub(self, scrub_opts):
elif scrub == 'chroot':
self.buildroot.root_log.info("scrubbing chroot for %s", self.config_name)
self.buildroot.delete()
if self.bootstrap_buildroot is not None:
self.bootstrap_buildroot.delete()
elif scrub == 'cache':
self.buildroot.root_log.info("scrubbing cache for %s", self.config_name)
file_util.rmtree(self.buildroot.cachedir, selinux=self.buildroot.selinux)
Expand All @@ -131,6 +134,11 @@ def scrub(self, scrub_opts):
self.buildroot.root_log.info("scrubbing root-cache for %s", self.config_name)
file_util.rmtree(os.path.join(self.buildroot.cachedir, 'root_cache'),
selinux=self.buildroot.selinux)
if self.bootstrap_buildroot is not None:
file_util.rmtree(os.path.join(self.bootstrap_buildroot.cachedir,
'root_cache'),
selinux=self.buildroot.selinux)

elif scrub in ['yum-cache', 'dnf-cache']:
self.buildroot.root_log.info("scrubbing yum-cache and dnf-cache for %s", self.config_name)
file_util.rmtree(os.path.join(self.buildroot.cachedir, 'yum_cache'),
Expand Down