Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
f05615c0
Unverified
Commit
f05615c0
authored
Dec 11, 2017
by
Peter
Committed by
Mikhail Glushenkov
Dec 19, 2017
Browse files
Update mtime on repo index file even if up to date
Resolves: #4444
parent
86af280b
Changes
2
Hide whitespace changes
Inline
Side-by-side
cabal-install/Distribution/Client/IndexUtils.hs
View file @
f05615c0
...
...
@@ -19,6 +19,7 @@
module
Distribution.Client.IndexUtils
(
getIndexFileAge
,
getInstalledPackages
,
indexBaseName
,
Configure
.
getInstalledPackagesMonitorFiles
,
getSourcePackages
,
getSourcePackagesMonitorFiles
,
...
...
cabal-install/Distribution/Client/Update.hs
View file @
f05615c0
...
...
@@ -26,7 +26,7 @@ import Distribution.Client.FetchUtils
import
Distribution.Client.IndexUtils.Timestamp
import
Distribution.Client.IndexUtils
(
updateRepoIndexCache
,
Index
(
..
),
writeIndexTimestamp
,
currentIndexTimestamp
)
,
currentIndexTimestamp
,
indexBaseName
)
import
Distribution.Client.JobControl
(
newParallelJobControl
,
spawnJob
,
collectJob
)
import
Distribution.Client.Setup
...
...
@@ -40,7 +40,8 @@ import Distribution.Simple.Utils
import
qualified
Data.ByteString.Lazy
as
BS
import
Distribution.Client.GZipUtils
(
maybeDecompress
)
import
System.FilePath
(
dropExtension
)
import
System.Directory
(
setModificationTime
)
import
System.FilePath
((
<.>
),
dropExtension
)
import
Data.Maybe
(
mapMaybe
)
import
Data.Time
(
getCurrentTime
)
import
Control.Monad
...
...
@@ -75,7 +76,8 @@ updateRepo verbosity updateFlags repoCtxt repo = do
RepoRemote
{
..
}
->
do
downloadResult
<-
downloadIndex
transport
verbosity
repoRemote
repoLocalDir
case
downloadResult
of
FileAlreadyInCache
->
return
()
FileAlreadyInCache
->
setModificationTime
(
indexBaseName
repo
<.>
"tar"
)
=<<
getCurrentTime
FileDownloaded
indexPath
->
do
writeFileAtomic
(
dropExtension
indexPath
)
.
maybeDecompress
=<<
BS
.
readFile
indexPath
...
...
@@ -95,7 +97,7 @@ updateRepo verbosity updateFlags repoCtxt repo = do
-- (If all access to the cache goes through hackage-security this can go)
case
updated
of
Sec
.
NoUpdates
->
r
et
urn
()
s
et
ModificationTime
(
indexBaseName
repo
<.>
"tar"
)
=<<
getCurrentTime
Sec
.
HasUpdates
->
updateRepoIndexCache
verbosity
index
-- TODO: This will print multiple times if there are multiple
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment