summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Mainland <gmainlan@microsoft.com>2013-06-24 23:35:33 +0100
committerGeoffrey Mainland <gmainlan@microsoft.com>2013-06-24 23:35:33 +0100
commite0801a0fb342eea9a312906eab72874d631271cf (patch)
tree73804968717d3744145538a18caa5af1e6403360
parente1cdaf388d3ac4a7041cf29da32669f577922e33 (diff)
downloadhaskell-e0801a0fb342eea9a312906eab72874d631271cf.tar.gz
Update the package database directory's timestamps when rebuilding the package cache.
I was seeing many "WARNING: cache is out of date" errors during validation claiming that my package cache was out of date. This patch eliminates those errors by ensuring that when we rebuild the package cache, the modification time of the directory containing the package database is set to be the same as the modification time of the cache.
-rw-r--r--utils/ghc-pkg/Main.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs
index 716e7ae5ac..e2f497f36c 100644
--- a/utils/ghc-pkg/Main.hs
+++ b/utils/ghc-pkg/Main.hs
@@ -901,6 +901,10 @@ updateDBCache verbosity db = do
if isPermissionError e
then die (filename ++ ": you don't have permission to modify this file")
else ioError e
+#ifndef mingw32_HOST_OS
+ status <- getFileStatus filename
+ setFileTimes (location db) (accessTime status) (modificationTime status)
+#endif
-- -----------------------------------------------------------------------------
-- Exposing, Hiding, Trusting, Distrusting, Unregistering are all similar