File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
cabal-install/src/Distribution/Client/ProjectConfig Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,7 @@ import Distribution.Simple.Utils
133
133
( debug
134
134
, lowercase
135
135
, noticeDoc
136
+ , warn
136
137
)
137
138
import Distribution.Types.CondTree
138
139
( CondBranch (.. )
@@ -310,7 +311,13 @@ parseProjectSkeleton cacheDir httpTransport verbosity importsBy projectDir sourc
310
311
(noticeDoc verbosity $ untrimmedUriImportMsg (Disp. text " Warning:" ) importLocPath)
311
312
let fs = (\ z -> CondNode z [normLocPath] mempty ) <$> fieldsToConfig normSource (reverse acc)
312
313
res <- parseProjectSkeleton cacheDir httpTransport verbosity importsBy projectDir importLocPath . ProjectConfigToParse =<< fetchImportConfig normLocPath
313
- rest <- go [] xs
314
+ uniqueFields <-
315
+ if uniqueImport `elem` seenImports
316
+ then do
317
+ warn verbosity . render $ duplicateImportMsg uniqueImport normLocPath seenImportsBy
318
+ return []
319
+ else return xs
320
+ rest <- go [] uniqueFields
314
321
pure . fmap mconcat . sequence $ [projectParse Nothing normSource fs, res, rest]
315
322
(ParseUtils. Section l " if" p xs') -> do
316
323
normSource <- canonicalizeConfigPath projectDir source
You can’t perform that action at this time.
0 commit comments