From 8ecba1e160e57f0aeaa68c1809e14ecc887a7faa Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Wed, 11 Mar 2015 19:36:26 +0100 Subject: [PATCH] paket-files folder is alwaays relative to paket.dependencies - fixes #564 --- RELEASE_NOTES.md | 3 +++ src/Paket.Core/InstallProcess.fs | 4 ++-- src/Paket.Core/ModuleResolver.fs | 6 +++--- src/Paket.Core/RemoteDownload.fs | 4 ++-- src/Paket/Paket.fsproj | 4 ++-- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 92ce86f126..9503644b73 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,6 @@ +#### 0.33.13 - 11.03.2015 +* BUGFIX: paket-files folder is alwaays relative to `paket.dependencies` - https://github.com/fsprojects/Paket/issues/564 + #### 0.33.12 - 11.03.2015 * Allow empty lines in `paket.template` and report file name if parser fails - https://github.com/fsprojects/Paket/issues/692 diff --git a/src/Paket.Core/InstallProcess.fs b/src/Paket.Core/InstallProcess.fs index d8687ca4cb..c6f74b3096 100644 --- a/src/Paket.Core/InstallProcess.fs +++ b/src/Paket.Core/InstallProcess.fs @@ -183,10 +183,10 @@ let InstallIntoProjects(sources,force, hard, withBindingRedirects, lockFile:Lock let getSingleRemoteFilePath name = traceVerbose <| sprintf "Filename %s " name - lockFile.SourceFiles |> List.iter (fun i -> traceVerbose <| sprintf " %s %s " i.Name i.FilePath) + lockFile.SourceFiles |> List.iter (fun i -> traceVerbose <| sprintf " %s %s " i.Name (i.FilePath root)) let sourceFile = lockFile.SourceFiles |> List.tryFind (fun f -> Path.GetFileName(f.Name) = name) match sourceFile with - | Some file -> file.FilePath + | Some file -> file.FilePath(root) | None -> failwithf "%s references file %s, but it was not found in the paket.lock file." referenceFile.FileName name let gitRemoteItems = diff --git a/src/Paket.Core/ModuleResolver.fs b/src/Paket.Core/ModuleResolver.fs index d433cc27fe..f9464b24a8 100644 --- a/src/Paket.Core/ModuleResolver.fs +++ b/src/Paket.Core/ModuleResolver.fs @@ -42,11 +42,11 @@ type ResolvedSourceFile = Dependencies : Set Origin : SingleSourceFileOrigin } - member this.FilePath = this.ComputeFilePath(this.Name) + member this.FilePath(root) = this.ComputeFilePath(root,this.Name) - member this.ComputeFilePath(name : string) = + member this.ComputeFilePath(root,name : string) = let path = normalizePath (name.TrimStart('/')) - let di = DirectoryInfo(Path.Combine(Constants.PaketFilesFolderName, this.Owner, this.Project, path)) + let di = DirectoryInfo(Path.Combine(root,Constants.PaketFilesFolderName, this.Owner, this.Project, path)) di.FullName override this.ToString() = sprintf "%s/%s:%s %s" this.Owner this.Project this.Commit this.Name diff --git a/src/Paket.Core/RemoteDownload.fs b/src/Paket.Core/RemoteDownload.fs index 3f6975806b..c8c740d8f8 100644 --- a/src/Paket.Core/RemoteDownload.fs +++ b/src/Paket.Core/RemoteDownload.fs @@ -48,7 +48,7 @@ let downloadDependenciesFile(rootPath,parserF,remoteFile:ModuleResolver.Resolved match result with | Some text when parserF text -> - let destination = Path.Combine(rootPath, remoteFile.ComputeFilePath(dependenciesFileName)) + let destination = remoteFile.ComputeFilePath(rootPath,dependenciesFileName) Directory.CreateDirectory(destination |> Path.GetDirectoryName) |> ignore File.WriteAllText(destination, text) @@ -130,7 +130,7 @@ let downloadRemoteFiles(remoteFile:ResolvedSourceFile,destination) = async { let DownloadSourceFiles(rootPath, sourceFiles:ModuleResolver.ResolvedSourceFile list) = sourceFiles |> Seq.map (fun source -> - let destination = Path.Combine(rootPath, source.FilePath) + let destination = source.FilePath(rootPath) let destinationDir = FileInfo(destination).Directory.FullName (destinationDir, source.Commit), (destination, source)) diff --git a/src/Paket/Paket.fsproj b/src/Paket/Paket.fsproj index fc065b5c1f..3ae8404f2f 100644 --- a/src/Paket/Paket.fsproj +++ b/src/Paket/Paket.fsproj @@ -41,8 +41,8 @@ 3 - update -f - D:\code\paketkopie + update + D:\code\Paket09x\.paket 11