Skip to content

Commit

Permalink
Trivial: Adapt fixPathDependency to PackageName API
Browse files Browse the repository at this point in the history
  • Loading branch information
Geod24 authored and dlang-bot committed Jan 18, 2024
1 parent 1a64211 commit ebb6cb8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions source/dub/commandline.d
Original file line number Diff line number Diff line change
Expand Up @@ -2783,11 +2783,10 @@ class DustmiteCommand : PackageBuildCommand {
}
}

static void fixPathDependency(string pack, ref Dependency dep) {
static void fixPathDependency(in PackageName name, ref Dependency dep) {
dep.visit!(
(NativePath path) {
auto mainpack = PackageName(pack).main;
dep = Dependency(NativePath("../") ~ mainpack);
dep = Dependency(NativePath("../") ~ name.main.toString());
},
(any) { /* Nothing to do */ },
);
Expand All @@ -2796,11 +2795,11 @@ class DustmiteCommand : PackageBuildCommand {
void fixPathDependencies(ref PackageRecipe recipe, NativePath base_path)
{
foreach (name, ref dep; recipe.buildSettings.dependencies)
fixPathDependency(name, dep);
fixPathDependency(PackageName(name), dep);

foreach (ref cfg; recipe.configurations)
foreach (name, ref dep; cfg.buildSettings.dependencies)
fixPathDependency(name, dep);
fixPathDependency(PackageName(name), dep);

foreach (ref subp; recipe.subPackages)
if (subp.path.length) {
Expand Down

0 comments on commit ebb6cb8

Please sign in to comment.