Hello community, here is the log from the commit of package ghc-hinotify for openSUSE:Factory checked in at 2015-08-10 09:16:50 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-hinotify (Old) and /work/SRC/openSUSE:Factory/.ghc-hinotify.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-hinotify" Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-hinotify/ghc-hinotify.changes 2015-05-26 12:31:57.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-hinotify.new/ghc-hinotify.changes 2015-08-10 09:16:51.000000000 +0200 @@ -1,0 +2,6 @@ +Sun Aug 9 15:59:00 UTC 2015 - [email protected] + +- update to 0.3.8.1 +* Use file system encoding for file names. + +------------------------------------------------------------------- Old: ---- hinotify-0.3.7.tar.gz New: ---- hinotify-0.3.8.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-hinotify.spec ++++++ --- /var/tmp/diff_new_pack.4ChugO/_old 2015-08-10 09:16:52.000000000 +0200 +++ /var/tmp/diff_new_pack.4ChugO/_new 2015-08-10 09:16:52.000000000 +0200 @@ -1,7 +1,6 @@ # # spec file for package ghc-hinotify # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties @@ -18,8 +17,8 @@ %global pkg_name hinotify -Name: ghc-%{pkg_name} -Version: 0.3.7 +Name: ghc-hinotify +Version: 0.3.8.1 Release: 0 Summary: Haskell binding to inotify License: BSD-3-Clause @@ -54,23 +53,18 @@ %prep %setup -q -n %{pkg_name}-%{version} - %build %{ghc_lib_build} - %install %{ghc_lib_install} - %post devel %{ghc_pkg_recache} - %postun devel %{ghc_pkg_recache} - %files -f %{name}.files %defattr(-,root,root,-) %doc LICENSE ++++++ hinotify-0.3.7.tar.gz -> hinotify-0.3.8.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hinotify-0.3.7/CHANGELOG.md new/hinotify-0.3.8.1/CHANGELOG.md --- old/hinotify-0.3.7/CHANGELOG.md 1970-01-01 01:00:00.000000000 +0100 +++ new/hinotify-0.3.8.1/CHANGELOG.md 2015-08-08 09:35:44.000000000 +0200 @@ -0,0 +1,15 @@ +hinotify +====== + +hinotify-0.3.8 +-------------- + +- Use file system encoding for file names. + + When run in a locale like LANG=C, this ensures that the filename is encoded + as a filename, so that arbitrary bytes in it will round-trip correctly, + rather than being stripped out. + + Fixes https://github.com/kolmodin/hinotify/issues/13 + + Patch contributed by Joey Hess [email protected] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hinotify-0.3.7/README.md new/hinotify-0.3.8.1/README.md --- old/hinotify-0.3.7/README.md 2014-04-27 16:06:19.000000000 +0200 +++ new/hinotify-0.3.8.1/README.md 2015-08-08 09:35:44.000000000 +0200 @@ -1,6 +1,8 @@ hinotify: inotify for Haskell ============================= +[](http://travis-ci.org/kolmodin/hinotify) + About ----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hinotify-0.3.7/hinotify.cabal new/hinotify-0.3.8.1/hinotify.cabal --- old/hinotify-0.3.7/hinotify.cabal 2014-04-27 16:06:19.000000000 +0200 +++ new/hinotify-0.3.8.1/hinotify.cabal 2015-08-08 09:35:44.000000000 +0200 @@ -1,35 +1,26 @@ name: hinotify -version: 0.3.7 +version: 0.3.8.1 build-type: Simple synopsis: Haskell binding to inotify description: - . This library provides a wrapper to the Linux Kernel's inotify feature, allowing applications to subscribe to notifications when a file is accessed or modified. - . category: System homepage: https://github.com/kolmodin/hinotify.git license: BSD3 license-file: LICENSE author: Lennart Kolmodin maintainer: Lennart Kolmodin <[email protected]> -extra-source-files: README.md -cabal-version: >= 1.6 +extra-source-files: README.md, CHANGELOG.md +cabal-version: >= 1.8 source-repository head type: git location: git://github.com/kolmodin/hinotify.git -flag split-base - description: Choose the new smaller, split-up base package. - library - build-depends: unix - if flag(split-base) - build-depends: base >= 4.5.0.0 && < 5, containers, directory - else - build-depends: base < 3 + build-depends: base >= 4.5.0.0 && < 5, containers, directory, unix extensions: ForeignFunctionInterface exposed-modules: @@ -38,5 +29,45 @@ System.INotify.Masks ghc-options: -Wall - + includes: sys/inotify.h hs-source-dirs: src + +test-suite test001 + type: exitcode-stdio-1.0 + build-depends: base, directory, hinotify + hs-source-dirs: src tests + main-is: test001-list-dir-contents.hs + other-modules: Utils + ghc-options: -Wall + +test-suite test002 + type: exitcode-stdio-1.0 + build-depends: base, directory, hinotify + hs-source-dirs: src tests + main-is: test002-writefile.hs + other-modules: Utils + ghc-options: -Wall + +test-suite test003 + type: exitcode-stdio-1.0 + build-depends: base, directory, hinotify + hs-source-dirs: src tests + main-is: test003-removefile.hs + other-modules: Utils + ghc-options: -Wall + +test-suite test004 + type: exitcode-stdio-1.0 + build-depends: base, directory, hinotify + hs-source-dirs: src tests + main-is: test004-modify-file.hs + other-modules: Utils + ghc-options: -Wall + +test-suite test005 + type: exitcode-stdio-1.0 + build-depends: base, directory, hinotify + hs-source-dirs: src tests + main-is: test005-move-file.hs + other-modules: Utils + ghc-options: -Wall diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hinotify-0.3.7/src/System/INotify.hsc new/hinotify-0.3.8.1/src/System/INotify.hsc --- old/hinotify-0.3.7/src/System/INotify.hsc 2014-04-27 16:06:19.000000000 +0200 +++ new/hinotify-0.3.8.1/src/System/INotify.hsc 2015-08-08 09:35:44.000000000 +0200 @@ -41,7 +41,7 @@ import Data.Maybe import Data.Map (Map) import qualified Data.Map as Map -import Foreign.C hiding (withCString) +import Foreign.C hiding (withCString, peekCString) import Foreign.Marshal hiding (void) import Foreign.Ptr import Foreign.Storable @@ -56,7 +56,7 @@ #endif import System.Posix.Files import GHC.IO.Encoding (getFileSystemEncoding) -import GHC.Foreign (withCString) +import GHC.Foreign (withCString, peekCString) import System.INotify.Masks @@ -268,7 +268,9 @@ len <- (#peek struct inotify_event, len) ptr :: IO CUInt nameM <- if len == 0 then return Nothing - else fmap Just $ peekCString ((#ptr struct inotify_event, name) ptr) + else do + enc <- getFileSystemEncoding + fmap Just $ peekCString enc ((#ptr struct inotify_event, name) ptr) let event_size = (#size struct inotify_event) + (fromIntegral len) event = cEvent2Haskell (FDEvent wd mask cookie nameM) rest <- read_events' (ptr `plusPtr` event_size) (r - event_size) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hinotify-0.3.7/tests/Utils.hs new/hinotify-0.3.8.1/tests/Utils.hs --- old/hinotify-0.3.7/tests/Utils.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/hinotify-0.3.8.1/tests/Utils.hs 2015-08-08 09:35:44.000000000 +0200 @@ -0,0 +1,60 @@ +module Utils where + +import Control.Concurrent.Chan +import Control.Exception + +import System.Directory +import System.Environment +import System.Exit + +import System.INotify + +testName :: IO String +testName = do + n <- getProgName + return (n ++ "-playground") + +withTempDir :: (String -> IO a) -> IO a +withTempDir f = do + path <- testName + bracket + ( createDirectory path >> return path ) + ( removeDirectoryRecursive ) + ( f ) + +withWatch :: INotify -> [EventVariety] -> FilePath -> (Event -> IO ()) -> IO a -> IO a +withWatch inot events path action f = + bracket + ( addWatch inot events path action ) + removeWatch + ( const f ) + +inTestEnviron :: [EventVariety] -> (String -> IO a) -> ([Event] -> IO b) -> IO b +inTestEnviron events action f = do + withTempDir $ \testPath -> do + inot <- initINotify + chan <- newChan + withWatch inot events testPath (writeChan chan) $ do + _ <- action testPath + events' <- getChanContents chan + f events' + +(~=) :: Eq a => [a] -> [a] -> Bool +[] ~= _ = True +(x:xs) ~= (y:ys) = x == y && xs ~= ys +_ ~= _ = False + +asMany :: [a] -> [a] -> [a] +asMany xs ys = take (length xs) ys + +explainFailure :: Show a => [a] -> [a] -> String +explainFailure expected reality = unlines $ + [ "Expected:" ] ++ + [ "> " ++ show x | x <- expected ] ++ + [ "But got:" ] ++ + [ "< " ++ show x | x <- asMany expected reality ] + +testFailure, testSuccess :: IO a +testFailure = exitFailure +testSuccess = exitWith ExitSuccess + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hinotify-0.3.7/tests/test001-list-dir-contents.hs new/hinotify-0.3.8.1/tests/test001-list-dir-contents.hs --- old/hinotify-0.3.7/tests/test001-list-dir-contents.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/hinotify-0.3.8.1/tests/test001-list-dir-contents.hs 2015-08-08 09:35:44.000000000 +0200 @@ -0,0 +1,23 @@ +module Main where + +import Control.Monad + +import System.Directory + +import System.INotify as INotify + +import Utils + +main :: IO () +main = + inTestEnviron [Open, Close] getDirectoryContents $ \ events -> do + when (expected ~= events) + testSuccess + putStrLn $ explainFailure expected events + testFailure + +expected :: [Event] +expected = + [ Opened True Nothing + , Closed True Nothing False + ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hinotify-0.3.7/tests/test002-writefile.hs new/hinotify-0.3.8.1/tests/test002-writefile.hs --- old/hinotify-0.3.7/tests/test002-writefile.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/hinotify-0.3.8.1/tests/test002-writefile.hs 2015-08-08 09:35:44.000000000 +0200 @@ -0,0 +1,28 @@ +module Main where + +import Control.Monad + +import System.INotify as INotify + +import Utils + +write :: String -> IO () +write path = do + writeFile (path ++ "/hello") "" + -- actually writing any contents gives me two Modified + +main :: IO () +main = + inTestEnviron [AllEvents] write $ \ events -> do + when (expected ~= events) + testSuccess + putStrLn $ explainFailure expected events + testFailure + +expected :: [Event] +expected = + [ Created False "hello" + , Opened False (Just "hello") + , Modified False (Just "hello") + , Closed False (Just "hello") True + ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hinotify-0.3.7/tests/test003-removefile.hs new/hinotify-0.3.8.1/tests/test003-removefile.hs --- old/hinotify-0.3.7/tests/test003-removefile.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/hinotify-0.3.8.1/tests/test003-removefile.hs 2015-08-08 09:35:44.000000000 +0200 @@ -0,0 +1,42 @@ +module Main where + +import Control.Monad + +import System.Directory + +import System.INotify as INotify + +import Utils + +file :: String +file = "hello" + +write :: String -> IO () +write path = do + writeFile (path ++ '/':file) "" + +remove :: String -> IO () +remove path = do + removeFile (path ++ '/':file) + +action :: String -> IO () +action path = do + write path + remove path + +main :: IO () +main = + inTestEnviron [AllEvents] action $ \ events -> do + when (expected ~= events) + testSuccess + putStrLn $ explainFailure expected events + testFailure + +expected :: [Event] +expected = + [ Created False file + , Opened False (Just file) + , Modified False (Just file) + , Closed False (Just file) True + , Deleted False file + ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hinotify-0.3.7/tests/test004-modify-file.hs new/hinotify-0.3.8.1/tests/test004-modify-file.hs --- old/hinotify-0.3.7/tests/test004-modify-file.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/hinotify-0.3.8.1/tests/test004-modify-file.hs 2015-08-08 09:35:44.000000000 +0200 @@ -0,0 +1,55 @@ +module Main where + +import Control.Exception +import Control.Monad + +import System.Directory +import System.IO + +import System.INotify as INotify + +import Utils + +file :: String +file = "hello" + +write :: String -> IO () +write path = do + writeFile (path ++ '/':file) "" + +modify :: String -> IO () +modify path = do + bracket + (openFile (path ++ '/':file) AppendMode) + (hClose) + (\h -> hPutStr h "yarr!") + +remove :: String -> IO () +remove path = do + removeFile (path ++ '/':file) + +action :: String -> IO () +action path = do + write path + modify path + remove path + +main :: IO () +main = + inTestEnviron [AllEvents] action $ \ events -> do + when (expected ~= events) + testSuccess + putStrLn $ explainFailure expected events + testFailure + +expected :: [Event] +expected = + [ Created False file + , Opened False (Just file) + , Modified False (Just file) + , Closed False (Just file) True + , Opened False (Just file) + , Modified False (Just file) + , Closed False (Just file) True + , Deleted False file + ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hinotify-0.3.7/tests/test005-move-file.hs new/hinotify-0.3.8.1/tests/test005-move-file.hs --- old/hinotify-0.3.7/tests/test005-move-file.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/hinotify-0.3.8.1/tests/test005-move-file.hs 2015-08-08 09:35:44.000000000 +0200 @@ -0,0 +1,50 @@ +module Main where + +import Control.Monad +import System.Directory + +import System.INotify as INotify + +import Utils + +file, file2 :: String +file = "hello" +file2 = file ++ "2" + +write :: String -> IO () +write path = do + writeFile (path ++ '/':file) "" + +move :: String -> IO () +move path = do + renameFile (path ++ '/':file) (path ++ '/':file2) + +remove :: String -> IO () +remove path = do + removeFile (path ++ '/':file2) + +action :: String -> IO () +action path = do + write path + move path + remove path + +main :: IO () +main = + inTestEnviron [AllEvents] action $ \ events -> do + let cookie = head [ c | MovedOut _ _ c <- events ] + when (expected cookie ~= events) + testSuccess + putStrLn $ explainFailure (expected cookie) events + testFailure + +expected :: Cookie -> [Event] +expected cookie = + [ Created False file + , Opened False (Just file) + , Modified False (Just file) + , Closed False (Just file) True + , MovedOut False file cookie + , MovedIn False file2 cookie + , Deleted False file2 + ]
