summaryrefslogtreecommitdiff
path: root/Propellor/Property/Apt.hs
diff options
context:
space:
mode:
authorJoey Hess2014-04-02 20:26:38 -0400
committerJoey Hess2014-04-02 20:26:38 -0400
commit73fcd794e4258342740646ad0016a731f26e6951 (patch)
tree9ab7a0ebc9fcb75aca5b1817feec2deabffb2643 /Propellor/Property/Apt.hs
parenta5524343704a4037d5a4dd0a860a50f3eaeee12c (diff)
propellor spin
Diffstat (limited to 'Propellor/Property/Apt.hs')
-rw-r--r--Propellor/Property/Apt.hs20
1 files changed, 15 insertions, 5 deletions
diff --git a/Propellor/Property/Apt.hs b/Propellor/Property/Apt.hs
index 0b8b8ab9..867e6bb7 100644
--- a/Propellor/Property/Apt.hs
+++ b/Propellor/Property/Apt.hs
@@ -60,9 +60,10 @@ setSourcesList :: [Line] -> Property
setSourcesList ls = sourcesList `File.hasContent` ls `onChange` update
runApt :: [String] -> Property
-runApt ps = cmdProperty' "apt-get" ps env
- where
- env =
+runApt ps = cmdProperty' "apt-get" ps noninteractiveEnv
+
+noninteractiveEnv :: [(String, String)]
+noninteractiveEnv =
[ ("DEBIAN_FRONTEND", "noninteractive")
, ("APT_LISTCHANGES_FRONTEND", "none")
]
@@ -95,8 +96,17 @@ buildDep ps = robustly go
where
go = runApt $ ["-y", "build-dep"] ++ ps
-{- Package installation may fail becuse the archive has changed.
- - Run an update in that case and retry. -}
+-- | Installs the build deps for the source package unpacked
+-- in the specifed directory, with a dummy package also
+-- installed so that autoRemove won't remove them.
+buildDepIn :: FilePath -> Property
+buildDepIn dir = go `requires` installed ["devscripts"]
+ where
+ go = cmdProperty' "sh" ["-c", "cd '" ++ dir ++ "' && mk-build-deps debian/control --install --remove"]
+ noninteractiveEnv
+
+-- | Package installation may fail becuse the archive has changed.
+-- Run an update in that case and retry. -}
robustly :: Property -> Property
robustly p = Property (propertyDesc p) $ do
r <- ensureProperty p