Skip to content

Commit

Permalink
Merge pull request #403 from theimowski/master
Browse files Browse the repository at this point in the history
clear failure message for simplify, when lock file outdated
  • Loading branch information
forki committed Nov 30, 2014
2 parents 515087b + d040b24 commit d29ebbc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Paket.Core/Simplifier.fs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,16 @@ let Analyze(allPackages : list<ResolvedPackage>, depFile : DependenciesFile, ref
let flattenedLookup = depsLookup |> Map.map (fun key _ -> getAllDeps key)

let getSimplifiedDeps (depNameFun : 'a -> PackageName) fileName allDeps =
let lookupDeps packageName =
match flattenedLookup |> Map.tryFind (NormalizedPackageName packageName) with
| Some deps -> deps
| None -> failwithf "unable to simplify %s - lock file doesn't include package %s, try running paket update"
fileName
(let (PackageName name) = packageName in name)
let indirectDeps =
allDeps
|> List.map depNameFun
|> List.fold (fun set directDep -> Set.union set (flattenedLookup.[ NormalizedPackageName directDep ])) Set.empty
|> List.fold (fun set directDep -> Set.union set (lookupDeps directDep)) Set.empty
let depsToRemove =
if interactive then indirectDeps |> Set.filter (interactiveConfirm fileName) else indirectDeps
|> Set.map NormalizedPackageName
Expand Down

0 comments on commit d29ebbc

Please sign in to comment.