From ccf2d4f42688197bf631f9fcca80fbd49d951a0c Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 17 May 2016 11:37:48 -0700 Subject: tidy up utility fns --- src/Propellor/Property/Sbuild.hs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/Propellor/Property/Sbuild.hs b/src/Propellor/Property/Sbuild.hs index 48499ca5..f9b766a1 100644 --- a/src/Propellor/Property/Sbuild.hs +++ b/src/Propellor/Property/Sbuild.hs @@ -47,6 +47,8 @@ module Propellor.Property.Sbuild ( updated, updatedFor, -- * Global sbuild configuration + installed, + keypairGenerated, shareAptCache, usableBy, ) where @@ -171,13 +173,20 @@ keypairGenerated = cmdProperty "sbuild-update" ["--keygen"] `assume` MadeChange secKeyFile = "/var/lib/sbuild/apt-keys/sbuild-key.sec" +-- ==== utility function ==== -schrootLoc :: Suite -> Architecture -> FilePath -schrootLoc s a = "/srv/chroot" s ++ "-" ++ a - -schrootConfLoc :: Suite -> Architecture -> FilePath -schrootConfLoc s a = "/etc/schroot/chroot.d" s ++ "-" ++ a ++ "-sbuild-propellor" +schrootFromSystem :: System -> Maybe SbuildSchroot +schrootFromSystem system@(System _ arch) = + extractSuite system + >>= \suite -> return $ SbuildSchroot suite arch stdMirror :: System -> Apt.Url stdMirror (System (Debian s) _) = "http://httpredir.debian.org/debian" stdMirror (System (Buntish r) _) = "TODO" + +schrootRoot :: SbuildSchroot -> FilePath +schrootRoot (SbuildSchroot s a) = "/srv/chroot" s ++ "-" ++ a + +schrootConf :: SbuildSchroot -> FilePath +schrootConf (SbuildSchroot s a) = + "/etc/schroot/chroot.d" s ++ "-" ++ a ++ "-sbuild-propellor" -- cgit v1.3-2-g0d8e