summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2017-08-01 17:59:00 -0400
committerJoey Hess2017-08-01 17:59:00 -0400
commit1a78b66631f29852c3d4af1695153c5e5e1efdd8 (patch)
tree32a5494c5b9c40a9713ad5c125f2249a9d3ea9a7
parent54d4e5c8e36919ce60ff983cf0c2ee3ced3ec5e7 (diff)
Locale: Make sure that the locales package is installed when enabling locales.
-rw-r--r--debian/changelog2
-rw-r--r--src/Propellor/Property/Locale.hs4
2 files changed, 5 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index d8fa8c9b..ec899f56 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ propellor (4.7.6) UNRELEASED; urgency=medium
* Sbuild: Add Sbuild.userConfig property.
Thanks, Sean Whitton
+ * Locale: Make sure that the locales package is installed when enabling
+ locales.
-- Joey Hess <id@joeyh.name> Tue, 01 Aug 2017 15:33:49 -0400
diff --git a/src/Propellor/Property/Locale.hs b/src/Propellor/Property/Locale.hs
index b7cf242c..14c6f0b0 100644
--- a/src/Propellor/Property/Locale.hs
+++ b/src/Propellor/Property/Locale.hs
@@ -4,6 +4,7 @@ module Propellor.Property.Locale where
import Propellor.Base
import Propellor.Property.File
+import qualified Propellor.Property.Apt as Apt
import Data.List (isPrefixOf)
@@ -50,7 +51,8 @@ locale `isSelectedFor` vars = do
-- Per Debian bug #684134 we cannot ensure a locale is generated by means of
-- Apt.reConfigure. So localeAvailable edits /etc/locale.gen manually.
available :: Locale -> RevertableProperty DebianLike DebianLike
-available locale = ensureAvailable <!> ensureUnavailable
+available locale = ensureAvailable `requires` Apt.installed ["locales"]
+ <!> ensureUnavailable
where
f = "/etc/locale.gen"
desc = (locale ++ " locale generated")