Support new directory structure overlapped over the previous one.
1 parent e7dd612 commit 9763275350c70393a405afde53a4daa1a2bff70e
@Guillaume Piolat Guillaume Piolat authored on 25 Oct 2015
Sönke Ludwig committed on 11 Dec 2015
Showing 1 changed file
View
8
source/dub/packagemanager.d
try foreach( pdir; iterateDirectory(path) ){
logDebug("iterating dir %s entry %s", path.toNativeString(), pdir.name);
if( !pdir.isDirectory ) continue;
 
// Search for a single directory within this directory
// Search for a single directory within this directory which happen to be a prefix of pdir
// This is to support new folder structure installed over the ancient one.
FileInfo subdir;
foreach( pdir2; iterateDirectory(path ~ (pdir.name ~ "/")) )
{
subdir = pdir2;
if (pdir.name.startsWith(pdir2.name)) // eg: package vibe-d will be in "vibe-d-x.y.z/vibe-d"
subdir = pdir2;
}
if( !subdir.isDirectory ) continue;
 
auto pack_path = path ~ (pdir.name ~ "/") ~ (subdir.name ~ "/");