Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ghc-turtle for openSUSE:Factory checked in at 2021-04-10 15:27:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-turtle (Old) and /work/SRC/openSUSE:Factory/.ghc-turtle.new.2401 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-turtle" Sat Apr 10 15:27:22 2021 rev:16 rq:883527 version:1.5.22 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-turtle/ghc-turtle.changes 2021-03-28 11:58:05.512315840 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-turtle.new.2401/ghc-turtle.changes 2021-04-10 15:28:26.962454123 +0200 @@ -1,0 +2,9 @@ +Mon Apr 5 14:15:06 UTC 2021 - [email protected] + +- Update turtle to version 1.5.22. + 1.5.22 + + * Add new `update` utility + * Improve documentation for `limit` + +------------------------------------------------------------------- Old: ---- turtle-1.5.21.tar.gz turtle.cabal New: ---- turtle-1.5.22.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-turtle.spec ++++++ --- /var/tmp/diff_new_pack.xmaW33/_old 2021-04-10 15:28:27.602454875 +0200 +++ /var/tmp/diff_new_pack.xmaW33/_new 2021-04-10 15:28:27.606454879 +0200 @@ -19,13 +19,12 @@ %global pkg_name turtle %bcond_with tests Name: ghc-%{pkg_name} -Version: 1.5.21 +Version: 1.5.22 Release: 0 Summary: Shell programming, Haskell-style License: BSD-3-Clause URL: https://hackage.haskell.org/package/%{pkg_name} Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz -Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal#/%{pkg_name}.cabal BuildRequires: ghc-Cabal-devel BuildRequires: ghc-ansi-wl-pprint-devel BuildRequires: ghc-async-devel @@ -98,7 +97,6 @@ %prep %autosetup -n %{pkg_name}-%{version} -cp -p %{SOURCE1} %{pkg_name}.cabal %build %ghc_lib_build ++++++ turtle-1.5.21.tar.gz -> turtle-1.5.22.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/turtle-1.5.21/CHANGELOG.md new/turtle-1.5.22/CHANGELOG.md --- old/turtle-1.5.21/CHANGELOG.md 2020-08-15 07:54:22.000000000 +0200 +++ new/turtle-1.5.22/CHANGELOG.md 2021-04-01 23:53:16.000000000 +0200 @@ -1,3 +1,8 @@ +1.5.22 + +* Add new `update` utility +* Improve documentation for `limit` + 1.5.21 * Build against `optparse-applicative-0.16.0.0` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/turtle-1.5.21/src/Turtle/Prelude.hs new/turtle-1.5.22/src/Turtle/Prelude.hs --- old/turtle-1.5.21/src/Turtle/Prelude.hs 2020-08-15 07:54:22.000000000 +0200 +++ new/turtle-1.5.22/src/Turtle/Prelude.hs 2021-04-01 23:53:16.000000000 +0200 @@ -191,6 +191,7 @@ , inplacePrefix , inplaceSuffix , inplaceEntire + , update , find , findtree , yes @@ -1696,32 +1697,36 @@ -- | Like `sed`, but operates in place on a `FilePath` (analogous to @sed -i@) inplace :: MonadIO io => Pattern Text -> FilePath -> io () -inplace = inplaceWith sed +inplace = update . sed -- | Like `sedPrefix`, but operates in place on a `FilePath` inplacePrefix :: MonadIO io => Pattern Text -> FilePath -> io () -inplacePrefix = inplaceWith sedPrefix +inplacePrefix = update . sedPrefix -- | Like `sedSuffix`, but operates in place on a `FilePath` inplaceSuffix :: MonadIO io => Pattern Text -> FilePath -> io () -inplaceSuffix = inplaceWith sedSuffix +inplaceSuffix = update . sedSuffix -- | Like `sedEntire`, but operates in place on a `FilePath` inplaceEntire :: MonadIO io => Pattern Text -> FilePath -> io () -inplaceEntire = inplaceWith sedEntire +inplaceEntire = update . sedEntire + +{-| Update a file in place using a `Shell` transformation + + For example, this is used to implement the @inplace*@ family of utilities +-} +update :: MonadIO io => (Shell Line -> Shell Line) -> FilePath -> io () +update f file = liftIO (runManaged (do + here <- pwd -inplaceWith - :: MonadIO io - => (Pattern Text -> Shell Line -> Shell Line) - -> Pattern Text - -> FilePath - -> io () -inplaceWith sed_ pattern' file = liftIO (runManaged (do - here <- pwd (tmpfile, handle) <- mktemp here "turtle" - outhandle handle (sed_ pattern' (input file)) + + outhandle handle (f (input file)) + liftIO (hClose handle) + copymod file tmpfile + mv tmpfile file )) -- | Search a directory recursively for all files matching the given `Pattern` @@ -1854,7 +1859,11 @@ loop $! x' loop $! begin ) --- | Limit a `Shell` to a fixed number of values +{-| Limit a `Shell` to a fixed number of values + + NOTE: This is not lazy and will still consume the entire input stream. + There is no way to implement a lazy version of this utility. +-} limit :: Int -> Shell a -> Shell a limit n s = Shell (\(FoldShell step begin done) -> do ref <- newIORef 0 -- I feel so dirty diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/turtle-1.5.21/turtle.cabal new/turtle-1.5.22/turtle.cabal --- old/turtle-1.5.21/turtle.cabal 2020-08-15 07:54:22.000000000 +0200 +++ new/turtle-1.5.22/turtle.cabal 2021-04-01 23:53:16.000000000 +0200 @@ -1,5 +1,5 @@ Name: turtle -Version: 1.5.21 +Version: 1.5.22 Cabal-Version: >=1.10 Build-Type: Simple License: BSD3 @@ -101,7 +101,7 @@ Default-Language: Haskell2010 Build-Depends: base >= 4 && < 5 , - doctest >= 0.7 && < 0.18 + doctest >= 0.7 && < 0.19 test-suite regression-broken-pipe Type: exitcode-stdio-1.0
