From f9f1158c0c0fc173045ec7bb7fcbacdd76b24ffd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 5 Jul 2017 16:42:57 -0400 Subject: avoid overwriting existing file --- src/Propellor/Property/XFCE.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Propellor/Property/XFCE.hs b/src/Propellor/Property/XFCE.hs index e3dd060e..a1b9d7d7 100644 --- a/src/Propellor/Property/XFCE.hs +++ b/src/Propellor/Property/XFCE.hs @@ -26,13 +26,15 @@ defaultPanelFor u@(User username) = property' desc $ \w -> do ensureProperty w (go home) where desc = "default XFCE panel for " ++ username - cf = ".config" "xfce4" "xfconf" + basecf = ".config" "xfce4" "xfconf" "xfce-perchannel-xml" "xfce4-panel.xml" -- This location is probably Debian-specific. defcf = "/etc/xdg/xfce4/panel/default.xml" go :: FilePath -> Property DebianLike - go home = tightenTargets $ - (home cf) `File.isCopyOf` defcf - `before` File.applyPath home cf + go home = tightenTargets $ check (not <$> doesFileExist cf) $ + cf `File.isCopyOf` defcf + `before` File.applyPath home basecf (\f -> File.ownerGroup f u (userGroup u)) `requires` Apt.installed ["xfce4-panel"] + where + cf = home basecf -- cgit v1.2.3