Hello community, here is the log from the commit of package ghc-stache for openSUSE:Factory checked in at 2017-05-10 20:49:49 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-stache (Old) and /work/SRC/openSUSE:Factory/.ghc-stache.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-stache" Wed May 10 20:49:49 2017 rev:2 rq:491511 version:0.2.2 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-stache/ghc-stache.changes 2017-04-12 18:09:07.962054902 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-stache.new/ghc-stache.changes 2017-05-10 20:49:50.404583010 +0200 @@ -1,0 +2,15 @@ +Wed Apr 19 13:20:24 UTC 2017 - [email protected] + +- Update to version 0.2.2 revision 1 with cabal2obs. + +------------------------------------------------------------------- +Mon Mar 27 12:40:23 UTC 2017 - [email protected] + +- Update to version 0.2.2 with cabal2obs. + +------------------------------------------------------------------- +Tue Mar 14 09:26:07 UTC 2017 - [email protected] + +- Update to version 0.2.1 with cabal2obs. + +------------------------------------------------------------------- Old: ---- stache-0.2.0.tar.gz New: ---- stache-0.2.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-stache.spec ++++++ --- /var/tmp/diff_new_pack.gI5Zkp/_old 2017-05-10 20:49:52.044351625 +0200 +++ /var/tmp/diff_new_pack.gI5Zkp/_new 2017-05-10 20:49:52.048351061 +0200 @@ -19,14 +19,14 @@ %global pkg_name stache %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.2.0 +Version: 0.2.2 Release: 0 Summary: Mustache templates for Haskell License: BSD-3-Clause Group: Development/Languages/Other 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/2.cabal#/%{pkg_name}.cabal +Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal#/%{pkg_name}.cabal BuildRequires: ghc-Cabal-devel BuildRequires: ghc-aeson-devel BuildRequires: ghc-bytestring-devel ++++++ stache-0.2.0.tar.gz -> stache-0.2.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stache-0.2.0/CHANGELOG.md new/stache-0.2.2/CHANGELOG.md --- old/stache-0.2.0/CHANGELOG.md 2016-12-09 16:53:03.000000000 +0100 +++ new/stache-0.2.2/CHANGELOG.md 2017-03-18 20:20:57.000000000 +0100 @@ -1,3 +1,14 @@ +## Stache 0.2.2 + +* Add the `getMustacheFilesInDir` function. + +* Make TH helpers `compileMustacheDir` and `compileMustacheFile` detect + changes in the templates and force recompilation. + +## Stache 0.2.1 + +* Made TH parse errors nicer. + ## Stache 0.2.0 * Breaking change: the `renderMustache` function will throw an exception diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stache-0.2.0/LICENSE.md new/stache-0.2.2/LICENSE.md --- old/stache-0.2.0/LICENSE.md 2016-06-27 17:30:36.000000000 +0200 +++ new/stache-0.2.2/LICENSE.md 2017-01-01 12:48:38.000000000 +0100 @@ -1,4 +1,4 @@ -Copyright © 2016 Stack Builders +Copyright © 2016–2017 Stack Builders All rights reserved. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stache-0.2.0/README.md new/stache-0.2.2/README.md --- old/stache-0.2.0/README.md 2016-10-22 21:00:47.000000000 +0200 +++ new/stache-0.2.2/README.md 2017-01-01 12:48:42.000000000 +0100 @@ -77,6 +77,6 @@ ## License -Copyright © 2016 Stack Builders +Copyright © 2016–2017 Stack Builders Distributed under BSD 3 clause license. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stache-0.2.0/Text/Mustache/Compile/TH.hs new/stache-0.2.2/Text/Mustache/Compile/TH.hs --- old/stache-0.2.0/Text/Mustache/Compile/TH.hs 2016-09-25 01:15:35.000000000 +0200 +++ new/stache-0.2.2/Text/Mustache/Compile/TH.hs 2017-03-18 20:20:57.000000000 +0100 @@ -1,6 +1,6 @@ -- | -- Module : Text.Mustache.Compile.TH --- Copyright : © 2016 Stack Builders +-- Copyright : © 2016–2017 Stack Builders -- License : BSD 3 clause -- -- Maintainer : Mark Karpov <[email protected]> @@ -26,13 +26,14 @@ , mustache ) where +import Control.Exception (Exception(..)) import Control.Monad.Catch (try) import Data.Text.Lazy (Text) import Data.Typeable (cast) import Language.Haskell.TH hiding (Dec) import Language.Haskell.TH.Quote (QuasiQuoter (..)) -import Language.Haskell.TH.Syntax (lift) -import Text.Megaparsec hiding (try) +import Language.Haskell.TH.Syntax (lift, addDependentFile) +import System.Directory import Text.Mustache.Type import qualified Data.Text as T import qualified Data.Text.Lazy as TL @@ -60,7 +61,8 @@ :: PName -- ^ Which template to select after compiling -> FilePath -- ^ Directory with templates -> Q Exp -- ^ The resulting template -compileMustacheDir pname path = +compileMustacheDir pname path = do + runIO (C.getMustacheFilesInDir path) >>= mapM_ addDependentFile (runIO . try) (C.compileMustacheDir pname path) >>= handleEither -- | Compile single Mustache template and select it. @@ -70,7 +72,8 @@ compileMustacheFile :: FilePath -- ^ Location of the file -> Q Exp -compileMustacheFile path = +compileMustacheFile path = do + runIO (makeAbsolute path) >>= addDependentFile (runIO . try) (C.compileMustacheFile path) >>= handleEither -- | Compile Mustache template from 'Text' value. The cache will contain @@ -83,7 +86,8 @@ -> Text -- ^ The template to compile -> Q Exp compileMustacheText pname text = - handleEither (C.compileMustacheText pname text) + (handleEither . either (Left . MustacheParserException) Right) + (C.compileMustacheText pname text) -- | Compile Mustache using QuasiQuoter. Usage: -- @@ -109,11 +113,25 @@ -- | Given an 'Either' result return 'Right' and signal pretty-printed error -- if we have a 'Left'. -handleEither :: Either (ParseError Char Dec) Template -> Q Exp +handleEither :: Either MustacheException Template -> Q Exp handleEither val = case val of - Left err -> fail (parseErrorPretty err) + Left err -> fail . indentNicely $ +#if MIN_VERSION_base(4,8,0) + displayException err +#else + show err +#endif Right template -> dataToExpQ (fmap liftText . cast) template + where + -- NOTE Since the feature requires GHC 8 anyway, we follow indentation + -- style of that version of compiler. This makes it look consistent with + -- other error messages and allows Emacs and similar tools to parse the + -- errors correctly. + indentNicely x' = + case lines x' of + [] -> "" + (x:xs) -> unlines (x : fmap (replicate 8 ' ' ++) xs) -- | Lift strict 'T.Text' to 'Q' 'Exp'. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stache-0.2.0/Text/Mustache/Compile.hs new/stache-0.2.2/Text/Mustache/Compile.hs --- old/stache-0.2.0/Text/Mustache/Compile.hs 2016-12-09 16:53:03.000000000 +0100 +++ new/stache-0.2.2/Text/Mustache/Compile.hs 2017-03-18 20:20:57.000000000 +0100 @@ -1,6 +1,6 @@ -- | -- Module : Text.Mustache.Compile --- Copyright : © 2016 Stack Builders +-- Copyright : © 2016–2017 Stack Builders -- License : BSD 3 clause -- -- Maintainer : Mark Karpov <[email protected]> @@ -15,6 +15,7 @@ module Text.Mustache.Compile ( compileMustacheDir + , getMustacheFilesInDir , compileMustacheFile , compileMustacheText ) where @@ -47,8 +48,7 @@ -> FilePath -- ^ Directory with templates -> m Template -- ^ The resulting template compileMustacheDir pname path = - liftIO (getDirectoryContents path) >>= - filterM isMustacheFile . liftM (F.combine (F.takeDirectory path)) >>= + getMustacheFilesInDir path >>= liftM selectKey . foldM f (Template undefined M.empty) where selectKey t = t { templateActual = pname } @@ -56,6 +56,19 @@ Template _ new <- compileMustacheFile fp return (Template undefined (M.union new old)) +-- | Return a list of templates found in given directory. The returned paths +-- are absolute. +-- +-- @since 0.2.2 + +getMustacheFilesInDir :: MonadIO m + => FilePath -- ^ Directory with templates + -> m [FilePath] +getMustacheFilesInDir path = + liftIO (getDirectoryContents path) >>= + filterM isMustacheFile . fmap (F.combine path) >>= + mapM (liftIO . makeAbsolute) + -- | Compile single Mustache template and select it. -- -- The action can throw the same exceptions as 'T.readFile'. @@ -82,7 +95,7 @@ ---------------------------------------------------------------------------- -- Helpers --- | Check if given 'FilePath' point to a mustache file. +-- | Check if given 'FilePath' points to a mustache file. isMustacheFile :: MonadIO m => FilePath -> m Bool isMustacheFile path = do @@ -94,7 +107,6 @@ pathToPName :: FilePath -> PName pathToPName = PName . T.pack . F.takeBaseName -{-# INLINE pathToPName #-} -- | Throw 'MustacheException' if argument is 'Left' or return the result -- inside 'Right'. @@ -103,4 +115,3 @@ => Either (ParseError Char Dec) Template -- ^ Value to process -> m Template -- ^ The result withException = either (throwM . MustacheParserException) return -{-# INLINE withException #-} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stache-0.2.0/Text/Mustache/Parser.hs new/stache-0.2.2/Text/Mustache/Parser.hs --- old/stache-0.2.0/Text/Mustache/Parser.hs 2016-07-30 17:45:39.000000000 +0200 +++ new/stache-0.2.2/Text/Mustache/Parser.hs 2017-01-01 12:48:24.000000000 +0100 @@ -1,6 +1,6 @@ -- | -- Module : Text.Mustache.Parser --- Copyright : © 2016 Stack Builders +-- Copyright : © 2016–2017 Stack Builders -- License : BSD 3 clause -- -- Maintainer : Mark Karpov <[email protected]> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stache-0.2.0/Text/Mustache/Render.hs new/stache-0.2.2/Text/Mustache/Render.hs --- old/stache-0.2.0/Text/Mustache/Render.hs 2016-12-09 16:53:03.000000000 +0100 +++ new/stache-0.2.2/Text/Mustache/Render.hs 2017-01-01 12:48:27.000000000 +0100 @@ -1,6 +1,6 @@ -- | -- Module : Text.Mustache.Render --- Copyright : © 2016 Stack Builders +-- Copyright : © 2016–2017 Stack Builders -- License : BSD 3 clause -- -- Maintainer : Mark Karpov <[email protected]> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stache-0.2.0/Text/Mustache/Type.hs new/stache-0.2.2/Text/Mustache/Type.hs --- old/stache-0.2.0/Text/Mustache/Type.hs 2016-12-09 16:53:03.000000000 +0100 +++ new/stache-0.2.2/Text/Mustache/Type.hs 2017-01-01 12:48:31.000000000 +0100 @@ -1,6 +1,6 @@ -- | -- Module : Text.Mustache.Type --- Copyright : © 2016 Stack Buliders +-- Copyright : © 2016–2017 Stack Buliders -- License : BSD 3 clause -- -- Maintainer : Mark Karpov <[email protected]> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stache-0.2.0/Text/Mustache.hs new/stache-0.2.2/Text/Mustache.hs --- old/stache-0.2.0/Text/Mustache.hs 2016-10-22 21:00:57.000000000 +0200 +++ new/stache-0.2.2/Text/Mustache.hs 2017-01-01 12:48:05.000000000 +0100 @@ -1,6 +1,6 @@ -- | -- Module : Text.Mustache --- Copyright : © 2016 Stack Builders +-- Copyright : © 2016–2017 Stack Builders -- License : BSD 3 clause -- -- Maintainer : Mark Karpov <[email protected]> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stache-0.2.0/stache.cabal new/stache-0.2.2/stache.cabal --- old/stache-0.2.0/stache.cabal 2016-12-09 16:53:59.000000000 +0100 +++ new/stache-0.2.2/stache.cabal 2017-03-18 20:21:25.000000000 +0100 @@ -1,7 +1,7 @@ -- -- Cabal configuration for ‘stache’ package. -- --- Copyright © 2016 Stack Builders +-- Copyright © 2016–2017 Stack Builders -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are @@ -31,7 +31,7 @@ -- POSSIBILITY OF SUCH DAMAGE. name: stache -version: 0.2.0 +version: 0.2.2 cabal-version: >= 1.10 license: BSD3 license-file: LICENSE.md @@ -59,7 +59,7 @@ default: False library - build-depends: aeson >= 0.11 && < 1.1 + build-depends: aeson >= 0.11 && < 1.2 , base >= 4.7 && < 5.0 , bytestring >= 0.10 && < 0.11 , containers >= 0.5 && < 0.6 @@ -72,7 +72,7 @@ , template-haskell >= 2.10 && < 2.12 , text >= 1.2 && < 1.3 , unordered-containers >= 0.2.5 && < 0.3 - , vector >= 0.11 && < 0.12 + , vector >= 0.11 && < 0.13 if !impl(ghc >= 8.0) build-depends: semigroups == 0.18.* exposed-modules: Text.Mustache @@ -91,13 +91,13 @@ main-is: Spec.hs hs-source-dirs: tests type: exitcode-stdio-1.0 - build-depends: aeson >= 0.11 && < 1.1 + build-depends: aeson >= 0.11 && < 1.2 , base >= 4.7 && < 5.0 , containers >= 0.5 && < 0.6 , hspec >= 2.0 && < 3.0 , hspec-megaparsec >= 0.2 && < 0.4 , megaparsec >= 5.0 && < 6.0 - , stache >= 0.2.0 + , stache >= 0.2.2 , text >= 1.2 && < 1.3 other-modules: Text.Mustache.Compile.THSpec , Text.Mustache.ParserSpec @@ -115,14 +115,14 @@ main-is: Spec.hs hs-source-dirs: mustache-spec type: exitcode-stdio-1.0 - build-depends: aeson >= 0.11 && < 1.1 + build-depends: aeson >= 0.11 && < 1.2 , base >= 4.7 && < 5.0 , bytestring >= 0.10 && < 0.11 , containers >= 0.5 && < 0.6 , file-embed , hspec >= 2.0 && < 3.0 , megaparsec >= 5.0 && < 6.0 - , stache >= 0.2.0 + , stache >= 0.2.2 , text >= 1.2 && < 1.3 , yaml >= 0.8 && < 0.9 if flag(dev) @@ -135,12 +135,12 @@ main-is: Main.hs hs-source-dirs: bench type: exitcode-stdio-1.0 - build-depends: aeson >= 0.11 && < 1.1 + build-depends: aeson >= 0.11 && < 1.2 , base >= 4.7 && < 5.0 , criterion >= 0.6.2.1 && < 1.2 , deepseq >= 1.4 && < 1.5 , megaparsec >= 5.0 && < 6.0 - , stache >= 0.2.0 + , stache >= 0.2.2 , text >= 1.2 && < 1.3 if flag(dev) ghc-options: -O2 -Wall -Werror ++++++ stache.cabal ++++++ --- /var/tmp/diff_new_pack.gI5Zkp/_old 2017-05-10 20:49:52.212327922 +0200 +++ /var/tmp/diff_new_pack.gI5Zkp/_new 2017-05-10 20:49:52.212327922 +0200 @@ -1,7 +1,7 @@ -- -- Cabal configuration for ‘stache’ package. -- --- Copyright © 2016 Stack Builders +-- Copyright © 2016–2017 Stack Builders -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are @@ -31,8 +31,8 @@ -- POSSIBILITY OF SUCH DAMAGE. name: stache -version: 0.2.0 -x-revision: 2 +version: 0.2.2 +x-revision: 1 cabal-version: >= 1.10 license: BSD3 license-file: LICENSE.md @@ -60,7 +60,7 @@ default: False library - build-depends: aeson >= 0.11 && < 1.2 + build-depends: aeson >= 0.11 && < 1.3 , base >= 4.7 && < 5.0 , bytestring >= 0.10 && < 0.11 , containers >= 0.5 && < 0.6 @@ -92,13 +92,13 @@ main-is: Spec.hs hs-source-dirs: tests type: exitcode-stdio-1.0 - build-depends: aeson >= 0.11 && < 1.2 + build-depends: aeson >= 0.11 && < 1.3 , base >= 4.7 && < 5.0 , containers >= 0.5 && < 0.6 , hspec >= 2.0 && < 3.0 , hspec-megaparsec >= 0.2 && < 0.4 , megaparsec >= 5.0 && < 6.0 - , stache >= 0.2.0 + , stache >= 0.2.2 , text >= 1.2 && < 1.3 other-modules: Text.Mustache.Compile.THSpec , Text.Mustache.ParserSpec @@ -116,14 +116,14 @@ main-is: Spec.hs hs-source-dirs: mustache-spec type: exitcode-stdio-1.0 - build-depends: aeson >= 0.11 && < 1.2 + build-depends: aeson >= 0.11 && < 1.3 , base >= 4.7 && < 5.0 , bytestring >= 0.10 && < 0.11 , containers >= 0.5 && < 0.6 , file-embed , hspec >= 2.0 && < 3.0 , megaparsec >= 5.0 && < 6.0 - , stache >= 0.2.0 + , stache >= 0.2.2 , text >= 1.2 && < 1.3 , yaml >= 0.8 && < 0.9 if flag(dev) @@ -136,12 +136,12 @@ main-is: Main.hs hs-source-dirs: bench type: exitcode-stdio-1.0 - build-depends: aeson >= 0.11 && < 1.2 + build-depends: aeson >= 0.11 && < 1.3 , base >= 4.7 && < 5.0 , criterion >= 0.6.2.1 && < 1.2 , deepseq >= 1.4 && < 1.5 , megaparsec >= 5.0 && < 6.0 - , stache >= 0.2.0 + , stache >= 0.2.2 , text >= 1.2 && < 1.3 if flag(dev) ghc-options: -O2 -Wall -Werror
