summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFĂ©lix Sipma2015-11-20 15:18:15 +0100
committerJoey Hess2015-11-20 11:06:39 -0400
commit12c0dccd1952ed115f576a1d5616394ec981c13c (patch)
tree5fe49fd7d1f75fccf13c897f392cdc4a1cf146a8 /src
parent1d38d3d3a17ac0c89d172291e879b91f32f2d9e1 (diff)
DebianMirror: add a [RsyncExtra] argument
(cherry picked from commit baff70140cbf3f6113439335b96f3016f261a6a0)
Diffstat (limited to 'src')
-rw-r--r--src/Propellor/Property/DebianMirror.hs18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/Propellor/Property/DebianMirror.hs b/src/Propellor/Property/DebianMirror.hs
index bdcade96..9c80050b 100644
--- a/src/Propellor/Property/DebianMirror.hs
+++ b/src/Propellor/Property/DebianMirror.hs
@@ -27,8 +27,17 @@ showPriority Standard = "standard"
showPriority Optional = "optional"
showPriority Extra = "extra"
-mirror :: HostName -> FilePath -> [DebianSuite] -> [Architecture] -> [Apt.Section] -> Bool -> [DebianPriority] -> Cron.Times -> Property NoInfo
-mirror hn dir suites archs sections source priorities crontimes = propertyList
+data RsyncExtra = Doc | Indices | Tools | Trace
+ deriving (Show, Eq)
+
+showRsyncExtra :: RsyncExtra -> String
+showRsyncExtra Doc = "doc"
+showRsyncExtra Indices = "indices"
+showRsyncExtra Tools = "tools"
+showRsyncExtra Trace = "trace"
+
+mirror :: HostName -> FilePath -> [DebianSuite] -> [Architecture] -> [Apt.Section] -> Bool -> [DebianPriority] -> [RsyncExtra] -> Cron.Times -> Property NoInfo
+mirror hn dir suites archs sections source priorities rsyncextras crontimes = propertyList
("Debian mirror " ++ dir)
[ Apt.installed ["debmirror"]
, User.accountFor (User "debmirror")
@@ -44,6 +53,8 @@ mirror hn dir suites archs sections source priorities crontimes = propertyList
architecturearg = intercalate ","
suitearg = intercalate "," $ map Apt.showSuite suites
priorityRegex pp = "(" ++ intercalate "|" (map showPriority pp) ++ ")"
+ rsyncextraarg [] = "none"
+ rsyncextraarg res = intercalate "," $ map showRsyncExtra res
args =
[ "--dist" , suitearg
, "--arch", architecturearg archs
@@ -55,9 +66,10 @@ mirror hn dir suites archs sections source priorities crontimes = propertyList
++
[ "--host", hn
, "--method", "http"
+ , "--rsync-extra", rsyncextraarg rsyncextras
, "--keyring", "/usr/share/keyrings/debian-archive-keyring.gpg"
, dir
]
-mirrorCdn :: FilePath -> [DebianSuite] -> [Architecture] -> [Apt.Section] -> Bool -> [DebianPriority] -> Cron.Times -> Property NoInfo
+mirrorCdn :: FilePath -> [DebianSuite] -> [Architecture] -> [Apt.Section] -> Bool -> [DebianPriority] -> [RsyncExtra] -> Cron.Times -> Property NoInfo
mirrorCdn = mirror "httpredir.debian.org"