summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Rsync.hs
diff options
context:
space:
mode:
authorZihao Wang2017-02-03 17:37:10 +0800
committerZihao Wang2017-02-04 08:22:06 +0800
commit0b936d63931baa9cda6b243cf643ad1c71ce5c0b (patch)
tree3a8a81eb551159feaeff449e23ad723ff4192ee3 /src/Propellor/Property/Rsync.hs
parent92168164943dcf033682b9f9a26f81beb3c537f4 (diff)
extend Rsync to support ArchLinux
Signed-off-by: Zihao Wang <dev@wzhd.org>
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"]