propellor 4.7.0 → 4.7.1
raw patch · 5 files changed
+31/−5 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Propellor.Property.Mount: isMounted :: MountPoint -> IO Bool
Files
- CHANGELOG +7/−0
- debian/changelog +7/−0
- propellor.cabal +1/−1
- src/Propellor/Property/Grub.hs +8/−3
- src/Propellor/Property/Mount.hs +8/−1
CHANGELOG view
@@ -1,3 +1,10 @@+propellor (4.7.1) unstable; urgency=medium++ * Added Mount.isMounted.+ * Grub.bootsMounted: Bugfix.++ -- Joey Hess <id@joeyh.name> Fri, 28 Jul 2017 22:22:40 -0400+ propellor (4.7.0) unstable; urgency=medium * Add Apt.proxy property to set a host's apt proxy.
debian/changelog view
@@ -1,3 +1,10 @@+propellor (4.7.1) unstable; urgency=medium++ * Added Mount.isMounted.+ * Grub.bootsMounted: Bugfix.++ -- Joey Hess <id@joeyh.name> Fri, 28 Jul 2017 22:22:40 -0400+ propellor (4.7.0) unstable; urgency=medium * Add Apt.proxy property to set a host's apt proxy.
propellor.cabal view
@@ -1,5 +1,5 @@ Name: propellor-Version: 4.7.0+Version: 4.7.1 Cabal-Version: >= 1.20 License: BSD2 Maintainer: Joey Hess <id@joeyh.name>
src/Propellor/Property/Grub.hs view
@@ -132,7 +132,12 @@ cleanupmounts :: Property Linux cleanupmounts = property desc $ liftIO $ do- umountLazy (inmnt "/sys")- umountLazy (inmnt "/proc")- umountLazy (inmnt "/dev")+ cleanup "/sys"+ cleanup "/proc"+ cleanup "/dev" return NoChange+ where+ cleanup m = + let mp = inmnt m+ in whenM (isMounted mp) $+ umountLazy mp
src/Propellor/Property/Mount.hs view
@@ -78,6 +78,10 @@ mountPoints :: IO [MountPoint] mountPoints = lines <$> readProcess "findmnt" ["-rn", "--output", "target"] +-- | Checks if anything is mounted at the MountPoint.+isMounted :: MountPoint -> IO Bool+isMounted mnt = isJust <$> getFsType mnt+ -- | Finds all filesystems mounted inside the specified directory. mountPointsBelow :: FilePath -> IO [MountPoint] mountPointsBelow target = filter (\p -> simplifyPath p /= simplifyPath target)@@ -129,12 +133,15 @@ -- | Unmounts a device or mountpoint, -- lazily so any running processes don't block it.+--+-- Note that this will fail if it's not mounted. umountLazy :: FilePath -> IO () umountLazy mnt = unlessM (boolSystem "umount" [ Param "-l", Param mnt ]) $ stopPropellorMessage $ "failed unmounting " ++ mnt --- | Unmounts anything mounted inside the specified directory.+-- | Unmounts anything mounted inside the specified directory,+-- not including the directory itself. unmountBelow :: FilePath -> IO () unmountBelow d = do submnts <- mountPointsBelow d