summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Rsync.hs
diff options
context:
space:
mode:
authorJoey Hess2017-02-15 15:22:13 -0400
committerJoey Hess2017-02-15 15:22:13 -0400
commit4f29d576115d1bcbed60eacb3642523f1b5f480f (patch)
treecb4b5ada932bbdea7c4ee97008fc871cd810b543 /src/Propellor/Property/Rsync.hs
parent6e3192f0d2e063f07d7a5d2b96648e9167cc576a (diff)
parentb29bab35747e6345a4818e5a77c53d029562e3c3 (diff)
Merge branch 'master' into joeyconfig
Diffstat (limited to 'src/Propellor/Property/Rsync.hs')
-rw-r--r--src/Propellor/Property/Rsync.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Propellor/Property/Rsync.hs b/src/Propellor/Property/Rsync.hs
index b40396de..53baa74e 100644
--- a/src/Propellor/Property/Rsync.hs
+++ b/src/Propellor/Property/Rsync.hs
@@ -2,6 +2,7 @@ module Propellor.Property.Rsync where
import Propellor.Base
import qualified Propellor.Property.Apt as Apt
+import qualified Propellor.Property.Pacman as Pacman
type Src = FilePath
type Dest = FilePath
@@ -16,7 +17,7 @@ filesUnder d = Pattern (d ++ "/*")
-- | Ensures that the Dest directory exists and has identical contents as
-- the Src directory.
-syncDir :: Src -> Dest -> Property DebianLike
+syncDir :: Src -> Dest -> Property (DebianLike + ArchLinux)
syncDir = syncDirFiltered []
data Filter
@@ -43,7 +44,7 @@ newtype Pattern = Pattern String
-- Rsync checks each name to be transferred against its list of Filter
-- rules, and the first matching one is acted on. If no matching rule
-- is found, the file is processed.
-syncDirFiltered :: [Filter] -> Src -> Dest -> Property DebianLike
+syncDirFiltered :: [Filter] -> Src -> Dest -> Property (DebianLike + ArchLinux)
syncDirFiltered filters src dest = rsync $
[ "-av"
-- Add trailing '/' to get rsync to sync the Dest directory,
@@ -56,7 +57,7 @@ syncDirFiltered filters src dest = rsync $
, "--quiet"
] ++ map toRsync filters
-rsync :: [String] -> Property DebianLike
+rsync :: [String] -> Property (DebianLike + ArchLinux)
rsync ps = cmdProperty "rsync" ps
`assume` MadeChange
- `requires` Apt.installed ["rsync"]
+ `requires` Apt.installed ["rsync"] `pickOS` Pacman.installed ["rsync"]