Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove old folder for conan install (#5376) #5384

Merged
merged 4 commits into from Jun 28, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion conans/client/conf/config_installer.py
@@ -1,6 +1,7 @@
import json
import os
import shutil
import uuid

from contextlib import contextmanager
from six.moves.urllib.parse import urlparse
Expand Down Expand Up @@ -34,7 +35,8 @@ def _handle_remotes(cache, remote_file):

@contextmanager
def tmp_config_install_folder(cache):
tmp_folder = os.path.join(cache.cache_folder, "tmp_config_install")
unique_id = uuid.uuid4()
tmp_folder = os.path.join(cache.cache_folder, "tmp_config_install_%s" % unique_id)
# necessary for Mac OSX, where the temp folders in /var/ are symlinks to /private/var/
tmp_folder = os.path.realpath(tmp_folder)
mkdir(tmp_folder)
Expand Down
@@ -0,0 +1,16 @@
# coding=utf-8

import unittest

from conans.client.conf.config_installer import tmp_config_install_folder
from conans.test.utils.tools import TestClient


class InstallFolderTests(unittest.TestCase):

def test_unique_install_folder(self):
client = TestClient()

with tmp_config_install_folder(client.cache) as tmp_folder_first:
with tmp_config_install_folder(client.cache) as tmp_folder_second:
uilianries marked this conversation as resolved.
Show resolved Hide resolved
self.assertNotEqual(tmp_folder_first, tmp_folder_second)