Skip to content

Commit

Permalink
Warn if --index-state is in the future.
Browse files Browse the repository at this point in the history
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
  • Loading branch information
ezyang committed Feb 20, 2017
1 parent d25b84d commit 1af2c51
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cabal-install/Distribution/Client/IndexUtils.hs
Expand Up @@ -264,10 +264,17 @@ getSourcePackagesAtIndexState verbosity repoCtxt mb_idxState = do
return ()
IndexStateTime ts0 -> do
when (isiMaxTime isi /= ts0) $
info verbosity ("Requested index-state " ++ display ts0
if ts0 > isiMaxTime isi
then warn verbosity $
"Requested index-state" ++ display ts0
++ " is in newer than '" ++ rname ++ "'!"
++ " Falling back to older state ("
++ display (isiMaxTime isi) ++ ")."
else info verbosity $
"Requested index-state " ++ display ts0
++ " does not exist in '"++rname++"'!"
++ " Falling back to older state ("
++ display (isiMaxTime isi) ++ ").")
++ display (isiMaxTime isi) ++ ")."
info verbosity ("index-state("++rname++") = " ++
display (isiMaxTime isi) ++ " (HEAD = " ++
display (isiHeadTime isi) ++ ")")
Expand Down

0 comments on commit 1af2c51

Please sign in to comment.