From cb8da87d1db3bc0be3e88346988bbd9a27f3c3e4 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Tue, 10 Oct 2017 12:35:52 +0200 Subject: [PATCH] load scripts should only work on lock file - fixes #2372 --- src/Paket.Core/Installation/UpdateProcess.fs | 6 +++--- src/Paket.Core/Packaging/PackageMetaData.fs | 2 +- src/Paket.Core/PaketConfigFiles/DependenciesFile.fs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Paket.Core/Installation/UpdateProcess.fs b/src/Paket.Core/Installation/UpdateProcess.fs index 3710cda399..85a55d9270 100644 --- a/src/Paket.Core/Installation/UpdateProcess.fs +++ b/src/Paket.Core/Installation/UpdateProcess.fs @@ -200,7 +200,7 @@ let SelectiveUpdate(dependenciesFile : DependenciesFile, alternativeProjectRoot, lockFile,hasChanged,updatedGroups /// Smart install command -let SmartInstall(dependenciesFile, updateMode, options : UpdaterOptions) = +let SmartInstall(dependenciesFile:DependenciesFile, updateMode, options : UpdaterOptions) = let lockFile,hasChanged,updatedGroups = SelectiveUpdate(dependenciesFile, options.Common.AlternativeProjectRoot, updateMode, options.Common.SemVerUpdateMode, options.Common.Force) let root = Path.GetDirectoryName dependenciesFile.FileName @@ -230,8 +230,8 @@ let SmartInstall(dependenciesFile, updateMode, options : UpdaterOptions) = |> Seq.map (fun g -> g.Name) |> Seq.toList - let rootDir = (DirectoryInfo dependenciesFile.RootPath) - let depCache= DependencyCache(dependenciesFile,lockFile) + let rootDir = DirectoryInfo dependenciesFile.RootPath + let depCache= DependencyCache(dependenciesFile.FileName,lockFile) let scripts = LoadingScripts.ScriptGeneration.constructScriptsFromData depCache groupsToGenerate options.Common.ProvidedFrameworks options.Common.ProvidedScriptTypes for script in scripts do script.Save rootDir diff --git a/src/Paket.Core/Packaging/PackageMetaData.fs b/src/Paket.Core/Packaging/PackageMetaData.fs index f1cb877569..45cd8be9dd 100644 --- a/src/Paket.Core/Packaging/PackageMetaData.fs +++ b/src/Paket.Core/Packaging/PackageMetaData.fs @@ -286,7 +286,7 @@ let findDependencies (dependenciesFile : DependenciesFile) config platform (temp |> List.fold (fun templatefile file -> addFile (toFile config platform file) targetDir templatefile) withDeps let lockFile = - dependenciesFile.FindLockfile().FullName + dependenciesFile.FindLockFile().FullName |> LockFile.LoadFrom let allReferences = diff --git a/src/Paket.Core/PaketConfigFiles/DependenciesFile.fs b/src/Paket.Core/PaketConfigFiles/DependenciesFile.fs index 414b97bbb1..3cf8806c3f 100644 --- a/src/Paket.Core/PaketConfigFiles/DependenciesFile.fs +++ b/src/Paket.Core/PaketConfigFiles/DependenciesFile.fs @@ -139,7 +139,7 @@ type DependenciesFile(fileName,groups:Map, textRepr let transform (dependenciesFile:DependenciesFile) (group:DependenciesGroup) = let getRestrictionList = let projectFrameworks = lazy ( - let lockFile = dependenciesFile.FindLockfile() + let lockFile = dependenciesFile.FindLockFile() let dir = (lockFile : FileInfo).DirectoryName let projects = ProjectFile.FindAllProjects dir let frameworks = projects |> Array.map ProjectFile.getTargetProfile |> Array.distinct @@ -741,7 +741,7 @@ type PaketFiles = let dependenciesFile = findInPath (directory,true) |> DependenciesFile.ReadFromFile - let file = dependenciesFile.FindLockfile() + let file = dependenciesFile.FindLockFile() if file.Exists then let lockFile = file.FullName |> LockFile.LoadFrom DependenciesAndLock(dependenciesFile, lockFile)