This is an automated email from the git hooks/post-receive script.
praiskup pushed a commit to branch master
in repository copr/copr.
commit b0af0c736a661f19db6f9e4ebdfd0005b4c90a4c
Author: Jakub Kadlcik <frostyx(a)email.cz>
AuthorDate: Sun Feb 2 16:37:25 2020 +0100
rpmbuild: prefix the name of all copr-rpmbuild temporary directories
Relates: #1245
---
rpmbuild/copr_rpmbuild/providers/base.py | 2 +-
rpmbuild/main.py | 4 ++--
rpmbuild/tests/test_helpers.py | 2 +-
rpmbuild/tests/test_scm.py | 2 +-
rpmbuild/tests/test_spec.py | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/rpmbuild/copr_rpmbuild/providers/base.py
b/rpmbuild/copr_rpmbuild/providers/base.py
index ad5c174..8a6a85a 100644
--- a/rpmbuild/copr_rpmbuild/providers/base.py
+++ b/rpmbuild/copr_rpmbuild/providers/base.py
@@ -12,7 +12,7 @@ class Provider(object):
self.outdir = outdir
self.config = config
- self.workdir = tempfile.mkdtemp()
+ self.workdir = tempfile.mkdtemp(prefix="copr-rpmbuild-")
# Change home directory to workdir and create .rpmmacros there
os.environ["HOME"] = self.workdir
diff --git a/rpmbuild/main.py b/rpmbuild/main.py
index 5cf524f..f348c28 100755
--- a/rpmbuild/main.py
+++ b/rpmbuild/main.py
@@ -150,7 +150,7 @@ def produce_srpm(task, config, resultdir):
create tempdir to allow --private-users=pick with make_srpm
that changes permissions on the result directory to out of scope values
"""
- tempdir = tempfile.mkdtemp(prefix=resultdir)
+ tempdir = tempfile.mkdtemp(prefix="copr-rpmbuild-")
os.chmod(tempdir, stat.S_IRWXU|stat.S_IRWXO)
try:
provider = providers.factory(task["source_type"])(
@@ -241,7 +241,7 @@ def build_rpm(args, config):
task = get_task(args, config, build_config_url_path, task_id)
log_task(task)
- sourcedir = tempfile.mkdtemp()
+ sourcedir = tempfile.mkdtemp(prefix="copr-rpmbuild-")
try:
scm_provider = providers.ScmProvider(task["source_json"], sourcedir,
config)
if task.get("fetch_sources_only"):
diff --git a/rpmbuild/tests/test_helpers.py b/rpmbuild/tests/test_helpers.py
index 5c0e3d2..f50728c 100644
--- a/rpmbuild/tests/test_helpers.py
+++ b/rpmbuild/tests/test_helpers.py
@@ -14,7 +14,7 @@ class TestHelpers(unittest.TestCase):
self.assertEqual(string2list(',,foo\tbar\tbaz'), ['foo',
'bar', 'baz'])
def test_locate_srpm(self):
- tmpdir = tempfile.mkdtemp()
+ tmpdir = tempfile.mkdtemp(prefix="copr-rpmbuild-test-")
srpm_path = os.path.join(tmpdir, "dummy.src.rpm")
open(srpm_path, "w").close()
self.assertEqual(srpm_path, locate_srpm(tmpdir))
diff --git a/rpmbuild/tests/test_scm.py b/rpmbuild/tests/test_scm.py
index 1b2a9ee..dac9155 100644
--- a/rpmbuild/tests/test_scm.py
+++ b/rpmbuild/tests/test_scm.py
@@ -57,7 +57,7 @@ class TestScmProvider(TestCase):
self.assertEqual(provider.spec_path, os.path.join(provider.workdir,
"somerepo", "SPECS", "pkg.spec"))
def test_generate_rpkg_config(self):
- rpkg_tmpdir = tempfile.mkdtemp()
+ rpkg_tmpdir = tempfile.mkdtemp(prefix="copr-rpmbuild-test-")
rpkg_config = open(os.path.join(rpkg_tmpdir, "rpkg.conf.j2"),
"w")
rpkg_config.write(RPKG_CONF_JINJA)
rpkg_config.close()
diff --git a/rpmbuild/tests/test_spec.py b/rpmbuild/tests/test_spec.py
index a295fe8..d437663 100644
--- a/rpmbuild/tests/test_spec.py
+++ b/rpmbuild/tests/test_spec.py
@@ -62,7 +62,7 @@ class TestUrlProviderQueryString(TestCase):
"srelay-0.4.8p3-0.20181224.git688764b.fc10.3sunshine.src.rpm?dl=1",
}
self.json_2 = { 'url':
"http://example.com/test.spec?a=1&b=2" }
- self.resultdir = tempfile.mkdtemp()
+ self.resultdir = tempfile.mkdtemp(prefix="copr-rpmbuild-test-")
@pytest.mark.skipif(distro.id() in ['rhel', 'centos'] and
distro.major_version() == '6',
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.