From 6b6d5a08819e946364a41dfa67d6c26a51479420 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 8 Dec 2014 01:08:40 -0400 Subject: changelog --- debian/changelog | 3 ++- propellor.cabal | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 827c7986..101ea004 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,8 @@ -propellor (1.1.1) UNRELEASED; urgency=medium +propellor (1.2.0) UNRELEASED; urgency=medium * Display a warning when ensureProperty is used on a property which has Info and is so prevented from propigating it. + * Removed boolProperty; instead the new toResult can be used. (API change) -- Joey Hess Sun, 07 Dec 2014 17:08:55 -0400 diff --git a/propellor.cabal b/propellor.cabal index fb109649..f3f1c537 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -1,5 +1,5 @@ Name: propellor -Version: 1.1.0 +Version: 1.2.0 Cabal-Version: >= 1.6 License: BSD3 Maintainer: Joey Hess -- cgit v1.2.3 From 06975ec5e1b9e7d6018074aad55aa8b56cd64aba Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 8 Dec 2014 01:12:55 -0400 Subject: another place to use toResult --- src/Propellor/Property/Debootstrap.hs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Propellor/Property/Debootstrap.hs b/src/Propellor/Property/Debootstrap.hs index 0181d58a..0a7308ff 100644 --- a/src/Propellor/Property/Debootstrap.hs +++ b/src/Propellor/Property/Debootstrap.hs @@ -148,18 +148,16 @@ sourceInstall = property "debootstrap installed from source" (liftIO sourceInsta `requires` arInstalled perlInstalled :: Property -perlInstalled = check (not <$> inPath "perl") $ property "perl installed" $ do - v <- liftIO $ firstM id +perlInstalled = check (not <$> inPath "perl") $ property "perl installed" $ + liftIO $ toResult . isJust <$> firstM id [ yumInstall "perl" ] - if isJust v then return MadeChange else return FailedChange arInstalled :: Property -arInstalled = check (not <$> inPath "ar") $ property "ar installed" $ do - v <- liftIO $ firstM id +arInstalled = check (not <$> inPath "ar") $ property "ar installed" $ + liftIO $ toResult . isJust <$> firstM id [ yumInstall "binutils" ] - if isJust v then return MadeChange else return FailedChange yumInstall :: String -> IO Bool yumInstall p = boolSystem "yum" [Param "-y", Param "install", Param p] -- cgit v1.2.3 From 834a05e25a5844ff3aec4e4acecf00cc762d6545 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 8 Dec 2014 01:22:29 -0400 Subject: refactor --- src/Propellor/Property/Service.hs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/Propellor/Property/Service.hs b/src/Propellor/Property/Service.hs index 14e769d0..93e959c6 100644 --- a/src/Propellor/Property/Service.hs +++ b/src/Propellor/Property/Service.hs @@ -13,19 +13,16 @@ type ServiceName = String -- we can do is try to start the service, and if it fails, assume -- this means it's already running. running :: ServiceName -> Property -running svc = property ("running " ++ svc) $ do - void $ ensureProperty $ - scriptProperty ["service " ++ shellEscape svc ++ " start >/dev/null 2>&1 || true"] - return NoChange +running = signaled "start" "running" restarted :: ServiceName -> Property -restarted svc = property ("restarted " ++ svc) $ do - void $ ensureProperty $ - scriptProperty ["service " ++ shellEscape svc ++ " restart >/dev/null 2>&1 || true"] - return NoChange +restarted = signaled "restart" "restarted" reloaded :: ServiceName -> Property -reloaded svc = property ("reloaded " ++ svc) $ do +reloaded = signaled "reload" "reloaded" + +signaled :: String -> Desc -> ServiceName -> Property +signaled cmd desc svc = property (desc ++ " " ++ svc) $ do void $ ensureProperty $ - scriptProperty ["service " ++ shellEscape svc ++ " reload >/dev/null 2>&1 || true"] + scriptProperty ["service " ++ shellEscape svc ++ " " ++ cmd ++ " >/dev/null 2>&1 || true"] return NoChange -- cgit v1.2.3 From 99bff87440cce110c707398416a2eccd5f49e90e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 9 Dec 2014 00:03:14 -0400 Subject: Include Propellor.Property.OS, which was accidentially left out of the cabal file in the last release. --- debian/changelog | 2 ++ propellor.cabal | 1 + 2 files changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index 101ea004..63d76078 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ propellor (1.2.0) UNRELEASED; urgency=medium * Display a warning when ensureProperty is used on a property which has Info and is so prevented from propigating it. * Removed boolProperty; instead the new toResult can be used. (API change) + * Include Propellor.Property.OS, which was accidentially left out of the + cabal file in the last release. -- Joey Hess Sun, 07 Dec 2014 17:08:55 -0400 diff --git a/propellor.cabal b/propellor.cabal index f3f1c537..b0ead4b4 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -90,6 +90,7 @@ Library Propellor.Property.Nginx Propellor.Property.Obnam Propellor.Property.OpenId + Propellor.Property.OS Propellor.Property.Postfix Propellor.Property.Prosody Propellor.Property.Reboot -- cgit v1.2.3 From 040a5fe3c75930f08667369357a77ededf815c5a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 9 Dec 2014 00:05:16 -0400 Subject: prep release --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 63d76078..68564473 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -propellor (1.2.0) UNRELEASED; urgency=medium +propellor (1.2.0) unstable; urgency=medium * Display a warning when ensureProperty is used on a property which has Info and is so prevented from propigating it. @@ -6,7 +6,7 @@ propellor (1.2.0) UNRELEASED; urgency=medium * Include Propellor.Property.OS, which was accidentially left out of the cabal file in the last release. - -- Joey Hess Sun, 07 Dec 2014 17:08:55 -0400 + -- Joey Hess Tue, 09 Dec 2014 00:05:09 -0400 propellor (1.1.0) unstable; urgency=medium -- cgit v1.2.3