diff --git a/src/Composer/Downloader/ArchiveDownloader.php b/src/Composer/Downloader/ArchiveDownloader.php index 0233d5b14..ce1d09691 100644 --- a/src/Composer/Downloader/ArchiveDownloader.php +++ b/src/Composer/Downloader/ArchiveDownloader.php @@ -43,7 +43,10 @@ abstract class ArchiveDownloader extends FileDownloader throw new \RuntimeException('Expected empty path to extract '.$package.' into but directory exists: '.$path); } - $temporaryDir = $this->config->get('vendor-dir').'/composer/'.substr(md5(uniqid('', true)), 0, 8); + do { + $temporaryDir = $this->config->get('vendor-dir').'/composer/'.substr(md5(uniqid('', true)), 0, 8); + } while (is_dir($temporaryDir)); + $fileName = $this->getFileName($package, $path); try {