Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ghc-unliftio for openSUSE:Factory 
checked in at 2021-05-11 23:04:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-unliftio (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-unliftio.new.2988 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-unliftio"

Tue May 11 23:04:12 2021 rev:16 rq:892193 version:0.2.16

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-unliftio/ghc-unliftio.changes        
2021-02-16 22:45:48.466371061 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-unliftio.new.2988/ghc-unliftio.changes      
2021-05-11 23:04:18.816915744 +0200
@@ -1,0 +2,18 @@
+Mon May 10 07:58:33 UTC 2021 - [email protected]
+
+- Update unliftio to version 0.2.16.
+  ## 0.2.16
+
+  * Add `createFileLink`
+
+-------------------------------------------------------------------
+Fri May  7 09:36:45 UTC 2021 - [email protected]
+
+- Update unliftio to version 0.2.15.
+  ## 0.2.15
+
+  * Updated documentation mentioning that `MonadUnliftIO` may be derived using
+    the `newtype` strategy [#72](https://github.com/fpco/unliftio/pull/72)
+  * Add `mapExceptionM` [#75](https://github.com/fpco/unliftio/pull/75)
+
+-------------------------------------------------------------------

Old:
----
  unliftio-0.2.14.tar.gz

New:
----
  unliftio-0.2.16.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-unliftio.spec ++++++
--- /var/tmp/diff_new_pack.sZHgc5/_old  2021-05-11 23:04:19.256913737 +0200
+++ /var/tmp/diff_new_pack.sZHgc5/_new  2021-05-11 23:04:19.260913719 +0200
@@ -19,7 +19,7 @@
 %global pkg_name unliftio
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        0.2.14
+Version:        0.2.16
 Release:        0
 Summary:        The MonadUnliftIO typeclass for unlifting monads to IO 
(batteries included)
 License:        MIT

++++++ unliftio-0.2.14.tar.gz -> unliftio-0.2.16.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unliftio-0.2.14/ChangeLog.md 
new/unliftio-0.2.16/ChangeLog.md
--- old/unliftio-0.2.14/ChangeLog.md    2021-01-24 09:58:52.000000000 +0100
+++ new/unliftio-0.2.16/ChangeLog.md    2021-05-10 07:54:27.000000000 +0200
@@ -1,5 +1,15 @@
 # Changelog for unliftio
 
+## 0.2.16
+
+* Add `createFileLink`
+
+## 0.2.15
+
+* Updated documentation mentioning that `MonadUnliftIO` may be derived using
+  the `newtype` strategy [#72](https://github.com/fpco/unliftio/pull/72)
+* Add `mapExceptionM` [#75](https://github.com/fpco/unliftio/pull/75)
+
 ## 0.2.14
 
 * Add `UnliftIO.QSem`
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unliftio-0.2.14/src/UnliftIO/Directory.hs 
new/unliftio-0.2.16/src/UnliftIO/Directory.hs
--- old/unliftio-0.2.14/src/UnliftIO/Directory.hs       2021-01-24 
09:58:52.000000000 +0100
+++ new/unliftio-0.2.16/src/UnliftIO/Directory.hs       2021-05-10 
07:54:27.000000000 +0200
@@ -7,6 +7,9 @@
     -- * Actions on directories
     createDirectory
   , createDirectoryIfMissing
+#if MIN_VERSION_directory(1,3,1)
+  , createFileLink
+#endif
   , removeDirectory
   , removeDirectoryRecursive
 #if MIN_VERSION_directory(1,2,7)
@@ -149,6 +152,20 @@
 createDirectoryIfMissing create_parents path0 =
   liftIO (D.createDirectoryIfMissing create_parents path0)
 
+#if MIN_VERSION_directory(1,3,1)
+-- | Lifted 'D.createFileLink'.
+-- directory package version should be >= 1.3.1.
+-- @since 0.2.16.0
+{-# INLINE createFileLink #-}
+createFileLink
+  :: MonadIO m
+  => FilePath  -- ^ path to the target file
+  -> FilePath  -- ^ path of the link to be created
+  -> m ()
+createFileLink targetPath linkPath =
+  liftIO (D.createFileLink targetPath linkPath)
+#endif
+
 -- | Lifted 'D.removeDirectory'.
 --
 -- @since 0.2.6.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unliftio-0.2.14/src/UnliftIO/Exception.hs 
new/unliftio-0.2.16/src/UnliftIO/Exception.hs
--- old/unliftio-0.2.14/src/UnliftIO/Exception.hs       2021-01-24 
09:58:52.000000000 +0100
+++ new/unliftio-0.2.16/src/UnliftIO/Exception.hs       2021-05-10 
07:54:27.000000000 +0200
@@ -21,6 +21,8 @@
   , fromEither
   , fromEitherIO
   , fromEitherM
+  , mapExceptionM
+
     -- * Catching (with recovery)
   , catch
   , catchIO
@@ -635,3 +637,10 @@
 -- @since 0.1.0.0
 fromEitherM :: (Exception e, MonadIO m) => m (Either e a) -> m a
 fromEitherM = (>>= fromEither)
+
+-- | Same as 'Control.Exception.mapException', except works in
+-- a monadic context.
+--
+-- @since 0.2.15
+mapExceptionM :: (Exception e1, Exception e2, MonadUnliftIO m) => (e1 -> e2) 
-> m a -> m a
+mapExceptionM f = handle (throwIO . f)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unliftio-0.2.14/test/UnliftIO/DirectorySpec.hs 
new/unliftio-0.2.16/test/UnliftIO/DirectorySpec.hs
--- old/unliftio-0.2.14/test/UnliftIO/DirectorySpec.hs  1970-01-01 
01:00:00.000000000 +0100
+++ new/unliftio-0.2.16/test/UnliftIO/DirectorySpec.hs  2021-05-10 
07:54:27.000000000 +0200
@@ -0,0 +1,31 @@
+{-# LANGUAGE CPP #-}
+module UnliftIO.DirectorySpec (spec) where
+
+import Test.Hspec
+#if MIN_VERSION_directory(1,3,1)
+import System.FilePath
+import UnliftIO.IO
+import UnliftIO.Directory
+import UnliftIO.Temporary
+
+
+spec :: Spec
+spec = do
+  describe "createFileLink" $ do
+    it "mirror" $ do
+      withSystemTempDirectory "createFileLink.mirror"  $ \fp -> do
+        let fileContent = "i am the same"
+            fileContent' = "I AM THE SAME"
+            origin = fp </> "origin.txt"
+            link = fp </> "link.txt"
+        writeFile origin fileContent
+        createFileLink origin link
+        linkContent <- readFile link
+        linkContent `shouldBe`fileContent
+        writeFile origin fileContent'
+        linkContent' <- readFile link
+        linkContent' `shouldBe`fileContent'
+#else
+spec :: Spec
+spec = pure ()
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unliftio-0.2.14/test/UnliftIO/ExceptionSpec.hs 
new/unliftio-0.2.16/test/UnliftIO/ExceptionSpec.hs
--- old/unliftio-0.2.14/test/UnliftIO/ExceptionSpec.hs  2021-01-24 
09:58:52.000000000 +0100
+++ new/unliftio-0.2.16/test/UnliftIO/ExceptionSpec.hs  2021-05-10 
07:54:27.000000000 +0200
@@ -15,3 +15,17 @@
     it "Right for defined values" $ shouldRight $ pureTryDeep ()
     it "Left for bottom" $ shouldLeft $ pureTryDeep (undefined :: ())
     it "Left for wrapped bottom" $ shouldLeft $ pureTryDeep $ Just (undefined 
:: ())
+
+  describe "mapExceptionM" $ do
+    it "should convert an exception" $ do
+      result <- try $ mapExceptionM (\Exception1 -> Exception2) (throwIO 
Exception1)
+      result `shouldBe` (Left Exception2 :: Either Exception2 ())
+    it "should not convert unrelated exceptions" $ do
+      result <- try $ mapExceptionM (\Exception1 -> Exception2) (throwIO 
Exception2)
+      result `shouldBe` (Left Exception2 :: Either Exception2 ())
+
+data Exception1 = Exception1 deriving (Show, Eq)
+instance Exception Exception1
+
+data Exception2 = Exception2 deriving (Show, Eq)
+instance Exception Exception2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unliftio-0.2.14/unliftio.cabal 
new/unliftio-0.2.16/unliftio.cabal
--- old/unliftio-0.2.14/unliftio.cabal  2021-01-24 09:58:52.000000000 +0100
+++ new/unliftio-0.2.16/unliftio.cabal  2021-05-10 07:54:33.000000000 +0200
@@ -4,10 +4,10 @@
 --
 -- see: https://github.com/sol/hpack
 --
--- hash: e737146da57bc35659bcdf122bb96b8fd76e43a33e39f3ebf00fac260c68bb2b
+-- hash: 57462bd1ca0ffabd88cb1b743945f84d5c6330a59b7b364445e08d6399628d80
 
 name:           unliftio
-version:        0.2.14
+version:        0.2.16
 synopsis:       The MonadUnliftIO typeclass for unlifting monads to IO 
(batteries included)
 description:    Please see the documentation and README at 
<https://www.stackage.org/package/unliftio>
 category:       Control
@@ -92,6 +92,7 @@
   main-is: Spec.hs
   other-modules:
       UnliftIO.AsyncSpec
+      UnliftIO.DirectorySpec
       UnliftIO.ExceptionSpec
       UnliftIO.IO.FileSpec
       UnliftIO.IOSpec

Reply via email to