diff options
| author | Joey Hess <joeyh@joeyh.name> | 2016-03-07 21:51:25 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2016-03-07 21:54:22 -0400 |
| commit | e7c7adc0c4cdc838eada045334b038c7f01dcc56 (patch) | |
| tree | 85969e8f9bdc8b0d61279956cf5793f493a54ccb /src/Propellor/Property | |
| parent | 6d50ff845e5180a88e7c82c309a483f0a564eb26 (diff) | |
add unsupportedOS
Diffstat (limited to 'src/Propellor/Property')
| -rw-r--r-- | src/Propellor/Property/Apt.hs | 6 | ||||
| -rw-r--r-- | src/Propellor/Property/OS.hs | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/Propellor/Property/Apt.hs b/src/Propellor/Property/Apt.hs index eae56ab5..7301a6ae 100644 --- a/src/Propellor/Property/Apt.hs +++ b/src/Propellor/Property/Apt.hs @@ -160,16 +160,14 @@ installed' params ps = robustly $ check (isInstallable ps) go installedBackport :: [Package] -> Property NoInfo installedBackport ps = withOS desc $ \o -> case o of - Nothing -> error "cannot install backports; os not declared" (Just (System (Debian suite) _)) -> case backportSuite suite of - Nothing -> notsupported o + Nothing -> unsupportedOS Just bs -> ensureProperty $ runApt (["install", "-t", bs, "-y"] ++ ps) `changesFile` dpkgStatus - _ -> notsupported o + _ -> unsupportedOS where desc = unwords ("apt installed backport":ps) - notsupported o = error $ "backports not supported on " ++ show o -- | Minimal install of package, without recommends. installedMin :: [Package] -> Property NoInfo diff --git a/src/Propellor/Property/OS.hs b/src/Propellor/Property/OS.hs index 5f1adddb..e5da0921 100644 --- a/src/Propellor/Property/OS.hs +++ b/src/Propellor/Property/OS.hs @@ -86,7 +86,7 @@ cleanInstallOnce confirmation = check (not <$> doesFileExist flagfile) $ osbootstrapped = withOS (newOSDir ++ " bootstrapped") $ \o -> case o of (Just d@(System (Debian _) _)) -> debootstrap d (Just u@(System (Buntish _) _)) -> debootstrap u - _ -> error "os is not declared to be Debian or *buntu" + _ -> unsupportedOS debootstrap targetos = ensureProperty $ -- Ignore the os setting, and install debootstrap from |
