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/Obnam.hs | |
| parent | 5b4f3d109ee7393b1e44cac60b43def2ce4c8b24 (diff) | |
| parent | 6aeeaaab9073675e8c043d009c97ff62d809975b (diff) | |
Merge branch 'joeyconfig'
Diffstat (limited to 'Propellor/Property/Obnam.hs')
| -rw-r--r-- | Propellor/Property/Obnam.hs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/Propellor/Property/Obnam.hs b/Propellor/Property/Obnam.hs index 4d0584bb..32374b57 100644 --- a/Propellor/Property/Obnam.hs +++ b/Propellor/Property/Obnam.hs @@ -65,7 +65,7 @@ backup dir crontimes params numclients = cronjob `describe` desc -- The restore is performed atomically; restoring to a temp directory -- and then moving it to the directory. restored :: FilePath -> [ObnamParam] -> Property -restored dir params = Property (dir ++ " restored by obnam") go +restored dir params = property (dir ++ " restored by obnam") go `requires` installed where go = ifM (liftIO needsRestore) @@ -97,14 +97,17 @@ installed = Apt.installed ["obnam"] -- | Ensures that a recent version of obnam gets installed. -- --- Only useful on Stable. +-- Only does anything for Debian Stable. latestVersion :: Property -latestVersion = propertyList "obnam latest version" - [ toProp $ Apt.trustsKey key - , Apt.setSourcesListD sources "obnam" - ] +latestVersion = withOS "obnam latest version" $ \o -> case o of + (Just (System (Debian suite) _)) | isStable suite -> ensureProperty $ + Apt.setSourcesListD (sources suite) "obnam" + `requires` toProp (Apt.trustsKey key) + _ -> noChange where - sources = ["deb http://code.liw.fi/debian wheezy main"] + sources suite = + [ "deb http://code.liw.fi/debian " ++ Apt.showSuite suite ++ " main" + ] -- gpg key used by the code.liw.fi repository. key = Apt.AptKey "obnam" $ unlines [ "-----BEGIN PGP PUBLIC KEY BLOCK-----" |
