From c387c179da71cc378a40bcf00f8ac1399a17b18e Mon Sep 17 00:00:00 2001 From: Per Olofsson Date: Thu, 8 Oct 2015 13:18:17 +0200 Subject: Add Apt.hasForeignArch. Signed-off-by: Per Olofsson --- src/Propellor/Property/Apt.hs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Propellor/Property/Apt.hs b/src/Propellor/Property/Apt.hs index 2e913540..15c45629 100644 --- a/src/Propellor/Property/Apt.hs +++ b/src/Propellor/Property/Apt.hs @@ -297,3 +297,11 @@ aptKeyFile k = "/etc/apt/trusted.gpg.d" keyname k ++ ".gpg" cacheCleaned :: Property NoInfo cacheCleaned = trivial $ cmdProperty "apt-get" ["clean"] `describe` "apt cache cleaned" + +-- | Add a foreign architecture to dpkg and apt. +hasForeignArch :: String -> Property NoInfo +hasForeignArch arch = check notAdded add + `describe` ("dpkg has foreign architecture " ++ arch) + where + notAdded = (not . elem arch . lines) <$> readProcess "dpkg" ["--print-foreign-architectures"] + add = cmdProperty "dpkg" ["--add-architecture", arch] `before` update -- cgit v1.2.3