build without disk-free-space on android

This commit is contained in:
Joey Hess 2016-03-08 02:45:10 -04:00
parent b095561e70
commit 6623b557ed
Failed to extract signature
2 changed files with 19 additions and 2 deletions

View file

@ -6,12 +6,15 @@
-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
{-# LANGUAGE CPP #-}
module Utility.DiskFree (
getDiskFree,
getDiskSize
) where
#ifndef __ANDROID__
import System.DiskSpace
import Utility.Applicative
import Utility.Exception
@ -21,3 +24,15 @@ getDiskFree = catchMaybeIO . getAvailSpace
getDiskSize :: FilePath -> IO (Maybe Integer)
getDiskSize = fmap diskTotal <$$> catchMaybeIO . getDiskUsage
#else
#warning Building without disk free space checking support
getDiskFree :: FilePath -> IO (Maybe Integer)
getDiskFree _ = return Nothing
getDiskSize :: FilePath -> IO (Maybe Integer)
getDiskSize _ = return Nothing
#endif