diff options
| -rw-r--r-- | debian/changelog | 3 | ||||
| -rw-r--r-- | src/Propellor/Property/File.hs | 6 | ||||
| -rw-r--r-- | src/Propellor/Property/Locale.hs | 5 |
3 files changed, 10 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog index 3145acec..1b4c3998 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,9 @@ propellor (2.17.0) UNRELEASED; urgency=medium Thanks, Félix Sipma. * Firewall: add TCPFlag, Frequency, TCPSyn, ICMPTypeMatch Thanks, Félix Sipma. + * Locale.available: Run locale-gen, instead of dpkg-reconfigure locales, + which modified the locale.gen file and sometimes caused the property to + need to make changes every time. -- Joey Hess <id@joeyh.name> Mon, 29 Feb 2016 17:58:08 -0400 diff --git a/src/Propellor/Property/File.hs b/src/Propellor/Property/File.hs index 3021617c..e3732c9f 100644 --- a/src/Propellor/Property/File.hs +++ b/src/Propellor/Property/File.hs @@ -92,7 +92,11 @@ fileProperty' writer desc a f = property desc $ go =<< liftIO (doesFileExist f) let new = unlines (a (lines old)) if old == new then noChange - else makeChange $ updatefile new `viaStableTmp` f + else makeChange $ do + writeFile "/tmp/a" old + writeFile "/tmp/b" new + print ("MAKE CHANGE", f) + updatefile new `viaStableTmp` f go False = makeChange $ writer f (unlines $ a []) -- Replicate the original file's owner and mode. diff --git a/src/Propellor/Property/Locale.hs b/src/Propellor/Property/Locale.hs index a9fb3514..06cd63ad 100644 --- a/src/Propellor/Property/Locale.hs +++ b/src/Propellor/Property/Locale.hs @@ -57,7 +57,7 @@ available locale = (ensureAvailable <!> ensureUnavailable) if locale `presentIn` locales then ensureProperty $ fileProperty desc (foldr uncomment []) f - `onChange` regenerate + `onChange` regenerate else return FailedChange -- locale unavailable for generation ensureUnavailable = fileProperty (locale ++ " locale not generated") (foldr comment []) f @@ -75,6 +75,5 @@ available locale = (ensureAvailable <!> ensureUnavailable) l `presentIn` ls = any (l `isPrefix`) ls l `isPrefix` x = (l `isPrefixOf` x) || (("# " ++ l) `isPrefixOf` x) - regenerate = cmdProperty "dpkg-reconfigure" - ["-f", "noninteractive", "locales"] + regenerate = cmdProperty "locale-gen" [] `assume` MadeChange |
