From 6e2a332bcd2dfb720e699fb12ff90e499d419673 Mon Sep 17 00:00:00 2001 From: Keagan McClelland Date: Tue, 2 Mar 2021 16:19:17 -0700 Subject: [PATCH] adds sync for libavahi-client3 --- agent/src/Lib/Synchronizers.hs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/agent/src/Lib/Synchronizers.hs b/agent/src/Lib/Synchronizers.hs index d00ea7de0..7bfdeb3b4 100644 --- a/agent/src/Lib/Synchronizers.hs +++ b/agent/src/Lib/Synchronizers.hs @@ -241,6 +241,19 @@ syncInstallExfatUtils = SyncOp "Install exfat-utils" check migrate False shell "apt-get update" shell "apt-get install -y exfat-utils" +syncInstallLibAvahi :: SyncOp +syncInstallLibAvahi = SyncOp "Install libavahi-client" check migrate False + where + check = + liftIO + $ (run (shell [i|dpkg -l|] $| shell [i|grep libavahi-client3|] $| conduit await) $> False) + `catch` \(e :: ProcessException) -> case e of + ProcessException _ (ExitFailure 1) -> pure True + _ -> throwIO e + migrate = liftIO . run $ do + shell "apt-get update" + shell "apt-get install -y libavahi-client3" + syncWriteConf :: Text -> ByteString -> SystemPath -> SyncOp syncWriteConf name contents' confLocation = SyncOp [i|Write #{name} Conf|] check migrate False where