From 2220efc954a49a156942b3566350980ed483a64f Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 31 Jan 2017 20:27:23 -0700 Subject: pass a tuple to Apt.pinnedTo This permits calling Apt.pinnedTo infix --- src/Propellor/Property/Apt.hs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Propellor/Property/Apt.hs b/src/Propellor/Property/Apt.hs index d1958412..314cfef1 100644 --- a/src/Propellor/Property/Apt.hs +++ b/src/Propellor/Property/Apt.hs @@ -258,21 +258,19 @@ buildDepIn dir = cmdPropertyEnv "sh" ["-c", cmd] noninteractiveEnv -- -- For example, to obtain all Emacs Lisp addon packages from sid, you could use -- --- > & Apt.suiteAvailablePinned Unstable --- > & ["elpa-*"] `Apt.pinnedTo` Unstable 990 +-- > & Apt.suiteAvailablePinned Unstable (-10) +-- > & ["elpa-*"] `Apt.pinnedTo` (Unstable, 990) pinnedTo :: [String] - -> DebianSuite - -> PinPriority + -> (DebianSuite, PinPriority) -> RevertableProperty UnixLike UnixLike -pinnedTo ps suite pin = (\p -> pinnedTo' p suite pin) `applyToList` ps +pinnedTo ps (suite, pin) = (\p -> pinnedTo' p (suite, pin)) `applyToList` ps pinnedTo' :: String - -> DebianSuite - -> PinPriority + -> (DebianSuite, PinPriority) -> RevertableProperty UnixLike UnixLike -pinnedTo' p suite pin = +pinnedTo' p (suite, pin) = "/etc/apt/preferences.d/10propellor" `File.containsBlock` [ "Package: " ++ p , "Pin: release " ++ suitePin suite -- cgit v1.2.3