diff --git a/src/alire/alire-toolchains-solutions.adb b/src/alire/alire-toolchains-solutions.adb index 8dd3c4ed5..9106d4105 100644 --- a/src/alire/alire-toolchains-solutions.adb +++ b/src/alire/alire-toolchains-solutions.adb @@ -15,8 +15,6 @@ package body Alire.Toolchains.Solutions is return Alire.Solutions.Solution is - Redeployed : Boolean := False; - ------------------------ -- Redeploy_If_Needed -- ------------------------ @@ -31,9 +29,11 @@ package body Alire.Toolchains.Solutions is -- It must be redeployed Put_Warning ("Tool " & Mil.TTY_Image & " is missing, redeploying..."); - Redeployed := True; - Toolchains.Deploy (Index.Find (Mil.Crate, Mil.Version)); + + -- This tool is used immediately to be inserted in the result map, + -- so we must invalidate the cache right now. + Invalidate_Available_Cache; end Redeploy_If_Needed; Result : Alire.Solutions.Solution := Solution; @@ -68,11 +68,6 @@ package body Alire.Toolchains.Solutions is end if; end loop; - if Redeployed then - Trace.Debug ("Missing tools were redeployed, invalidating cache."); - Invalidate_Available_Cache; - end if; - return Result; end Add_Toolchain;