forked from qt-creator/qt-creator
Docker: Make sure temporary paths don't duplicate
Change-Id: I980f2a02c0a521d2d142573d94eb8850c26f0999 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -1105,12 +1105,21 @@ void DockerDeviceFactory::shutdownExistingDevices()
|
|||||||
|
|
||||||
bool DockerDevicePrivate::addTemporaryMount(const FilePath &path, const FilePath &containerPath)
|
bool DockerDevicePrivate::addTemporaryMount(const FilePath &path, const FilePath &containerPath)
|
||||||
{
|
{
|
||||||
bool alreadyAdded = anyOf(m_temporaryMounts, [containerPath](const TemporaryMountInfo &info) {
|
const bool alreadyAdded = anyOf(m_temporaryMounts,
|
||||||
|
[containerPath](const TemporaryMountInfo &info) {
|
||||||
return info.containerPath == containerPath;
|
return info.containerPath == containerPath;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (alreadyAdded)
|
if (alreadyAdded)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
const bool alreadyManuallyAdded = anyOf(m_data.mounts, [path](const QString &mount) {
|
||||||
|
return mount == path.path();
|
||||||
|
});
|
||||||
|
|
||||||
|
if (alreadyManuallyAdded)
|
||||||
|
return false;
|
||||||
|
|
||||||
const TemporaryMountInfo newMount{path, containerPath};
|
const TemporaryMountInfo newMount{path, containerPath};
|
||||||
|
|
||||||
const expected_str<void> result = isValidMountInfo(newMount);
|
const expected_str<void> result = isValidMountInfo(newMount);
|
||||||
|
Reference in New Issue
Block a user