diff options
author | Joey Hess <joey@kitenet.net> | 2012-01-15 13:26:17 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-01-15 13:49:32 -0400 |
commit | 81856c3175fb011f4c9559a5be55c51ec6ad71cf (patch) | |
tree | 36822dd5ef61e2556b5c82f4d12f35488aca6a69 /Annex | |
parent | 0eed604446ce09e375b8f409fc77d98df9459c23 (diff) |
add a configure check for StatFS
This way, the build log will indicate whether StatFS can be relied on.
I've tested all the failing architectures now, and on all of them,
the StatFS code now returns Nothing, rather than Just nonsense.
Also, if annex.diskreserve is set on a platform where StatFS is not
working, git-annex will complain.
Also, the Makefile was missing the sources target used when building with
cabal.
Diffstat (limited to 'Annex')
-rw-r--r-- | Annex/Content.hs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs index 1713b5e12..ba67a2f15 100644 --- a/Annex/Content.hs +++ b/Annex/Content.hs @@ -177,6 +177,7 @@ checkDiskSpace' adjustment key = do r <- getConfig g "diskreserve" "" let reserve = fromMaybe megabyte $ readSize dataUnits r stats <- liftIO $ getFileSystemStats (gitAnnexDir g) + sanitycheck r stats case (stats, keySize key) of (Nothing, _) -> return () (_, Nothing) -> return () @@ -189,7 +190,17 @@ checkDiskSpace' adjustment key = do needmorespace n = unlessM (Annex.getState Annex.force) $ error $ "not enough free space, need " ++ roughSize storageUnits True n ++ - " more (use --force to override this check or adjust annex.diskreserve)" + " more" ++ forcemsg + forcemsg = " (use --force to override this check or adjust annex.diskreserve)" + sanitycheck r stats + | not (null r) && isNothing stats = do + unlessM (Annex.getState Annex.force) $ + error $ "You have configured a diskreserve of " + ++ r ++ + " but disk space checking is not working" + ++ forcemsg + return () + | otherwise = return () {- Moves a file into .git/annex/objects/ - |