[commit: ghc] master: Update the package database directory's timestamps when rebuilding the package cache. (e0801a0)

Geoffrey Mainland gmainlan at microsoft.com
Tue Jun 25 00:41:29 CEST 2013


Repository : http://darcs.haskell.org/ghc.git/

On branch  : master

https://github.com/ghc/ghc/commit/e0801a0fb342eea9a312906eab72874d631271cf

>---------------------------------------------------------------

commit e0801a0fb342eea9a312906eab72874d631271cf
Author: Geoffrey Mainland <gmainlan at microsoft.com>
Date:   Mon Jun 24 23:35:33 2013 +0100

    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.

>---------------------------------------------------------------

 utils/ghc-pkg/Main.hs | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs
index 716e7ae..e2f497f 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





More information about the ghc-commits mailing list