Skip to content

Commit

Permalink
cleanup and document a global repo flag
Browse files Browse the repository at this point in the history
  • Loading branch information
gbaz authored and Kleidukos committed Aug 24, 2023
1 parent 47eb77b commit dcfdc9c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cabal-install/src/Distribution/Client/CmdUpdate.hs
Expand Up @@ -199,10 +199,12 @@ updateRepo verbosity _updateFlags repoCtxt (repo, indexState) = do
-- NB: always update the timestamp, even if we didn't actually
-- download anything
writeIndexTimestamp index indexState
ce <- if repoContextIgnoreExpiry repoCtxt
then Just `fmap` getCurrentTime
else return Nothing
updated <- Sec.uncheckClientErrors $ Sec.checkForUpdates repoSecure ce
-- typically we get the current time to check expiry against
-- but if the flag is set, we don't.
now <- case repoContextIgnoreExpiry repoCtxt of

This comment has been minimized.

Copy link
@hasufell

hasufell Nov 17, 2023

Member

This causes name shadow warnings.

False -> Just <$> getCurrentTime
True -> pure Nothing
updated <- Sec.uncheckClientErrors $ Sec.checkForUpdates repoSecure now
-- this resolves indexState (which could be HEAD) into a timestamp
new_ts <- currentIndexTimestamp (lessVerbose verbosity) repoCtxt repo
let rname = remoteRepoName (repoRemote repo)
Expand Down

0 comments on commit dcfdc9c

Please sign in to comment.