diff --git a/src/Paket.Core/Dependencies/NuGetCache.fs b/src/Paket.Core/Dependencies/NuGetCache.fs index 1d07c24149..18567f65f6 100644 --- a/src/Paket.Core/Dependencies/NuGetCache.fs +++ b/src/Paket.Core/Dependencies/NuGetCache.fs @@ -645,20 +645,20 @@ type UrlToTry = type BlockedCacheEntry = { BlockedFormats : string list } -let private tryUrlOrBlacklistI = - let tryUrlOrBlacklistInner (f : unit -> Async, isOk : obj -> bool) cacheKey = +let private tryUrlOrIgnoreI = + let tryUrlOrIgnoreInner (f : unit -> Async, isOk : obj -> bool) cacheKey = async { //try let! res = f () return isOk res, res } - let memoizedBlackList = memoizeAsyncEx tryUrlOrBlacklistInner + let memoizedIgnoreList = memoizeAsyncEx tryUrlOrIgnoreInner fun f isOk cacheKey -> - memoizedBlackList (f, isOk) cacheKey + memoizedIgnoreList (f, isOk) cacheKey -let private tryUrlOrBlacklist (f: _ -> Async<'a>) (isOk : 'a -> bool) (source:NuGetSource, id:UrlId) = +let private tryUrlOrIgnore (f: _ -> Async<'a>) (isOk : 'a -> bool) (source:NuGetSource, id:UrlId) = let res = - tryUrlOrBlacklistI + tryUrlOrIgnoreI (fun s -> async { let! r = f s in return box r }) (fun s -> isOk (s :?> 'a)) (source,id) @@ -669,15 +669,15 @@ let private tryUrlOrBlacklist (f: _ -> Async<'a>) (isOk : 'a -> bool) (source:Nu type QueryResult = Choice -let tryAndBlacklistUrl doBlackList doWarn (source:NuGetSource) +let tryAndIgnoreUrl doIgnore doWarn (source:NuGetSource) (tryAgain : QueryResult -> bool) (f : string -> Async) (urls: UrlToTry list) : Async= async { let! tasks, resultIndex = urls |> Seq.map (fun url -> async { let cached = - if doBlackList then - tryUrlOrBlacklist (fun () -> async { return! f url.InstanceUrl }) (tryAgain >> not) (source, url.UrlId) + if doIgnore then + tryUrlOrIgnore (fun () -> async { return! f url.InstanceUrl }) (tryAgain >> not) (source, url.UrlId) else async { let! result = f url.InstanceUrl @@ -690,12 +690,12 @@ let tryAndBlacklistUrl doBlackList doWarn (source:NuGetSource) let! result = f url.InstanceUrl return Choice1Of3 result else - return Choice3Of3 () // Url Blacklisted + return Choice3Of3 () // Url Ignored | FirstCall task -> let! isOk, res = task |> Async.AwaitTask if not isOk then if doWarn then - traceWarnIfNotBefore url.InstanceUrl "Possible Performance degradation, blacklist '%s'" url.InstanceUrl + traceWarnIfNotBefore url.InstanceUrl "Possible Performance degradation, ignore '%s'" url.InstanceUrl return Choice2Of3 res else return Choice1Of3 res @@ -736,5 +736,5 @@ let tryAndBlacklistUrl doBlackList doWarn (source:NuGetSource) | Some res -> res | None -> let urls = urls |> Seq.map (fun u -> u.InstanceUrl) |> fun s -> String.Join("\r\t - ", s) - failwithf "All possible sources are already blacklisted. \r\t - %s" urls + failwithf "All possible sources are already ignored. \r\t - %s" urls } diff --git a/src/Paket.Core/Dependencies/NuGetV2.fs b/src/Paket.Core/Dependencies/NuGetV2.fs index 00bd455053..6f7d984549 100644 --- a/src/Paket.Core/Dependencies/NuGetV2.fs +++ b/src/Paket.Core/Dependencies/NuGetV2.fs @@ -263,7 +263,7 @@ let parseODataEntryDetails (url,nugetURL,packageName:PackageName,version:SemVerI let getDetailsFromNuGetViaODataFast isVersionAssumed nugetSource (packageName:PackageName) (version:SemVerInfo) = - let doBlacklist = not isVersionAssumed + let doIgnore = not isVersionAssumed async { let normalizedVersion = version.Normalize() let urls = @@ -377,7 +377,7 @@ let getDetailsFromNuGetViaODataFast isVersionAssumed nugetSource (packageName:Pa | Choice1Of2 _ -> false | _ -> true - let! result = NuGetCache.tryAndBlacklistUrl doBlacklist true nugetSource tryAgain handleUrl urls + let! result = NuGetCache.tryAndIgnoreUrl doIgnore true nugetSource tryAgain handleUrl urls match result with | Choice1Of2 res -> return res | Choice2Of2 ex -> return raise (exn("error", ex)) diff --git a/src/Paket.Core/Installation/InstallProcess.fs b/src/Paket.Core/Installation/InstallProcess.fs index 67cb188e07..97ed485d0d 100644 --- a/src/Paket.Core/Installation/InstallProcess.fs +++ b/src/Paket.Core/Installation/InstallProcess.fs @@ -75,7 +75,7 @@ let findPackageFolder root (groupName,packageName) (version,settings) = failwithf "Package directory for package %O was not found in %s. Storage mode is \"none\"." packageName d.FullName d -let contentFileBlackList : list bool> = [ +let contentFileIgnoreList : list bool> = [ fun f -> f.Name = "_._" fun f -> f.Name.EndsWith ".transform" fun f -> f.Name.EndsWith ".pp" @@ -112,7 +112,7 @@ let processContentFiles root project (usedPackages:Map<_,_>) gitRemoteItems opti |> Seq.toList let copyContentFiles (project : ProjectFile, packagesWithContent) = - let onBlackList (fi : FileInfo) = contentFileBlackList |> List.exists (fun rule -> rule(fi)) + let onIgnoreList (fi : FileInfo) = contentFileIgnoreList |> List.exists (fun rule -> rule(fi)) let rec copyDirContents (fromDir : DirectoryInfo, contentCopySettings, toDir : Lazy) = fromDir.GetDirectories() |> Array.toList @@ -121,7 +121,7 @@ let processContentFiles root project (usedPackages:Map<_,_>) gitRemoteItems opti (fromDir.GetFiles() |> Array.toList |> List.filter (fun file -> - if onBlackList file then false else + if onIgnoreList file then false else if file.Name = "paket.references" then traceWarnfn "You can't use paket.references as a content file in the root of a project. Please take a look at %s" file.FullName; false else true) |> List.map (fun file -> let overwrite = contentCopySettings = ContentCopySettings.Overwrite diff --git a/src/Paket.Core/PaketConfigFiles/InstallModel.fs b/src/Paket.Core/PaketConfigFiles/InstallModel.fs index 6e959b49d3..cb4fbc945c 100644 --- a/src/Paket.Core/PaketConfigFiles/InstallModel.fs +++ b/src/Paket.Core/PaketConfigFiles/InstallModel.fs @@ -837,7 +837,7 @@ module InstallModel = let targetsFile = t.Path (String.endsWithIgnoreCase (sprintf "%s.props" installModel.PackageName.Name) targetsFile|| String.endsWithIgnoreCase (sprintf "%s.targets" installModel.PackageName.Name) targetsFile))) - let filterBlackList = filterUnknownFiles + let filterIgnoreList = filterUnknownFiles let applyFrameworkRestrictions (restriction:FrameworkRestriction) (installModel:InstallModel) = match restriction with @@ -960,7 +960,7 @@ module InstallModel = let createFromContent packageName packageVersion kind frameworkRestrictions content = emptyModel packageName packageVersion kind |> addNuGetFiles content - |> filterBlackList + |> filterIgnoreList |> applyFrameworkRestrictions frameworkRestrictions |> removeIfCompletelyEmpty @@ -972,7 +972,7 @@ module InstallModel = |> addAnalyzerFiles analyzerFiles |> addPackageLoadScriptFiles packageLoadScriptFiles |> addFrameworkAssemblyReferences nuspec.FrameworkAssemblyReferences - |> filterBlackList + |> filterIgnoreList |> applyFrameworkRestrictions frameworkRestrictions |> removeIfCompletelyEmpty |> addLicense nuspec.LicenseUrl @@ -1052,7 +1052,7 @@ type InstallModel with member this.AddFrameworkAssemblyReferences references = InstallModel.addFrameworkAssemblyReferences references this - member this.FilterBlackList () = InstallModel.filterBlackList this + member this.FilterIgnoreList () = InstallModel.filterIgnoreList this member this.FilterExcludes excludes = InstallModel.filterExcludes excludes this diff --git a/tests/Paket.Tests/InstallModel/ProcessingSpecs.fs b/tests/Paket.Tests/InstallModel/ProcessingSpecs.fs index 3ac03cb7e3..11c94083db 100644 --- a/tests/Paket.Tests/InstallModel/ProcessingSpecs.fs +++ b/tests/Paket.Tests/InstallModel/ProcessingSpecs.fs @@ -297,10 +297,10 @@ let ``should skip buckets which contain placeholder while adjusting upper versio |> Seq.map (fun f -> f.Path) |> shouldNotContain @"..\Rx-Main\lib\net20\Rx.dll" [] -let ``should filter _._ when processing blacklist``() = +let ``should filter _._ when processing ignore list``() = let model = emptymodel.AddReferences([ @"..\Rx-Main\lib\net40\_._"; @"..\Rx-Main\lib\net20\_._" ] |> fromLegacyList @"..\Rx-Main\") - .FilterBlackList() + .FilterIgnoreList() model.GetLegacyReferences(TargetProfile.SinglePlatform (DotNetFramework FrameworkVersion.V2)) |> Seq.map (fun f -> f.Path) |> shouldNotContain @"..\Rx-Main\lib\net20\_._" @@ -406,7 +406,7 @@ let ``should handle lib install of Microsoft.BCL for NET >= 40``() = @"..\Microsoft.Bcl\lib\net40\System.Threading.Tasks.dll" @"..\Microsoft.Bcl\lib\net45\_._" ] |> fromLegacyList @"..\Microsoft.Bcl\") - .FilterBlackList() + .FilterIgnoreList() model.GetLegacyReferences(TargetProfile.SinglePlatform (DotNetFramework FrameworkVersion.V3_5)) |> Seq.map (fun f -> f.Path) |> shouldNotContain @"..\Microsoft.Bcl\lib\net40\System.IO.dll" @@ -432,7 +432,7 @@ let ``should skip lib install of Microsoft.BCL for monotouch and monoandroid``() @"..\Microsoft.Bcl\lib\monoandroid\_._" @"..\Microsoft.Bcl\lib\monotouch\_._" @"..\Microsoft.Bcl\lib\net45\_._" ] |> fromLegacyList @"..\Microsoft.Bcl\") - .FilterBlackList() + .FilterIgnoreList() model.GetLegacyReferences(TargetProfile.SinglePlatform (MonoAndroid MonoAndroidVersion.V1)) |> shouldBeEmpty model.GetLegacyReferences(TargetProfile.SinglePlatform MonoTouch) |> shouldBeEmpty @@ -611,7 +611,7 @@ let ``should handle lib install of MicrosoftBcl``() = @"..\Microsoft.Bcl\lib\wpa81\_._" @"..\Microsoft.Bcl\lib\portable-net451+win81\_._" @"..\Microsoft.Bcl\lib\portable-net451+win81+wpa81\_._"] - |> fromLegacyList @"..\Microsoft.Bcl\")).FilterBlackList() + |> fromLegacyList @"..\Microsoft.Bcl\")).FilterIgnoreList() model.GetLegacyReferences(TargetProfile.SinglePlatform (DotNetFramework FrameworkVersion.V4)) |> Seq.map (fun f -> f.Path) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.IO.dll" @@ -726,7 +726,7 @@ let ``should only handle dll and exe files``() = @"..\Fantomas\lib\FSharp.Core.dll" @"..\Fantomas\lib\Fantomas.exe" ] |> fromLegacyList @"..\Fantomas\", NuspecReferences.All) - .FilterBlackList() + .FilterIgnoreList() model.GetLegacyReferences(TargetProfile.SinglePlatform (DotNetFramework FrameworkVersion.V2)) |> Seq.map (fun f -> f.Path) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" @@ -773,7 +773,7 @@ let ``should handle props files``() = InstallModel.EmptyModel(PackageName "xunit.runner.visualstudio",SemVer.Parse "0.1").AddTargetsFiles( [ @"..\xunit.runner.visualstudio\build\net20\xunit.runner.visualstudio.props" @"..\xunit.runner.visualstudio\build\portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid\xunit.runner.visualstudio.props" ] |> fromLegacyList @"..\xunit.runner.visualstudio\") - .FilterBlackList() + .FilterIgnoreList() model.GetTargetsFiles(TargetProfile.SinglePlatform (DotNetFramework FrameworkVersion.V2)) |> Seq.map (fun f -> f.Path) |> shouldContain @"..\xunit.runner.visualstudio\build\net20\xunit.runner.visualstudio.props" @@ -784,7 +784,7 @@ let ``should handle global props files``() = InstallModel.EmptyModel(PackageName "xunit.runner.visualstudio",SemVer.Parse "0.1").AddTargetsFiles( [ @"..\xunit.runner.visualstudio\build\xunit.runner.visualstudio.props" @"..\xunit.runner.visualstudio\build\portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid\xunit.runner.visualstudio.props" ] |> fromLegacyList @"..\xunit.runner.visualstudio\") - .FilterBlackList() + .FilterIgnoreList() model.GetTargetsFiles(TargetProfile.SinglePlatform (DotNetFramework FrameworkVersion.V2)) |> Seq.map (fun f -> f.Path) |> shouldContain @"..\xunit.runner.visualstudio\build\xunit.runner.visualstudio.props" @@ -794,7 +794,7 @@ let ``should handle Targets files``() = let model = InstallModel.EmptyModel(PackageName "StyleCop.MSBuild",SemVer.Parse "0.1").AddTargetsFiles( [ @"..\StyleCop.MSBuild\build\StyleCop.MSBuild.Targets" ] |> fromLegacyList @"..\StyleCop.MSBuild\") - .FilterBlackList() + .FilterIgnoreList() model.GetTargetsFiles(TargetProfile.SinglePlatform (DotNetFramework FrameworkVersion.V2)) |> Seq.map (fun f -> f.Path) |> shouldContain @"..\StyleCop.MSBuild\build\StyleCop.MSBuild.Targets" diff --git a/tests/Playlists/paket.tests.playlist b/tests/Playlists/paket.tests.playlist index f804b2553c..be0a409f92 100644 --- a/tests/Playlists/paket.tests.playlist +++ b/tests/Playlists/paket.tests.playlist @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file