This is an automated email from the git hooks/post-receive script.
praiskup pushed a commit to branch master
in repository copr/copr.
commit bbca2715faf2220faa9ac12529377611c418b80a
Author: Jakub Kadlcik <frostyx(a)email.cz>
AuthorDate: Fri Jan 31 22:50:55 2020 +0100
rpmbuild: properly cleanup after obtaining sources
We currently don't clean a temporary directory used for obtaining
sources, so we unintentionally spam /tmp. We don't clean even
when the build succeeds, so this is not related to catching exceptions.
The problem seems to be, that we are trying to clean in `__exit__`
method, which is a mistake. The `__exit__` method executes when
leaving a context - we don't use `*Provider` as a context.
We should clean in destructor instead, hence `__del__`.
Relates: #1245
---
rpmbuild/copr_rpmbuild/providers/base.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/rpmbuild/copr_rpmbuild/providers/base.py
b/rpmbuild/copr_rpmbuild/providers/base.py
index 47a45f2..ad5c174 100644
--- a/rpmbuild/copr_rpmbuild/providers/base.py
+++ b/rpmbuild/copr_rpmbuild/providers/base.py
@@ -1,6 +1,7 @@
import os
import logging
import tempfile
+import shutil
from ..helpers import string2list
log = logging.getLogger("__main__")
@@ -25,7 +26,7 @@ class Provider(object):
rpmmacros.write("%__urlhelper_localopts --proto -all,{0}\n"
.format(','.join(["+"+protocol for protocol
in enabled_protocols])))
- def __exit__(self, exc_type, exc_value, traceback):
+ def __del__(self):
self.cleanup()
def cleanup(self):
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.