Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
Support conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin Zhao <[email protected]>
  • Loading branch information
GZGavinZhao authored and ikeycode committed Dec 17, 2023
1 parent 09ece44 commit ef7fd8c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/mason/build/builder.d
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,11 @@ private:
oldPkg.runtimeDependencies = oldPkg.runtimeDependencies.chain(pkd.runtimeDependencies)
.uniq.array;
oldPkg.paths = oldPkg.paths.chain(pkd.paths).uniq.array;
oldPkg.conflicts = oldPkg.conflicts.chain(pkd.conflicts).uniq.array;

sort(oldPkg.runtimeDependencies);
sort(oldPkg.paths);
sort(oldPkg.conflicts);

/* Merge details */
if (oldPkg.summary is null)
Expand Down
13 changes: 13 additions & 0 deletions source/mason/build/manifest/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,19 @@ public MetaPayload generateMetadata(scope AnalysisBucket bucket,
}
}

auto conflicts = pkg.pd.conflicts.map!((const n) => fromString!Dependency(n));
if (!conflicts.empty)
{
foreach (conflict; conflicts)
{
if (shouldLog)
{
info(format!"[%s] conflicts with %s"(pkg.pd.name, conflict));
}
met.addRecord(RecordType.Provider, RecordTag.Conflicts, conflict);
}
}

return met;

}
Expand Down

0 comments on commit ef7fd8c

Please sign in to comment.