summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Apt.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Propellor/Property/Apt.hs')
-rw-r--r--src/Propellor/Property/Apt.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Propellor/Property/Apt.hs b/src/Propellor/Property/Apt.hs
index 8539c4a6..ef3387ca 100644
--- a/src/Propellor/Property/Apt.hs
+++ b/src/Propellor/Property/Apt.hs
@@ -272,12 +272,16 @@ pinnedTo'
-> (DebianSuite, PinPriority)
-> RevertableProperty UnixLike UnixLike
pinnedTo' p (suite, pin) =
- "/etc/apt/preferences.d/10propellor.pref" `File.containsBlock`
+ (prefFile `File.hasContent` prefs) <!> File.notPresent prefFile
+ where
+ prefs =
[ "Package: " ++ p
, "Pin: release " ++ suitePin suite
, "Pin-Priority: " ++ show pin
, ""
]
+ prefFile = "/etc/apt/preferences.d/10propellor_"
+ ++ File.configFileName p <.> "pref"
-- TODO should be RevertableProperty Debian Debian