diff --git a/source/dub/commandline.d b/source/dub/commandline.d index 7da2883..ec445b7 100644 --- a/source/dub/commandline.d +++ b/source/dub/commandline.d @@ -268,10 +268,11 @@ args.getopt("root", &root_path, ["Path to operate in instead of the current working dir"]); args.getopt("registry", ®istry_urls, ["Search the given DUB registry URL first when resolving dependencies. Can be specified multiple times."]); args.getopt("skip-registry", &skipRegistry, [ - "Skips searching certain package registries for dependencies:", - " none: Search all configured registries (default)", - " standard: Don't search on "~defaultRegistryURL, - " all: Search none of the configured registries", + "Sets a mode for skipping the search on certain package registry types:", + " none: Search all configured or default registries (default)", + " standard: Don't search the main registry (e.g. "~defaultRegistryURL~")", + " configured: Skip all default and user configured registries", + " all: Only search registries specified with --registry", ]); args.getopt("annotate", &annotate, ["Do not perform any action, just print what would be done"]); args.getopt("bare", &bare, ["Read only packages contained in the current directory"]); diff --git a/source/dub/dub.d b/source/dub/dub.d index 0c1b072..c236d3d 100644 --- a/source/dub/dub.d +++ b/source/dub/dub.d @@ -142,7 +142,15 @@ if (skip_registry < SkipPackageSuppliers.all) { - ps ~= (environment.get("DUB_REGISTRY", null).split(";") ~ m_config.registryURLs) + ps ~= environment.get("DUB_REGISTRY", null) + .splitter(";") + .map!(url => cast(PackageSupplier)new RegistryPackageSupplier(URL(url))) + .array; + } + + if (skip_registry < SkipPackageSuppliers.configured) + { + ps ~= m_config.registryURLs .map!(url => cast(PackageSupplier)new RegistryPackageSupplier(URL(url))) .array; } @@ -158,16 +166,16 @@ unittest { scope (exit) environment.remove("DUB_REGISTRY"); - auto dub = new Dub(".", null, SkipPackageSuppliers.standard); + auto dub = new Dub(".", null, SkipPackageSuppliers.configured); assert(dub.m_packageSuppliers.length == 0); environment["DUB_REGISTRY"] = "http://example.com/"; - dub = new Dub(".", null, SkipPackageSuppliers.standard); + dub = new Dub(".", null, SkipPackageSuppliers.configured); logInfo("%s", dub.m_packageSuppliers); assert(dub.m_packageSuppliers.length == 1); environment["DUB_REGISTRY"] = "http://example.com/;http://foo.com/"; - dub = new Dub(".", null, SkipPackageSuppliers.standard); + dub = new Dub(".", null, SkipPackageSuppliers.configured); assert(dub.m_packageSuppliers.length == 2); - dub = new Dub(".", [new RegistryPackageSupplier(URL("http://bar.com/"))], SkipPackageSuppliers.standard); + dub = new Dub(".", [new RegistryPackageSupplier(URL("http://bar.com/"))], SkipPackageSuppliers.configured); assert(dub.m_packageSuppliers.length == 3); } @@ -1220,9 +1228,10 @@ /// Determines which of the default package suppliers are queried for packages. enum SkipPackageSuppliers { - none, /// Uses all configured package suppliers. - standard, /// Does not use the default package suppliers (`defaultPackageSuppliers`). - all /// Uses only manually specified package suppliers. + none, /// Uses all configured package suppliers. + standard, /// Does not use the default package suppliers (`defaultPackageSuppliers`). + configured, /// Does not use default suppliers or suppliers configured in DUB's configuration file + all /// Uses only manually specified package suppliers. } private class DependencyVersionResolver : DependencyResolver!(Dependency, Dependency) {