packages feed

wolf 0.2.8.1 → 0.2.8.2

raw patch · 3 files changed

+32/−12 lines, 3 files

Files

main/Act2.hs view
@@ -25,13 +25,15 @@   { aConfig      :: FilePath   , aQueue       :: Queue   , aCommandLine :: Text+  , aGzipless    :: Bool   } deriving ( Eq, Read, Show )  args :: Parser Args args = Args              <$>   configFile             <*>   (pack <$> queue)       <*>-  (pack <$> commandLine)+  (pack <$> commandLine) <*>+  gzipless  parser :: ParserInfo Args parser =@@ -54,8 +56,8 @@ handler :: MonadBaseControl IO m => m () -> m (Maybe SomeException) handler a = handle (return . Just) $ a >> return Nothing -exec :: MonadIO m => Text -> Uid -> Metadata -> [Blob] -> m (Metadata, [Artifact], Maybe SomeException)-exec cmdline uid metadata blobs =+exec :: MonadIO m => Args -> Text -> Uid -> Metadata -> [Blob] -> m (Metadata, [Artifact], Maybe SomeException)+exec Args{..} cmdline uid metadata blobs =   shelly $ withDir $ \dir dataDir storeDir -> do     control $ dataDir </> pack "control.json"     storeInput $ storeDir </> pack "input"@@ -74,15 +76,26 @@       control file =         writefile file $ encodeText $ Control uid       writeArtifact file blob =-        writeBinary (dropExtension file) $ BL.toStrict $ decompress blob+        if aGzipless then+          writeBinary file $ BL.toStrict blob+        else+          writeBinary (dropExtension file) $ BL.toStrict $ decompress blob       readArtifact dir file = do         key <- relativeTo dir file-        blob <- BL.toStrict . compress . BL.fromStrict <$> readBinary file-        return ( toTextIgnore (key <.> "gz")-               , hash blob-               , fromIntegral $ length blob-               , BL.fromStrict blob-               )+        if aGzipless then do+          blob <- readBinary file+          return ( toTextIgnore key+                 , hash blob+                 , fromIntegral $ length blob+                 , BL.fromStrict blob+                 )+        else do+          blob <- BL.toStrict . compress . BL.fromStrict <$> readBinary file+          return ( toTextIgnore (key <.> "gz")+                 , hash blob+                 , fromIntegral $ length blob+                 , BL.fromStrict blob+                 )       dataInput file =         maybe (return ()) (writefile file) metadata       dataOutput file =@@ -110,7 +123,7 @@   config <- decodeFile aConfig >>= maybeThrow (userError "Bad Config")   env <- flowEnv config   forever $ runResourceT $ runFlowT env $-    act aQueue $ exec aCommandLine+    act aQueue $ exec Args{..} aCommandLine  main :: IO () main = execParser parser >>= call
main/Options.hs view
@@ -6,6 +6,7 @@   , queue   , containerless   , gzip+  , gzipless   , commandLine   ) where @@ -64,6 +65,12 @@   switch     $  long "gzip"     <> help "GZIP contents of artifacts"++gzipless :: Parser Bool+gzipless =+  switch+    $  long "gzipless"+    <> help "disable GZIP contents of artifacts"  commandLine :: Parser String commandLine =
wolf.cabal view
@@ -1,5 +1,5 @@ name:                wolf-version:             0.2.8.1+version:             0.2.8.2 synopsis:            Amazon Simple Workflow Service Wrapper. homepage:            https://github.com/swift-nav/wolf license:             MIT