summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/DiskImage.hs
diff options
context:
space:
mode:
authorMario Lang2015-09-13 00:46:49 +0200
committerJoey Hess2015-09-13 13:21:41 -0400
commitb84c9bbb7c9db688118ad756c1c43ef034fd98fb (patch)
tree61d50f50f58714e9df2390c337fa7bb2ff34d3ea /src/Propellor/Property/DiskImage.hs
parent2af70d4ac7ff25a3e596de195abe40db46c74074 (diff)
Follow some hlint suggestions.
Diffstat (limited to 'src/Propellor/Property/DiskImage.hs')
-rw-r--r--src/Propellor/Property/DiskImage.hs12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/Propellor/Property/DiskImage.hs b/src/Propellor/Property/DiskImage.hs
index 35082eec..8d35991e 100644
--- a/src/Propellor/Property/DiskImage.hs
+++ b/src/Propellor/Property/DiskImage.hs
@@ -119,7 +119,7 @@ imageBuiltFrom img chrootdir tabletype partspec final = mkimg <!> rmimg
liftIO $ unmountBelow chrootdir
szm <- M.mapKeys (toSysDir chrootdir) . M.map toPartSize
<$> liftIO (dirSizes chrootdir)
- let calcsz = \mnts -> maybe defSz fudge . getMountSz szm mnts
+ let calcsz mnts = maybe defSz fudge . getMountSz szm mnts
-- tie the knot!
let (mnts, t) = fitChrootSize tabletype partspec (map (calcsz mnts) mnts)
ensureProperty $
@@ -131,8 +131,7 @@ imageBuiltFrom img chrootdir tabletype partspec final = mkimg <!> rmimg
rmimg = File.notPresent img
partitionsPopulated :: FilePath -> [MountPoint] -> [FilePath] -> Property NoInfo
-partitionsPopulated chrootdir mnts devs = property desc $
- mconcat $ map (uncurry go) (zip mnts devs)
+partitionsPopulated chrootdir mnts devs = property desc $ mconcat $ zipWith go mnts devs
where
desc = "partitions populated from " ++ chrootdir
@@ -200,8 +199,7 @@ getMountSz _ _ Nothing = Nothing
getMountSz szm l (Just mntpt) =
fmap (`reducePartSize` childsz) (M.lookup mntpt szm)
where
- childsz = mconcat $ catMaybes $
- map (getMountSz szm l) (filter (isChild mntpt) l)
+ childsz = mconcat $ mapMaybe (getMountSz szm l) (filter (isChild mntpt) l)
isChild :: FilePath -> MountPoint -> Bool
isChild mntpt (Just d)
@@ -274,7 +272,7 @@ extended :: PartSpec -> PartSpec
extended s = adjustp s $ \p -> p { partType = Extended }
adjustp :: PartSpec -> (Partition -> Partition) -> PartSpec
-adjustp (mp, p) f = (mp, \sz -> f (p sz))
+adjustp (mp, p) f = (mp, f . p)
-- | The constructor for each Partition is passed the size of the files
-- from the chroot that will be put in that partition.
@@ -282,7 +280,7 @@ fitChrootSize :: TableType -> [PartSpec] -> [PartSize] -> ([MountPoint], PartTab
fitChrootSize tt l basesizes = (mounts, parttable)
where
(mounts, sizers) = unzip l
- parttable = PartTable tt (map (uncurry id) (zip sizers basesizes))
+ parttable = PartTable tt (zipWith id sizers basesizes)
-- | A pair of properties. The first property is satisfied within the
-- chroot, and is typically used to download the boot loader.