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

clear failure message for simplify, when lock file outdated #403

Merged
merged 1 commit into from
Nov 30, 2014
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
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