Hello community,

here is the log from the commit of package ghc-path-io for openSUSE:Factory 
checked in at 2017-03-18 20:49:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-path-io (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-path-io.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-path-io"

Sat Mar 18 20:49:58 2017 rev:4 rq:450613 version:1.2.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-path-io/ghc-path-io.changes  2016-10-23 
12:50:56.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-path-io.new/ghc-path-io.changes     
2017-03-18 20:49:59.698600785 +0100
@@ -1,0 +2,10 @@
+Sun Jan  8 21:13:46 UTC 2017 - [email protected]
+
+- Update to version 1.2.2 with cabal2obs.
+
+-------------------------------------------------------------------
+Wed Jan  4 21:25:00 UTC 2017 - [email protected]
+
+- Update to version 1.2.0 revision 1 with cabal2obs.
+
+-------------------------------------------------------------------

Old:
----
  path-io-1.2.0.tar.gz

New:
----
  path-io-1.2.2.tar.gz

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

Other differences:
------------------
++++++ ghc-path-io.spec ++++++
--- /var/tmp/diff_new_pack.D44c9a/_old  2017-03-18 20:50:00.198529962 +0100
+++ /var/tmp/diff_new_pack.D44c9a/_new  2017-03-18 20:50:00.202529396 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package ghc-path-io
 #
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
 %global pkg_name path-io
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        1.2.0
+Version:        1.2.2
 Release:        0
 Summary:        Interface to ‘directory’ package for users of ‘path’
 License:        BSD-3-Clause

++++++ path-io-1.2.0.tar.gz -> path-io-1.2.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/path-io-1.2.0/CHANGELOG.md 
new/path-io-1.2.2/CHANGELOG.md
--- old/path-io-1.2.0/CHANGELOG.md      2016-07-18 09:53:36.000000000 +0200
+++ new/path-io-1.2.2/CHANGELOG.md      2017-01-06 17:25:46.000000000 +0100
@@ -1,3 +1,20 @@
+## Path IO 1.2.2
+
+* Fixed a bug in `setModificationTime` function that previously called
+  `setAccessTime` instead of `setModificationTime` from `directory`.
+
+* Added notes to all pieces of API that are conditional (some functions are
+  only available if `directory-1.2.3.0` or later is used, now it's mentioned
+  for every such function explicitely).
+
+## Path IO 1.2.1
+
+* Allowed `directory-1.3.0.0`.
+
+* Added `getXdgDir`. Only available of `directory-1.2.3.0` or later is used.
+
+* Various cosmetic improvements.
+
 ## Path IO 1.2.0
 
 * Added `walkDir` function to traverse a directory tree with a handler.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/path-io-1.2.0/LICENSE.md new/path-io-1.2.2/LICENSE.md
--- old/path-io-1.2.0/LICENSE.md        2016-01-03 14:37:56.000000000 +0100
+++ new/path-io-1.2.2/LICENSE.md        2017-01-01 12:40:24.000000000 +0100
@@ -1,4 +1,4 @@
-Copyright © 2016 Mark Karpov
+Copyright © 2016–2017 Mark Karpov
 
 All rights reserved.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/path-io-1.2.0/Path/IO.hs new/path-io-1.2.2/Path/IO.hs
--- old/path-io-1.2.0/Path/IO.hs        2016-07-18 09:52:24.000000000 +0200
+++ new/path-io-1.2.2/Path/IO.hs        2017-01-06 17:24:50.000000000 +0100
@@ -1,6 +1,6 @@
 -- |
 -- Module      :  Path.IO
--- Copyright   :  © 2016 Mark Karpov
+-- Copyright   :  © 2016–2017 Mark Karpov
 -- License     :  BSD 3 clause
 --
 -- Maintainer  :  Mark Karpov <[email protected]>
@@ -29,7 +29,7 @@
   , copyDirRecur
   , copyDirRecur'
     -- ** Walking directory trees
-  , WalkAction(..)
+  , WalkAction (..)
   , walkDir
   , walkDirAccum
     -- ** Current working directory
@@ -41,6 +41,10 @@
   , getAppUserDataDir
   , getUserDocsDir
   , getTempDir
+#if MIN_VERSION_directory(1,2,3)
+  , XdgDirectory (..)
+  , getXdgDir
+#endif
     -- * Path transformation
   , AbsPath
   , RelPath
@@ -99,7 +103,7 @@
 import Control.Monad.IO.Class (MonadIO (..))
 import Control.Monad.Trans.Class (lift)
 import Control.Monad.Trans.Maybe (MaybeT (..), runMaybeT)
-import Control.Monad.Trans.Writer.Lazy (runWriterT, tell)
+import Control.Monad.Trans.Writer.Lazy (execWriterT, tell)
 import Data.Either (lefts, rights)
 import Data.List ((\\))
 import Data.Time (UTCTime)
@@ -107,6 +111,9 @@
 import System.IO (Handle)
 import System.IO.Error (isDoesNotExistError)
 import System.PosixCompat.Files (deviceID, fileID, getFileStatus)
+#if MIN_VERSION_directory(1,2,3)
+import System.Directory (XdgDirectory)
+#endif
 import qualified Data.Set         as S
 import qualified System.Directory as D
 import qualified System.FilePath  as F
@@ -430,9 +437,10 @@
   | WalkExclude [Path Abs Dir]  -- ^ List of sub-directories to exclude from
                                 -- descending
 
--- | Traverse a directory tree, calling a handler function at each directory
--- node traversed. The absolute paths of the parent directory, sub-directories
--- and the files in the directory are provided as arguments to the handler.
+-- | Traverse a directory tree using depth first pre-order traversal, calling a
+-- handler function at each directory node traversed. The absolute paths of the
+-- parent directory, sub-directories and the files in the directory are
+-- provided as arguments to the handler.
 --
 -- Detects and silently avoids any traversal loops in the directory tree.
 --
@@ -496,8 +504,7 @@
      -- ^ Directory where traversal begins
   -> m o
      -- ^ Accumulation of outputs generated by the output writer invocations
-walkDirAccum dHandler writer topdir =
-  liftM snd . runWriterT $ walkDir handler topdir
+walkDirAccum dHandler writer topdir = execWriterT $ walkDir handler topdir
   where
     handler dir subdirs files = do
       res <- lift $ writer dir subdirs files
@@ -700,6 +707,34 @@
 getTempDir = liftIO D.getTemporaryDirectory >>= resolveDir'
 {-# INLINE getTempDir #-}
 
+#if MIN_VERSION_directory(1,2,3)
+-- | Obtain the paths to special directories for storing user-specific
+-- application data, configuration, and cache files, conforming to the
+-- <http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html XDG 
Base Directory Specification>.
+-- Compared with 'getAppUserDataDir', this function provides a more
+-- fine-grained hierarchy as well as greater flexibility for the user.
+--
+-- It also works on Windows, although in that case 'XdgData' and 'XdgConfig'
+-- will map to the same directory.
+--
+-- Note: The directory may not actually exist, in which case you would need
+-- to create it with file mode @700@ (i.e. only accessible by the owner).
+--
+-- Note also: this is a piece of conditional API, only available if
+-- @directory-1.2.3.0@ or later is used.
+--
+-- @since 1.2.1
+
+getXdgDir :: (MonadIO m, MonadThrow m)
+  => XdgDirectory      -- ^ Which special directory
+  -> Maybe (Path Rel Dir)
+     -- ^ A relative path that is appended to the path; if 'Nothing', the
+     -- base path is returned
+  -> m (Path Abs Dir)
+getXdgDir xdgDir suffix = liftIO (D.getXdgDirectory xdgDir $ maybe "" 
toFilePath suffix) >>= parseAbsDir
+{-# INLINE getXdgDir #-}
+#endif
+
 ----------------------------------------------------------------------------
 -- Path transformation
 
@@ -1243,6 +1278,9 @@
 -- Caveat for POSIX systems: This function returns a timestamp with
 -- sub-second resolution only if this package is compiled against
 -- @unix-2.6.0.0@ or later and the underlying filesystem supports them.
+--
+-- Note: this is a piece of conditional API, only available if
+-- @directory-1.2.3.0@ or later is used.
 
 getAccessTime :: MonadIO m => Path b t -> m UTCTime
 getAccessTime = liftD D.getAccessTime
@@ -1269,6 +1307,9 @@
 --   function would not be able to set timestamps with sub-second
 --   resolution. In this case, there would also be loss of precision in the
 --   modification time.
+--
+-- Note: this is a piece of conditional API, only available if
+-- @directory-1.2.3.0@ or later is used.
 
 setAccessTime :: MonadIO m => Path b t -> UTCTime -> m ()
 setAccessTime = liftD2' D.setAccessTime
@@ -1295,9 +1336,12 @@
 --   function would not be able to set timestamps with sub-second
 --   resolution. In this case, there would also be loss of precision in the
 --   access time.
+--
+-- Note: this is a piece of conditional API, only available if
+-- @directory-1.2.3.0@ or later is used.
 
 setModificationTime :: MonadIO m => Path b t -> UTCTime -> m ()
-setModificationTime = liftD2' D.setAccessTime
+setModificationTime = liftD2' D.setModificationTime
 {-# INLINE setModificationTime #-}
 #endif
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/path-io-1.2.0/README.md new/path-io-1.2.2/README.md
--- old/path-io-1.2.0/README.md 2016-02-20 09:37:50.000000000 +0100
+++ new/path-io-1.2.2/README.md 2017-01-01 12:40:32.000000000 +0100
@@ -17,6 +17,6 @@
 
 ## License
 
-Copyright © 2016 Mark Karpov
+Copyright © 2016–2017 Mark Karpov
 
 Distributed under BSD 3 clause license.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/path-io-1.2.0/path-io.cabal 
new/path-io-1.2.2/path-io.cabal
--- old/path-io-1.2.0/path-io.cabal     2016-07-18 09:38:38.000000000 +0200
+++ new/path-io-1.2.2/path-io.cabal     2017-01-06 17:26:33.000000000 +0100
@@ -1,7 +1,7 @@
 --
 -- Cabal configuration for ‘path-io’.
 --
--- Copyright © 2016 Mark Karpov
+-- Copyright © 2016–2017 Mark Karpov
 --
 -- 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:                 path-io
-version:              1.2.0
+version:              1.2.2
 cabal-version:        >= 1.10
 license:              BSD3
 license-file:         LICENSE.md
@@ -43,7 +43,7 @@
 synopsis:             Interface to ‘directory’ package for users of ‘path’
 build-type:           Simple
 description:          Interface to ‘directory’ package for users of ‘path’.
-extra-source-files:   CHANGELOG.md
+extra-doc-files:      CHANGELOG.md
                     , README.md
 
 flag dev
@@ -54,7 +54,7 @@
 library
   build-depends:      base         >= 4.7     && < 5.0
                     , containers
-                    , directory    >= 1.2.2.0 && < 1.3
+                    , directory    >= 1.2.2   && < 1.4
                     , exceptions   >= 0.8     && < 0.9
                     , filepath     >= 1.2     && < 1.5
                     , path         >= 0.5     && < 0.6
@@ -81,7 +81,7 @@
                     , exceptions   >= 0.8     && < 0.9
                     , hspec        >= 2.0     && < 3.0
                     , path         >= 0.5     && < 0.6
-                    , path-io      >= 1.2.0
+                    , path-io      >= 1.2.2
                     , unix-compat
   default-language:   Haskell2010
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/path-io-1.2.0/tests/Main.hs 
new/path-io-1.2.2/tests/Main.hs
--- old/path-io-1.2.0/tests/Main.hs     2016-07-18 09:20:51.000000000 +0200
+++ new/path-io-1.2.2/tests/Main.hs     2017-01-05 19:38:27.000000000 +0100
@@ -1,7 +1,7 @@
 --
 -- Tests for ‘path-io’ package.
 --
--- Copyright © 2016 Mark Karpov <[email protected]>
+-- Copyright © 2016–2017 Mark Karpov <[email protected]>
 --
 -- Redistribution and use in source and binary forms, with or without
 -- modification, are permitted provided that the following conditions are
@@ -64,11 +64,16 @@
   beforeWith populatedCyclicDir $
     describe "listDirRecur Cyclic" listDirRecurCyclicSpec
 #endif
-  describe "getCurrentDir"  getCurrentDirSpec
-  describe "setCurrentDir"  setCurrentDirSpec
-  describe "withCurrentDir" withCurrentDirSpec
-  describe "getHomeDir"     getHomeDirSpec
-  describe "getTempDir"     getTempDirSpec
+  describe "getCurrentDir"    getCurrentDirSpec
+  describe "setCurrentDir"    setCurrentDirSpec
+  describe "withCurrentDir"   withCurrentDirSpec
+  describe "getHomeDir"       getHomeDirSpec
+  describe "getTempDir"       getTempDirSpec
+#if MIN_VERSION_directory(1,2,3)
+  describe "getXdgDir Data"   getXdgDataDirSpec
+  describe "getXdgDir Config" getXdgConfigDirSpec
+  describe "getXdgDir Cache"  getXdgCacheDirSpec
+#endif
 
 listDirSpec :: SpecWith (Path Abs Dir)
 listDirSpec = it "lists directory" $ \dir ->
@@ -192,6 +197,41 @@
       unsetEnv evar
   where evar = "TMPDIR"
 
+#if MIN_VERSION_directory(1,2,3)
+getXdgDataDirSpec :: SpecWith (Path Abs Dir)
+getXdgDataDirSpec =
+  it "XDG data dir is influenced by environment variable XDG_DATA_HOME" $ \dir 
->
+    flip finally (unsetEnv evar) $ do
+      setEnv evar (toFilePath dir)
+      getXdgDir XdgData (Just name) `shouldReturn` (dir </> name)
+      getXdgDir XdgData Nothing `shouldReturn` dir
+      unsetEnv evar
+  where evar = "XDG_DATA_HOME"
+        name = $(mkRelDir "test")
+
+getXdgConfigDirSpec :: SpecWith (Path Abs Dir)
+getXdgConfigDirSpec =
+  it "XDG config dir is influenced by environment variable XDG_CONFIG_HOME" $ 
\dir ->
+    flip finally (unsetEnv evar) $ do
+      setEnv evar (toFilePath dir)
+      getXdgDir XdgConfig (Just name) `shouldReturn` (dir </> name)
+      getXdgDir XdgConfig Nothing `shouldReturn` dir
+      unsetEnv evar
+  where evar = "XDG_CONFIG_HOME"
+        name = $(mkRelDir "test")
+
+getXdgCacheDirSpec :: SpecWith (Path Abs Dir)
+getXdgCacheDirSpec =
+  it "XDG cache dir is influenced by environment variable XDG_CACHE_HOME" $ 
\dir ->
+    flip finally (unsetEnv evar) $ do
+      setEnv evar (toFilePath dir)
+      getXdgDir XdgCache (Just name) `shouldReturn` (dir </> name)
+      getXdgDir XdgCache Nothing `shouldReturn` dir
+      unsetEnv evar
+  where evar = "XDG_CACHE_HOME"
+        name = $(mkRelDir "test")
+#endif
+
 ----------------------------------------------------------------------------
 -- Helpers
 


Reply via email to