diff --git a/source/dub/internal/utils.d b/source/dub/internal/utils.d index bf27d19..c4e95c6 100644 --- a/source/dub/internal/utils.d +++ b/source/dub/internal/utils.d @@ -53,18 +53,21 @@ } /** - Obtain a lock for a file at the given path. If the file cannot be locked - within the given duration, an exception is thrown. The file will be created - if it does not yet exist. Deleting the file is not safe as another process - could create a new file with the same name. - The returned lock will get unlocked upon destruction. - - Params: - path = path to file that gets locked - timeout = duration after which locking failed - Returns: - The locked file or an Exception on timeout. -*/ + * Obtain a lock for a file at the given path. + * + * If the file cannot be locked within the given duration, + * an exception is thrown. The file will be created if it does not yet exist. + * Deleting the file is not safe as another process could create a new file + * with the same name. + * The returned lock will get unlocked upon destruction. + * + * Params: + * path = path to file that gets locked + * timeout = duration after which locking failed + * + * Returns: + * The locked file or an Exception on timeout. + */ auto lockFile(string path, Duration timeout) { import core.thread : Thread; diff --git a/source/dub/packagemanager.d b/source/dub/packagemanager.d index 26d6b91..6c08bdf 100644 --- a/source/dub/packagemanager.d +++ b/source/dub/packagemanager.d @@ -294,21 +294,21 @@ Package loadSCMPackage(string name, Repository repo) in { assert(!repo.empty); } do { - Package pack; + Package pack; - final switch (repo.kind) - { - case repo.Kind.git: - pack = loadGitPackage(name, repo); - } - if (pack !is null) { - addPackages(m_temporaryPackages, pack); - } - return pack; + final switch (repo.kind) + { + case repo.Kind.git: + pack = loadGitPackage(name, repo); + } + if (pack !is null) { + addPackages(m_temporaryPackages, pack); + } + return pack; } - private Package loadGitPackage(string name, in Repository repo) - { + private Package loadGitPackage(string name, in Repository repo) + { import dub.internal.git : cloneRepository; if (!repo.ref_.startsWith("~") && !repo.ref_.isGitHash) { @@ -506,7 +506,7 @@ m_repositories[scope_].writeOverrides(); } - /// Ditto + /// Ditto void addOverride(PlacementLocation scope_, string package_, VersionRange source, Version target) { m_repositories[scope_].overrides ~= PackageOverride(package_, source, target); @@ -524,10 +524,10 @@ deprecated("Use the overload that accepts a `VersionRange` as 3rd argument") void removeOverride(PlacementLocation scope_, string package_, Dependency version_spec) { - version_spec.visit!( - (VersionRange src) => this.removeOverride(scope_, package_, src), - (any) { throw new Exception(format("No override exists for %s %s", package_, version_spec)); }, - ); + version_spec.visit!( + (VersionRange src) => this.removeOverride(scope_, package_, src), + (any) { throw new Exception(format("No override exists for %s %s", package_, version_spec)); }, + ); } void removeOverride(PlacementLocation scope_, string package_, VersionRange src) @@ -887,7 +887,7 @@ deprecated("Use `source` instead") @property inout(Dependency) version_ () inout return @safe { - return Dependency(this.source); + return Dependency(this.source); } deprecated("Assign `source` instead") @@ -895,11 +895,11 @@ this.source = v.visit!( (VersionRange range) => range, (any) { - int a; if (a) return VersionRange.init; // Trick the compiler - throw new Exception("Cannot use anything else than a `VersionRange` for overrides"); - }, + int a; if (a) return VersionRange.init; // Trick the compiler + throw new Exception("Cannot use anything else than a `VersionRange` for overrides"); + }, ); - return this; + return this; } deprecated("Use `target.match` directly instead")