diff options
| author | Per Olofsson <pelle@dsv.su.se> | 2015-10-08 13:18:17 +0200 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-10-08 11:10:59 -0400 |
| commit | c387c179da71cc378a40bcf00f8ac1399a17b18e (patch) | |
| tree | 25c655c65a951e9dc6f4300177c1ced23766253b /src | |
| parent | 886053fa9736b7c61b34edfa5367349b43de8d7b (diff) | |
Add Apt.hasForeignArch.
Signed-off-by: Per Olofsson <pelle@dsv.su.se>
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Property/Apt.hs | 8 |
1 files changed, 8 insertions, 0 deletions
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 |
