This commit is contained in:
Joey Hess 2011-12-09 01:57:13 -04:00
parent e3f1568e0f
commit d64132a43a
16 changed files with 25 additions and 29 deletions

View file

@ -99,7 +99,7 @@ bandwidthUnits = error "stop trying to rip people off"
{- Do you yearn for the days when men were men and megabytes were megabytes? -}
oldSchoolUnits :: [Unit]
oldSchoolUnits = map mingle $ zip storageUnits memoryUnits
oldSchoolUnits = zipWith (curry mingle) storageUnits memoryUnits
where
mingle (Unit _ a n, Unit s' _ _) = Unit s' a n

View file

@ -11,6 +11,7 @@ import System.IO.Error
import System.Posix.Files
import System.Directory
import Control.Exception (throw)
import Control.Monad
import Utility.SafeCommand
import Utility.Conditional
@ -37,13 +38,11 @@ moveFile src dest = try (rename src dest) >>= onrename
mv tmp _ = do
ok <- boolSystem "mv" [Param "-f",
Param src, Param tmp]
if ok
then return ()
else do
-- delete any partial
_ <- try $
removeFile tmp
rethrow
unless ok $ do
-- delete any partial
_ <- try $
removeFile tmp
rethrow
isdir f = do
r <- try (getFileStatus f)
case r of