Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ghc-file-embed for openSUSE:Factory checked in at 2021-09-10 23:40:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-file-embed (Old) and /work/SRC/openSUSE:Factory/.ghc-file-embed.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-file-embed" Fri Sep 10 23:40:56 2021 rev:17 rq:917351 version:0.0.15.0 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-file-embed/ghc-file-embed.changes 2021-06-01 10:40:27.809119677 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-file-embed.new.1899/ghc-file-embed.changes 2021-09-10 23:41:06.626546563 +0200 @@ -1,0 +2,8 @@ +Sun Aug 29 13:57:28 UTC 2021 - [email protected] + +- Update file-embed to version 0.0.15.0. + ## 0.0.15.0 + + * Add `makeRelativeToLocationPredicate` + +------------------------------------------------------------------- Old: ---- file-embed-0.0.14.0.tar.gz New: ---- file-embed-0.0.15.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-file-embed.spec ++++++ --- /var/tmp/diff_new_pack.Cdbmwj/_old 2021-09-10 23:41:07.162547133 +0200 +++ /var/tmp/diff_new_pack.Cdbmwj/_new 2021-09-10 23:41:07.166547138 +0200 @@ -19,7 +19,7 @@ %global pkg_name file-embed %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.0.14.0 +Version: 0.0.15.0 Release: 0 Summary: Use Template Haskell to embed file contents directly License: BSD-2-Clause ++++++ file-embed-0.0.14.0.tar.gz -> file-embed-0.0.15.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/file-embed-0.0.14.0/ChangeLog.md new/file-embed-0.0.15.0/ChangeLog.md --- old/file-embed-0.0.14.0/ChangeLog.md 2021-05-10 17:54:57.000000000 +0200 +++ new/file-embed-0.0.15.0/ChangeLog.md 2021-08-29 15:06:51.000000000 +0200 @@ -1,5 +1,9 @@ # ChangeLog for file-embed +## 0.0.15.0 + +* Add `makeRelativeToLocationPredicate` + ## 0.0.14.0 * Add `embedFileIfExists` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/file-embed-0.0.14.0/Data/FileEmbed.hs new/file-embed-0.0.15.0/Data/FileEmbed.hs --- old/file-embed-0.0.14.0/Data/FileEmbed.hs 2021-05-10 17:55:11.000000000 +0200 +++ new/file-embed-0.0.15.0/Data/FileEmbed.hs 2021-08-29 15:06:51.000000000 +0200 @@ -39,6 +39,7 @@ , injectFileWith -- * Relative path manipulation , makeRelativeToProject + , makeRelativeToLocationPredicate -- * Internal , stringToBs , bsToExp @@ -408,7 +409,19 @@ -- -- @since 0.0.10 makeRelativeToProject :: FilePath -> Q FilePath -makeRelativeToProject rel = do +makeRelativeToProject = makeRelativeToLocationPredicate $ (==) ".cabal" . takeExtension + +-- | Take a predicate to infer the project root and a relative file path, the given file path is then attached to the inferred project root +-- +-- This function looks at the source location of the Haskell file calling it, +-- finds the first parent directory with a file matching the given predicate, and uses that as the +-- root directory for fixing the relative path. +-- +-- @$(makeRelativeToLocationPredicate ((==) ".cabal" . takeExtension) "data/foo.txt" >>= embedFile)@ +-- +-- @since 0.0.15.0 +makeRelativeToLocationPredicate :: (FilePath -> Bool) -> FilePath -> Q FilePath +makeRelativeToLocationPredicate isTargetFile rel = do loc <- qLocation runIO $ do srcFP <- canonicalizePath $ loc_filename loc @@ -423,8 +436,6 @@ then return Nothing else do contents <- getDirectoryContents dir - if any isCabalFile contents + if any isTargetFile contents then return (Just dir) else findProjectDir dir - - isCabalFile fp = takeExtension fp == ".cabal" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/file-embed-0.0.14.0/file-embed.cabal new/file-embed-0.0.15.0/file-embed.cabal --- old/file-embed-0.0.14.0/file-embed.cabal 2021-05-10 17:55:01.000000000 +0200 +++ new/file-embed-0.0.15.0/file-embed.cabal 2021-08-29 15:06:51.000000000 +0200 @@ -1,6 +1,6 @@ name: file-embed -version: 0.0.14.0 -license: BSD3 +version: 0.0.15.0 +license: BSD2 license-file: LICENSE author: Michael Snoyman <[email protected]> maintainer: Michael Snoyman <[email protected]>
