From 99c20f579b05ee19047d42984fc2aedda1255405 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Petr=20P=C3=ADsa=C5=99?= Date: Thu, 11 May 2017 15:42:53 +0200 Subject: [PATCH] Adapt to mock-1.4.1-1.fc25 Since mock-1.4.1-1.fc25, building source packages fails after removing %{_topdir} directory (necessary for reusing shared mock environments to prevent from contaminations from previous builds). It leads to: Permission denied: '/var/lib/mock/fedorarebuild-x86_64-scfmyei6vf/root/builddir/build/SOURCES' Even the BUILDROOT, SOURCES etc. subdirectories must stay. This patch changes the cleaning to remove only content of the BUILDROOT, SOURCES etc. subdirectories. --- lib/Fedora/Rebuild/Package.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Fedora/Rebuild/Package.pm b/lib/Fedora/Rebuild/Package.pm index 54e63f5..d5cc4a6 100644 --- a/lib/Fedora/Rebuild/Package.pm +++ b/lib/Fedora/Rebuild/Package.pm @@ -488,7 +488,8 @@ sub srpm { '--configdir', $mock_config_dir, '--root', $mock_config_root, '--no-clean', '--no-cleanup-after', - '--chroot', q[rm -r "$(rpm -E '%{_topdir}')"])) { + '--chroot', + q[find "$(rpm -E '%{_topdir}')" -mindepth 2 -maxdepth 2 -exec rm -r {} \;])) { $lock->log("Could not prune _topdir for `" . $self->name . "' in mock.\n"); return $lock->mark_failed; -- 2.11.4.GIT