propellor spin

This commit is contained in:
Joey Hess 2014-04-02 20:26:38 -04:00
parent a552434370
commit 73fcd794e4
Failed to extract signature
2 changed files with 19 additions and 7 deletions

View File

@ -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

View File

@ -17,8 +17,7 @@ builder arch crontimes rsyncupload = combineProperties "gitannexbuilder"
[ Apt.stdSourcesList Unstable
, Apt.buildDep ["git-annex"]
, Apt.installed ["git", "rsync", "moreutils", "ca-certificates",
"liblockfile-simple-perl", "cabal-install", "vim", "less",
"libghc-fdo-notify-dev"]
"liblockfile-simple-perl", "cabal-install", "vim", "less"]
, serviceRunning "cron" `requires` Apt.installed ["cron"]
, User.accountFor builduser
, check (lacksdir builddir) $ userScriptProperty builduser
@ -31,6 +30,9 @@ builder arch crontimes rsyncupload = combineProperties "gitannexbuilder"
[ "cd " ++ builddir
, "git clone git://git-annex.branchable.com/ build"
]
, Property "git-annex source build deps installed" $ do
d <- homedir
ensureProperty $ Apt.buildDepIn (d </> builddir </> "build")
, Cron.niceJob "gitannexbuilder" crontimes builduser ("~/" ++ builddir) "git pull ; ./autobuild"
-- The builduser account does not have a password set,
-- instead use the password privdata to hold the rsync server