diff options
| author | Joey Hess <joey@kitenet.net> | 2014-04-19 02:10:56 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-04-19 02:10:56 -0400 |
| commit | 5dd316a0ad4abce5e81ea19e52caf7b57081cda3 (patch) | |
| tree | 92070fc17e1a57245e1d0f89d5d3bf8599406d85 /Propellor/Property/Apt.hs | |
| parent | 5b4f3d109ee7393b1e44cac60b43def2ce4c8b24 (diff) | |
| parent | 6aeeaaab9073675e8c043d009c97ff62d809975b (diff) | |
Merge branch 'joeyconfig'
Diffstat (limited to 'Propellor/Property/Apt.hs')
| -rw-r--r-- | Propellor/Property/Apt.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Propellor/Property/Apt.hs b/Propellor/Property/Apt.hs index d31e8b46..9234cbbf 100644 --- a/Propellor/Property/Apt.hs +++ b/Propellor/Property/Apt.hs @@ -157,8 +157,8 @@ buildDepIn dir = go `requires` installedMin ["devscripts", "equivs"] -- | Package installation may fail becuse the archive has changed. -- Run an update in that case and retry. robustly :: Property -> Property -robustly p = Property (propertyDesc p) $ do - r <- ensureProperty p +robustly p = adjustProperty p $ \satisfy -> do + r <- satisfy if r == FailedChange then ensureProperty $ p `requires` update else return r @@ -210,7 +210,7 @@ reConfigure :: Package -> [(String, String, String)] -> Property reConfigure package vals = reconfigure `requires` setselections `describe` ("reconfigure " ++ package) where - setselections = Property "preseed" $ makeChange $ + setselections = property "preseed" $ makeChange $ withHandle StdinHandle createProcessSuccess (proc "debconf-set-selections" []) $ \h -> do forM_ vals $ \(tmpl, tmpltype, value) -> @@ -236,7 +236,7 @@ trustsKey k = RevertableProperty trust untrust desc = "apt trusts key " ++ keyname k f = "/etc/apt/trusted.gpg.d" </> keyname k ++ ".gpg" untrust = File.notPresent f - trust = check (not <$> doesFileExist f) $ Property desc $ makeChange $ do + trust = check (not <$> doesFileExist f) $ property desc $ makeChange $ do withHandle StdinHandle createProcessSuccess (proc "gpg" ["--no-default-keyring", "--keyring", f, "--import", "-"]) $ \h -> do hPutStr h (pubkey k) |
