Hello community, here is the log from the commit of package ghc-shelly for openSUSE:Factory checked in at 2016-07-01 09:58:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-shelly (Old) and /work/SRC/openSUSE:Factory/.ghc-shelly.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "ghc-shelly" Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-shelly/ghc-shelly.changes 2016-04-30 23:30:35.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-shelly.new/ghc-shelly.changes 2016-07-01 09:58:48.000000000 +0200 @@ -1,0 +2,13 @@ +Mon Jun 27 09:32:04 UTC 2016 - mimi.vx@gmail.com + +- update to 1.6.7 +* flush stdout when using echo, not just echo_n +* fix should be able to silence stderr when using runHandle +* expose RunFailed + +------------------------------------------------------------------- +Tue May 31 05:11:32 UTC 2016 - mimi.vx@gmail.com + +- relax dep on time, fixes build with GHC-8 + +------------------------------------------------------------------- Old: ---- shelly-1.6.6.tar.gz New: ---- shelly-1.6.7.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-shelly.spec ++++++ --- /var/tmp/diff_new_pack.14CVPD/_old 2016-07-01 09:58:49.000000000 +0200 +++ /var/tmp/diff_new_pack.14CVPD/_new 2016-07-01 09:58:49.000000000 +0200 @@ -21,7 +21,7 @@ %bcond_with tests Name: ghc-shelly -Version: 1.6.6 +Version: 1.6.7 Release: 0 Summary: Shell-like (systems) programming in Haskell License: BSD-3-Clause @@ -93,6 +93,7 @@ %prep %setup -q -n %{pkg_name}-%{version} +cabal-tweak-dep-ver time '< 1.6' '< 1.7' %build %ghc_lib_build ++++++ shelly-1.6.6.tar.gz -> shelly-1.6.7.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/shelly-1.6.6/ChangeLog.md new/shelly-1.6.7/ChangeLog.md --- old/shelly-1.6.6/ChangeLog.md 2016-04-21 18:31:23.000000000 +0200 +++ new/shelly-1.6.7/ChangeLog.md 2016-06-24 23:28:40.000000000 +0200 @@ -1,3 +1,9 @@ +# 1.6.7 + +* flush stdout when using `echo`, not just `echo_n` +* fix should be able to silence stderr when using `runHandle` +* expose RunFailed + # 1.6.6 * add prependToPath function diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/shelly-1.6.6/README.md new/shelly-1.6.7/README.md --- old/shelly-1.6.6/README.md 2015-12-01 15:04:18.000000000 +0100 +++ new/shelly-1.6.7/README.md 2016-06-24 22:54:08.000000000 +0200 @@ -97,6 +97,7 @@ Of course, the development machine may need to be exactly the same OS as the server. I recommend using the boilerplate at the top of this example in your projects. +This includes setting line buffering if you are dealing with text and not binary data. ~~~~~ {.haskell} {-# LANGUAGE OverloadedStrings #-} @@ -106,16 +107,18 @@ import Data.Text as T default (T.Text) - main = shelly $ verbosely $ do - host <- run "uname" ["-n"] - if T.stripEnd host === "local-machine" - then do d <- cmd "date" - c <- escaping False $ cmd "git" "log -1 | head -1 | awk '{print $2}'" - appendfile "log/deploy.log" $ T.intercalate " - " [T.stripEnd d, c] - uploads "my-server:/remote/path/" ["deploy"] - sshPairs_ "my-server" [("cd", ["/remote/path"]), ("./deploy", [])] - else do - cmd "./script/angel" + main = do + hSetBuffering stdout LineBuffering + shelly $ verbosely $ do + host <- run "uname" ["-n"] + if T.stripEnd host === "local-machine" + then do d <- cmd "date" + c <- escaping False $ cmd "git" "log -1 | head -1 | awk '{print $2}'" + appendfile "log/deploy.log" $ T.intercalate " - " [T.stripEnd d, c] + uploads "my-server:/remote/path/" ["deploy"] + sshPairs_ "my-server" [("cd", ["/remote/path"]), ("./deploy", [])] + else do + cmd "./script/angel" -- same path on remote host -- will create directories diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/shelly-1.6.6/shelly.cabal new/shelly-1.6.7/shelly.cabal --- old/shelly-1.6.6/shelly.cabal 2016-04-21 18:30:42.000000000 +0200 +++ new/shelly-1.6.7/shelly.cabal 2016-06-24 23:28:44.000000000 +0200 @@ -1,6 +1,6 @@ Name: shelly -Version: 1.6.6 +Version: 1.6.7 Synopsis: shell-like (systems) programming in Haskell Description: Shelly provides convenient systems programming in Haskell, @@ -48,7 +48,7 @@ Build-depends: containers >= 0.4.2.0, - time >= 1.3 && < 1.6, + time >= 1.3 && < 1.7, directory >= 1.1.0.0 && < 1.3.0.0, mtl >= 2, process >= 1.0, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/shelly-1.6.6/src/Shelly/Base.hs new/shelly-1.6.7/src/Shelly/Base.hs --- old/shelly-1.6.6/src/Shelly/Base.hs 2015-09-10 19:37:45.000000000 +0200 +++ new/shelly-1.6.7/src/Shelly/Base.hs 2016-06-24 22:50:17.000000000 +0200 @@ -105,7 +105,7 @@ runSh = runReaderT . unSh data ReadOnlyState = ReadOnlyState { rosFailToDir :: Bool } -data State = State +data State = State { sCode :: Int -- ^ exit code for command that ran , sStdin :: Maybe Text -- ^ stdin for the command to be run , sStderr :: Text -- ^ stderr for command that ran @@ -256,12 +256,12 @@ get :: Sh State get = do - stateVar <- ask + stateVar <- ask liftIO (readIORef stateVar) modify :: (State -> State) -> Sh () modify f = do - state <- ask + state <- ask liftIO (modifyIORef state f) -- | internally log what occurred. @@ -311,13 +311,13 @@ -- | Echo text to standard (error, when using _err variants) output. The _n -- variants do not print a final newline. echo, echo_n, echo_err, echo_n_err :: Text -> Sh () -echo = traceLiftIO TIO.putStrLn -echo_n = traceLiftIO $ (>> hFlush stdout) . TIO.putStr -echo_err = traceLiftIO $ TIO.hPutStrLn stderr -echo_n_err = traceLiftIO $ (>> hFlush stderr) . TIO.hPutStr stderr +echo msg = traceEcho msg >> liftIO (TIO.putStrLn msg >> hFlush stdout) +echo_n msg = traceEcho msg >> liftIO (TIO.putStr msg >> hFlush stdout) +echo_err msg = traceEcho msg >> liftIO (TIO.hPutStrLn stderr msg >> hFlush stdout) +echo_n_err msg = traceEcho msg >> liftIO (TIO.hPutStr stderr msg >> hFlush stderr) -traceLiftIO :: (Text -> IO ()) -> Text -> Sh () -traceLiftIO f msg = trace ("echo " `mappend` "'" `mappend` msg `mappend` "'") >> liftIO (f msg) +traceEcho :: Text -> Sh () +traceEcho msg = trace ("echo " `mappend` "'" `mappend` msg `mappend` "'") -- | A helper to catch any exception (same as -- @... `catch` \(e :: SomeException) -> ...@). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/shelly-1.6.6/src/Shelly.hs new/shelly-1.6.7/src/Shelly.hs --- old/shelly-1.6.6/src/Shelly.hs 2016-04-21 18:29:13.000000000 +0200 +++ new/shelly-1.6.7/src/Shelly.hs 2016-06-24 23:22:47.000000000 +0200 @@ -73,6 +73,7 @@ -- * Exceptions , bracket_sh, catchany, catch_sh, handle_sh, handleany_sh, finally_sh, ShellyHandler(..), catches_sh, catchany_sh , ReThrownException(..) + , RunFailed(..) -- * convert between Text and FilePath , toTextIgnore, toTextWarn, FP.fromText @@ -1143,10 +1144,10 @@ runWithColor_ = runHandles exe args [OutHandle Inherit] $ \inH _ errH -> do state <- get - errVar <- liftIO $ do + errs <- liftIO $ do hClose inH -- setStdin was taken care of before the process even ran - (putHandleIntoMVar mempty (|>) errH (sPutStderr state) (sPrintStderr state)) - errs <- liftIO $ lineSeqToText `fmap` wait errVar + errVar <- (putHandleIntoMVar mempty (|>) errH (sPutStderr state) (sPrintStderr state)) + lineSeqToText `fmap` wait errVar modify $ \state' -> state' { sStderr = errs } return () @@ -1160,11 +1161,11 @@ -> (Handle -> Sh a) -- ^ stdout handle -> Sh a runHandle exe args withHandle = runHandles exe args [] $ \_ outH errH -> do - putStderr <- gets sPutStderr - errPromise <- liftIO $ async $ transferLinesAndCombine errH putStderr + state <- get + errVar <- liftIO $ + (putHandleIntoMVar mempty (|>) errH (sPutStderr state) (sPrintStderr state)) res <- withHandle outH - errs <- liftIO $ wait errPromise - + errs <- liftIO $ lineSeqToText `fmap` wait errVar modify $ \state' -> state' { sStderr = errs } return res