diff --git a/source/dub/dub.d b/source/dub/dub.d index 436f604..cbe70ca 100644 --- a/source/dub/dub.d +++ b/source/dub/dub.d @@ -106,7 +106,7 @@ ps ~= defaultPackageSuppliers(); m_packageSuppliers = ps; - m_packageManager = new PackageManager(m_userDubPath, m_systemDubPath, false); + m_packageManager = new PackageManager(m_userDubPath, m_systemDubPath); updatePackageSearchPath(); } diff --git a/source/dub/package_.d b/source/dub/package_.d index 22044bd..c6b4559 100644 --- a/source/dub/package_.d +++ b/source/dub/package_.d @@ -80,6 +80,7 @@ { m_parentPackage = parent; m_path = root; + m_path.endsWithSlash = true; // force the package name to be lower case packageInfo.name = packageInfo.name.get!string.toLower(); @@ -427,7 +428,8 @@ private void simpleLint() const { if (m_parentPackage) { if (m_parentPackage.path != path) { - if (info.license != m_parentPackage.info.license) logWarn("License in subpackage %s is different than it's parent package, this is discouraged.", name); + if (info.license.length && info.license != m_parentPackage.info.license) + logWarn("License in subpackage %s is different than it's parent package, this is discouraged.", name); } } if (name.empty()) logWarn("The package in %s has no name.", path); @@ -481,7 +483,7 @@ case "authors": this.authors = deserializeJson!(string[])(value); break; case "copyright": this.copyright = value.get!string; break; case "license": this.license = value.get!string; break; - case "subPackages": subPackages = value; + case "subPackages": subPackages = value; break; case "configurations": break; // handled below, after the global settings have been parsed case "buildTypes": foreach (string name, settings; value) { diff --git a/source/dub/packagemanager.d b/source/dub/packagemanager.d index d69eb35..c6c8212 100644 --- a/source/dub/packagemanager.d +++ b/source/dub/packagemanager.d @@ -44,10 +44,20 @@ if (refresh_packages) refresh(true); } - @property void searchPath(Path[] paths) { m_searchPath = paths.dup; refresh(false); } + @property void searchPath(Path[] paths) + { + if (paths == m_searchPath) return; + m_searchPath = paths.dup; + refresh(false); + } @property const(Path)[] searchPath() const { return m_searchPath; } - @property void disableDefaultSearchPaths(bool val) { m_disableDefaultSearchPaths = val; refresh(true); } + @property void disableDefaultSearchPaths(bool val) + { + if (val == m_disableDefaultSearchPaths) return; + m_disableDefaultSearchPaths = val; + refresh(true); + } @property const(Path)[] completeSearchPath() const { @@ -444,8 +454,9 @@ logInfo("Removed package: '"~pack.name~"'"); } - Package addLocalPackage(in Path path, string verName, LocalPackageType type) + Package addLocalPackage(Path path, string verName, LocalPackageType type) { + path.endsWithSlash = true; auto pack = new Package(path); enforce(pack.name.length, "The package has no name, defined in: " ~ path.toString()); if (verName.length) @@ -538,6 +549,8 @@ void refresh(bool refresh_existing_packages) { + logDiagnostic("Refreshing local packages (refresh existing: %s)...", refresh_existing_packages); + // load locally defined packages void scanLocalPackages(LocalPackageType type) {