diff options
| author | Joey Hess <joeyh@joeyh.name> | 2016-03-07 17:18:33 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2016-03-07 17:18:33 -0400 |
| commit | eb6eee8d8ff3db25237d64153277114aa4c99055 (patch) | |
| tree | 6d1f8a4083641f757dcb4b3846f9ba17e16cfb40 /src/Propellor/Property/FreeBSD | |
| parent | 08b77f2a0a760a8ab1275e0100b8ebef290ad85a (diff) | |
use catchIO
Diffstat (limited to 'src/Propellor/Property/FreeBSD')
| -rw-r--r-- | src/Propellor/Property/FreeBSD/Pkg.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Propellor/Property/FreeBSD/Pkg.hs b/src/Propellor/Property/FreeBSD/Pkg.hs index 1d6e1f68..913710f7 100644 --- a/src/Propellor/Property/FreeBSD/Pkg.hs +++ b/src/Propellor/Property/FreeBSD/Pkg.hs @@ -77,7 +77,9 @@ isInstallable :: Package -> IO Bool isInstallable p = (not <$> isInstalled p) <&&> exists p isInstalled :: Package -> IO Bool -isInstalled p = catch (runPkg "info" [p] >> return True) (\(_ :: IOError ) -> return False) +isInstalled p = (runPkg "info" [p] >> return True) + `catchIO` (\_ -> return False) exists :: Package -> IO Bool -exists p = catch (runPkg "search" ["--search", "name", "--exact", p] >> return True) (\(_ :: IOError ) -> return False) +exists p = (runPkg "search" ["--search", "name", "--exact", p] >> return True) + `catchIO` (\_ -> return False) |
