Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trivial: Adapt fixPathDependency to PackageName API #2810

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading