openSUSE Commits
Threads by month
- ----- 2025 -----
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
April 2016
- 1 participants
- 1255 discussions
Hello community,
here is the log from the commit of package ghc-fast-logger for openSUSE:Factory checked in at 2016-04-30 23:30:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-fast-logger (Old)
and /work/SRC/openSUSE:Factory/.ghc-fast-logger.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-fast-logger"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-fast-logger/ghc-fast-logger.changes 2016-04-22 16:25:20.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-fast-logger.new/ghc-fast-logger.changes 2016-04-30 23:30:18.000000000 +0200
@@ -1,0 +2,9 @@
+Tue Apr 26 08:23:17 UTC 2016 - mimi.vx(a)gmail.com
+
+- update to 2.4.5
+- refreshed remove-bytestring-builder.patch
+* Bringing backward compatibility back
+* New API: newFastLogger and ewTimedFastLogger.
+* LogType and date cache are transferred from wai-logger.
+
+-------------------------------------------------------------------
Old:
----
fast-logger-2.4.3.tar.gz
New:
----
fast-logger-2.4.5.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-fast-logger.spec ++++++
--- /var/tmp/diff_new_pack.2nyoYu/_old 2016-04-30 23:30:19.000000000 +0200
+++ /var/tmp/diff_new_pack.2nyoYu/_new 2016-04-30 23:30:19.000000000 +0200
@@ -20,7 +20,7 @@
%bcond_with tests
Name: ghc-fast-logger
-Version: 2.4.3
+Version: 2.4.5
Release: 0
Summary: A fast logging system
Group: System/Libraries
@@ -39,8 +39,11 @@
BuildRequires: ghc-auto-update-devel
BuildRequires: ghc-bytestring-devel
BuildRequires: ghc-directory-devel
+BuildRequires: ghc-easy-file-devel
BuildRequires: ghc-filepath-devel
BuildRequires: ghc-text-devel
+BuildRequires: ghc-unix-devel
+BuildRequires: ghc-unix-time-devel
%if %{with tests}
BuildRequires: ghc-hspec-devel
%endif
@@ -95,7 +98,7 @@
%files devel -f %{name}-devel.files
%defattr(-,root,root,-)
-%doc README.md
+%doc README.md ChangeLog.md
%changelog
++++++ fast-logger-2.4.3.tar.gz -> fast-logger-2.4.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fast-logger-2.4.3/ChangeLog.md new/fast-logger-2.4.5/ChangeLog.md
--- old/fast-logger-2.4.3/ChangeLog.md 2016-04-12 06:20:01.000000000 +0200
+++ new/fast-logger-2.4.5/ChangeLog.md 2016-04-15 15:44:48.000000000 +0200
@@ -1,3 +1,8 @@
+## 2.4.4
+
+* New API: newFastLogger and ewTimedFastLogger.
+* LogType and date cache are transferred from wai-logger.
+
## 2.4.3
* Opening files in the append mode on Windows.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fast-logger-2.4.3/System/Log/FastLogger/Date.hs new/fast-logger-2.4.5/System/Log/FastLogger/Date.hs
--- old/fast-logger-2.4.3/System/Log/FastLogger/Date.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/fast-logger-2.4.5/System/Log/FastLogger/Date.hs 2016-04-15 15:44:48.000000000 +0200
@@ -0,0 +1,75 @@
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE OverloadedStrings #-}
+
+-- |
+-- Formatting time is slow.
+-- This package provides mechanisms to cache formatted date.
+module System.Log.FastLogger.Date (
+ -- * Types
+ TimeFormat
+ , FormattedTime
+ -- * Date cacher
+ , newTimeCache
+ , simpleTimeFormat
+ , simpleTimeFormat'
+ ) where
+
+import Control.AutoUpdate (mkAutoUpdate, defaultUpdateSettings, updateAction)
+import Data.ByteString (ByteString)
+#if WINDOWS
+import qualified Data.ByteString.Char8 as BS
+import Data.Time (UTCTime, formatTime, getCurrentTime, utcToLocalZonedTime)
+# if MIN_VERSION_time(1,5,0)
+import Data.Time (defaultTimeLocale)
+# else
+import System.Locale (defaultTimeLocale)
+# endif
+#else
+import Data.UnixTime (formatUnixTime, fromEpochTime)
+import System.Posix (EpochTime, epochTime)
+#endif
+
+----------------------------------------------------------------
+
+-- | Type aliaes for date format and formatted date.
+type FormattedTime = ByteString
+type TimeFormat = ByteString
+
+----------------------------------------------------------------
+
+#if WINDOWS
+-- | Get date using UTC.
+getTime :: IO UTCTime
+getTime = getCurrentTime
+-- | Format UTC date.
+formatDate :: TimeFormat -> UTCTime -> IO FormattedTime
+formatDate fmt ut = do
+ zt <- utcToLocalZonedTime ut
+ return $ BS.pack $ formatTime defaultTimeLocale (BS.unpack fmt) zt
+#else
+-- | Get date using UnixTime.
+getTime :: IO EpochTime
+getTime = epochTime
+-- | Format unix EpochTime date.
+formatDate :: TimeFormat -> EpochTime -> IO FormattedTime
+formatDate fmt = formatUnixTime fmt . fromEpochTime
+#endif
+
+----------------------------------------------------------------
+
+-- | Make 'IO' action which get cached formatted local time.
+-- Use this to avoid the cost of frequently time formatting by caching an
+-- auto updating formatted time, this cache update every 1 second.
+-- more detail in "Control.AutoUpdate"
+newTimeCache :: TimeFormat -> IO (IO FormattedTime)
+newTimeCache fmt = mkAutoUpdate defaultUpdateSettings{
+ updateAction = getTime >>= formatDate fmt
+ }
+
+-- | A simple time cache using format @"%d/%b/%Y:%T %z"@
+simpleTimeFormat :: TimeFormat
+simpleTimeFormat = "%d/%b/%Y:%T %z"
+
+-- | A simple time cache using format @"%d-%b-%Y %T"@
+simpleTimeFormat' :: TimeFormat
+simpleTimeFormat' = "%d-%b-%Y %T"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fast-logger-2.4.3/System/Log/FastLogger/File.hs new/fast-logger-2.4.5/System/Log/FastLogger/File.hs
--- old/fast-logger-2.4.3/System/Log/FastLogger/File.hs 2016-04-12 06:20:01.000000000 +0200
+++ new/fast-logger-2.4.5/System/Log/FastLogger/File.hs 2016-04-15 15:44:48.000000000 +0200
@@ -14,8 +14,8 @@
}
-- | Checking if a log file can be written.
-check :: FileLogSpec -> IO ()
-check spec = do
+check :: FilePath -> IO ()
+check file = do
dirExist <- doesDirectoryExist dir
unless dirExist $ fail $ dir ++ " does not exist or is not a directory."
dirPerm <- getPermissions dir
@@ -25,7 +25,6 @@
perm <- getPermissions file
unless (writable perm) $ fail $ file ++ " is not writable."
where
- file = log_file spec
dir = takeDirectory file
-- | Rotating log files.
@@ -41,4 +40,3 @@
move (src,dst) = do
exist <- doesFileExist src
when exist $ renameFile src dst
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fast-logger-2.4.3/System/Log/FastLogger/IORef.hs new/fast-logger-2.4.5/System/Log/FastLogger/IORef.hs
--- old/fast-logger-2.4.3/System/Log/FastLogger/IORef.hs 2016-04-12 06:20:01.000000000 +0200
+++ new/fast-logger-2.4.5/System/Log/FastLogger/IORef.hs 2016-04-15 15:44:48.000000000 +0200
@@ -6,6 +6,7 @@
, newIORef
, readIORef
, atomicModifyIORef'
+ , writeIORef
) where
import Data.IORef
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fast-logger-2.4.3/System/Log/FastLogger.hs new/fast-logger-2.4.5/System/Log/FastLogger.hs
--- old/fast-logger-2.4.3/System/Log/FastLogger.hs 2016-04-12 06:20:01.000000000 +0200
+++ new/fast-logger-2.4.5/System/Log/FastLogger.hs 2016-04-15 15:44:48.000000000 +0200
@@ -1,7 +1,7 @@
-- | This module provides a fast logging system which
-- scales on multicore environments (i.e. +RTS -N\<x\>).
{-# LANGUAGE CPP #-}
-{-# LANGUAGE Safe #-}
+{-# LANGUAGE OverloadedStrings #-}
module System.Log.FastLogger (
-- * Creating a logger set
@@ -26,6 +26,16 @@
, pushLogStrLn
-- * Flushing buffered log messages
, flushLogStr
+ -- * FastLogger
+ , FastLogger
+ , TimedFastLogger
+ , LogType(..)
+ , newFastLogger
+ , withFastLogger
+ , newTimedFastLogger
+ , withTimedFastLogger
+ -- * Date cache
+ , module System.Log.FastLogger.Date
-- * File rotation
, module System.Log.FastLogger.File
) where
@@ -34,16 +44,19 @@
import Control.Applicative ((<$>))
#endif
import Control.Debounce (mkDebounce, defaultDebounceSettings, debounceAction)
-import Control.Concurrent (getNumCapabilities, myThreadId, threadCapability, takeMVar)
+import Control.Concurrent (getNumCapabilities, myThreadId, threadCapability, takeMVar, MVar, newMVar, tryTakeMVar, putMVar)
+import Control.Exception (handle, SomeException(..), bracket)
import Control.Monad (when, replicateM)
import Data.Array (Array, listArray, (!), bounds)
import Data.Maybe (isJust)
+import System.EasyFile (getFileSize)
import System.Log.FastLogger.File
import System.Log.FastLogger.IO
import System.Log.FastLogger.FileIO
import System.Log.FastLogger.IORef
import System.Log.FastLogger.LogStr
import System.Log.FastLogger.Logger
+import System.Log.FastLogger.Date
----------------------------------------------------------------
@@ -104,7 +117,7 @@
-- | Same as 'pushLogStr' but also appends a newline.
pushLogStrLn :: LoggerSet -> LogStr -> IO ()
-pushLogStrLn loggerSet logStr = pushLogStr loggerSet (logStr <> toLogStr "\n")
+pushLogStrLn loggerSet logStr = pushLogStr loggerSet (logStr <> "\n")
-- | Flushing log messages in buffers.
-- This function must be called explicitly when the program is
@@ -150,3 +163,126 @@
freeIt i = do
let (Logger mbuf _ _) = arr ! i
takeMVar mbuf >>= freeBuffer
+
+----------------------------------------------------------------
+
+-- | 'FastLogger' simply log 'logStr'.
+type FastLogger = LogStr -> IO ()
+-- | 'TimedFastLogger' pass 'FormattedTime' to callback and simply log its result.
+-- this can be used to customize how to log timestamp.
+type TimedFastLogger = (FormattedTime -> LogStr) -> IO ()
+
+-- | Logger Type.
+data LogType
+ = LogNone -- ^ No logging.
+ | LogStdout BufSize -- ^ Logging to stdout.
+ -- 'BufSize' is a buffer size
+ | LogStderr BufSize -- ^ Logging to stdout.
+ -- 'BufSize' is a buffer size
+ -- for each capability.
+ | LogFileNoRotate FilePath BufSize
+ -- ^ Logging to a file.
+ -- 'BufSize' is a buffer size
+ -- for each capability.
+ | LogFile FileLogSpec BufSize -- ^ Logging to a file.
+ -- 'BufSize' is a buffer size
+ -- for each capability.
+ -- File rotation is done on-demand.
+ | LogCallback (LogStr -> IO ()) (IO ()) -- ^ Logging with a log and flush action.
+ -- run flush after log each message.
+
+-- | Initialize a 'FastLogger' without attaching timestamp
+-- a tuple of logger and clean up action are returned.
+newFastLogger :: LogType -> IO (FastLogger, IO ())
+newFastLogger typ = case typ of
+ LogNone -> return (const noOp, noOp)
+ LogStdout bsize -> newStdoutLoggerSet bsize >>= stdLoggerInit
+ LogStderr bsize -> newStderrLoggerSet bsize >>= stdLoggerInit
+ LogFileNoRotate fp bsize -> newFileLoggerSet bsize fp >>= fileLoggerInit
+ LogFile fspec bsize -> rotateLoggerInit fspec bsize
+ LogCallback cb flush -> return (\ str -> cb str >> flush, noOp )
+ where
+ stdLoggerInit lgrset = return (pushLogStr lgrset, noOp)
+ fileLoggerInit lgrset = return (pushLogStr lgrset, rmLoggerSet lgrset)
+ rotateLoggerInit fspec bsize = do
+ lgrset <- newFileLoggerSet bsize $ log_file fspec
+ ref <- newIORef (0 :: Int)
+ mvar <- newMVar ()
+ let logger str = do
+ cnt <- decrease ref
+ pushLogStr lgrset str
+ when (cnt <= 0) $ tryRotate lgrset fspec ref mvar
+ return (logger, rmLoggerSet lgrset)
+
+-- | 'bracket' version of 'newFastLogger'
+withFastLogger :: LogType -> (FastLogger -> IO a) -> IO a
+withFastLogger typ log' = bracket (newFastLogger typ) snd (log' . fst)
+
+-- | Initialize a 'FastLogger' with timestamp attached to each message.
+-- a tuple of logger and clean up action are returned.
+newTimedFastLogger ::
+ IO FormattedTime -- ^ How do we get 'FormattedTime'?
+ -- "System.Log.FastLogger.Date" provide cached formatted time.
+ -> LogType -> IO (TimedFastLogger, IO ())
+newTimedFastLogger tgetter typ = case typ of
+ LogNone -> return (const noOp, noOp)
+ LogStdout bsize -> newStdoutLoggerSet bsize >>= stdLoggerInit
+ LogStderr bsize -> newStderrLoggerSet bsize >>= stdLoggerInit
+ LogFileNoRotate fp bsize -> newFileLoggerSet bsize fp >>= fileLoggerInit
+ LogFile fspec bsize -> rotateLoggerInit fspec bsize
+ LogCallback cb flush -> return (\ f -> tgetter >>= cb . f >> flush, noOp )
+ where
+ stdLoggerInit lgrset = return ( \f -> tgetter >>= pushLogStr lgrset . f, noOp)
+ fileLoggerInit lgrset = return (\f -> tgetter >>= pushLogStr lgrset . f, rmLoggerSet lgrset)
+ rotateLoggerInit fspec bsize = do
+ lgrset <- newFileLoggerSet bsize $ log_file fspec
+ ref <- newIORef (0 :: Int)
+ mvar <- newMVar ()
+ let logger f = do
+ cnt <- decrease ref
+ t <- tgetter
+ pushLogStr lgrset (f t)
+ when (cnt <= 0) $ tryRotate lgrset fspec ref mvar
+ return (logger, rmLoggerSet lgrset)
+
+-- | 'bracket' version of 'newTimeFastLogger'
+withTimedFastLogger :: (IO FormattedTime) -> LogType -> (TimedFastLogger -> IO a) -> IO a
+withTimedFastLogger tgetter typ log' = bracket (newTimedFastLogger tgetter typ) snd (log' . fst)
+
+----------------------------------------------------------------
+
+noOp :: IO ()
+noOp = return ()
+
+decrease :: IORef Int -> IO Int
+decrease ref = atomicModifyIORef' ref (\x -> (x - 1, x - 1))
+
+tryRotate :: LoggerSet -> FileLogSpec -> IORef Int -> MVar () -> IO ()
+tryRotate lgrset spec ref mvar = bracket lock unlock rotateFiles
+ where
+ lock = tryTakeMVar mvar
+ unlock Nothing = return ()
+ unlock _ = putMVar mvar ()
+ rotateFiles Nothing = return ()
+ rotateFiles _ = do
+ msiz <- getSize
+ case msiz of
+ -- A file is not available.
+ -- So, let's set a big value to the counter so that
+ -- this function is not called frequently.
+ Nothing -> writeIORef ref 1000000
+ Just siz
+ | siz > limit -> do
+ rotate spec
+ renewLoggerSet lgrset
+ writeIORef ref $ estimate limit
+ | otherwise ->
+ writeIORef ref $ estimate (limit - siz)
+ file = log_file spec
+ limit = log_file_size spec
+ getSize = handle (\(SomeException _) -> return Nothing) $
+ -- The log file is locked by GHC.
+ -- We need to get its file size by the way not using locks.
+ Just . fromIntegral <$> getFileSize file
+ -- 200 is an ad-hoc value for the length of log line.
+ estimate x = fromInteger (x `div` 200)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fast-logger-2.4.3/fast-logger.cabal new/fast-logger-2.4.5/fast-logger.cabal
--- old/fast-logger-2.4.3/fast-logger.cabal 2016-04-12 06:20:01.000000000 +0200
+++ new/fast-logger-2.4.5/fast-logger.cabal 2016-04-15 15:44:48.000000000 +0200
@@ -1,5 +1,5 @@
Name: fast-logger
-Version: 2.4.3
+Version: 2.4.5
Author: Kazu Yamamoto <kazu(a)iij.ad.jp>
Maintainer: Kazu Yamamoto <kazu(a)iij.ad.jp>
License: BSD3
@@ -15,6 +15,7 @@
GHC-Options: -Wall
Exposed-Modules: System.Log.FastLogger
System.Log.FastLogger.File
+ System.Log.FastLogger.Date
Other-Modules: System.Log.FastLogger.IO
System.Log.FastLogger.FileIO
System.Log.FastLogger.IORef
@@ -23,14 +24,20 @@
Build-Depends: base >= 4.5 && < 5
, array
, auto-update >= 0.1.2
+ , easy-file >= 0.2
, bytestring
, bytestring-builder
, directory
, filepath
, text
if os(windows)
- Build-Depends:
- Win32
+ Cpp-Options: -DWINDOWS
+ Build-Depends: time
+ , Win32
+ , old-locale
+ else
+ Build-Depends: unix
+ , unix-time >= 0.2.2
Test-Suite spec
Main-Is: Spec.hs
++++++ remove-bytestring-builder.patch ++++++
--- /var/tmp/diff_new_pack.2nyoYu/_old 2016-04-30 23:30:19.000000000 +0200
+++ /var/tmp/diff_new_pack.2nyoYu/_new 2016-04-30 23:30:19.000000000 +0200
@@ -1,10 +1,10 @@
-diff --git a/fast-logger.cabal.orig b/fast-logger.cabal
-index 25e93d5..d1762b0 100644
---- a/fast-logger.cabal.orig
-+++ b/fast-logger.cabal
-@@ -23,7 +23,6 @@ Library
- , array
+Index: fast-logger-2.4.5/fast-logger.cabal
+===================================================================
+--- fast-logger-2.4.5.orig/fast-logger.cabal
++++ fast-logger-2.4.5/fast-logger.cabal
+@@ -26,7 +26,6 @@ Library
, auto-update >= 0.1.2
+ , easy-file >= 0.2
, bytestring
- , bytestring-builder
, directory
1
0
Hello community,
here is the log from the commit of package ghc-cookie for openSUSE:Factory checked in at 2016-04-30 23:30:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-cookie (Old)
and /work/SRC/openSUSE:Factory/.ghc-cookie.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-cookie"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-cookie/ghc-cookie.changes 2015-06-30 10:19:02.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-cookie.new/ghc-cookie.changes 2016-04-30 23:30:16.000000000 +0200
@@ -1,0 +2,6 @@
+Tue Apr 26 08:12:25 UTC 2016 - mimi.vx(a)gmail.com
+
+- update to 0.4.2
+* Added SameSite
+
+-------------------------------------------------------------------
Old:
----
cookie-0.4.1.6.tar.gz
New:
----
cookie-0.4.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-cookie.spec ++++++
--- /var/tmp/diff_new_pack.IgegJH/_old 2016-04-30 23:30:16.000000000 +0200
+++ /var/tmp/diff_new_pack.IgegJH/_new 2016-04-30 23:30:16.000000000 +0200
@@ -19,7 +19,7 @@
%global pkg_name cookie
Name: ghc-cookie
-Version: 0.4.1.6
+Version: 0.4.2
Release: 0
Summary: HTTP cookie parsing and rendering
License: BSD-2-Clause
@@ -77,5 +77,6 @@
%files devel -f %{name}-devel.files
%defattr(-,root,root,-)
+%doc README.md ChangeLog.md
%changelog
++++++ cookie-0.4.1.6.tar.gz -> cookie-0.4.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cookie-0.4.1.6/ChangeLog.md new/cookie-0.4.2/ChangeLog.md
--- old/cookie-0.4.1.6/ChangeLog.md 1970-01-01 01:00:00.000000000 +0100
+++ new/cookie-0.4.2/ChangeLog.md 2016-04-20 07:22:10.000000000 +0200
@@ -0,0 +1,3 @@
+## 0.4.2
+
+* Added SameSite [#13](https://github.com/snoyberg/cookie/pull/13)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cookie-0.4.1.6/README.md new/cookie-0.4.2/README.md
--- old/cookie-0.4.1.6/README.md 1970-01-01 01:00:00.000000000 +0100
+++ new/cookie-0.4.2/README.md 2016-04-20 07:22:10.000000000 +0200
@@ -0,0 +1,5 @@
+## cookie
+
+[![Build Status](https://travis-ci.org/snoyberg/cookie.svg?branch=master)](https://t…
+
+HTTP cookie parsing and rendering
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cookie-0.4.1.6/Web/Cookie.hs new/cookie-0.4.2/Web/Cookie.hs
--- old/cookie-0.4.1.6/Web/Cookie.hs 2015-06-23 10:20:33.000000000 +0200
+++ new/cookie-0.4.2/Web/Cookie.hs 2016-04-20 07:22:10.000000000 +0200
@@ -12,6 +12,10 @@
, setCookieDomain
, setCookieHttpOnly
, setCookieSecure
+ , setCookieSameSite
+ , SameSiteOption
+ , sameSiteLax
+ , sameSiteStrict
-- ** Functions
, parseSetCookie
, renderSetCookie
@@ -100,7 +104,7 @@
`mappend` fromByteString v
-- | Data type representing the key-value pair to use for a cookie, as well as configuration options for it.
--
--- ==== Creating a SetCookie
+-- ==== Creating a SetCookie
--
-- 'SetCookie' does not export a constructor; instead, use the 'Default' instance to create one and override values (see <http://www.yesodweb.com/book/settings-types> for details):
--
@@ -122,11 +126,24 @@
, setCookieDomain :: Maybe S.ByteString -- ^ The domain for which the cookie should be sent. Default value: @Nothing@ (The browser defaults to the current domain).
, setCookieHttpOnly :: Bool -- ^ Marks the cookie as "HTTP only", i.e. not accessible from Javascript. Default value: @False@
, setCookieSecure :: Bool -- ^ Instructs the browser to only send the cookie over HTTPS. Default value: @False@
+ , setCookieSameSite :: Maybe SameSiteOption -- ^ Marks the cookie as "same site", i.e. should not be sent with cross-site requests. Default value: @Nothing@
}
deriving (Eq, Show)
+-- | Data type representing the options for a SameSite cookie
+data SameSiteOption = Lax | Strict deriving (Show, Eq)
+
+instance NFData SameSiteOption where
+ rnf x = x `seq` ()
+
+sameSiteLax :: SameSiteOption
+sameSiteLax = Lax
+
+sameSiteStrict :: SameSiteOption
+sameSiteStrict = Strict
+
instance NFData SetCookie where
- rnf (SetCookie a b c d e f g h) =
+ rnf (SetCookie a b c d e f g h i) =
a `seq`
b `seq`
rnfMBS c `seq`
@@ -134,7 +151,8 @@
rnf e `seq`
rnfMBS f `seq`
rnf g `seq`
- rnf h
+ rnf h `seq`
+ rnf i
where
-- For backwards compatibility
rnfMBS Nothing = ()
@@ -150,6 +168,7 @@
, setCookieDomain = Nothing
, setCookieHttpOnly = False
, setCookieSecure = False
+ , setCookieSameSite = Nothing
}
renderSetCookie :: SetCookie -> Builder
@@ -179,6 +198,10 @@
, if setCookieSecure sc
then copyByteString "; Secure"
else mempty
+ , case setCookieSameSite sc of
+ Nothing -> mempty
+ Just Lax -> copyByteString "; SameSite=Lax"
+ Just Strict -> copyByteString "; SameSite=Strict"
]
parseSetCookie :: S.ByteString -> SetCookie
@@ -193,6 +216,10 @@
, setCookieDomain = lookup "domain" flags
, setCookieHttpOnly = isJust $ lookup "httponly" flags
, setCookieSecure = isJust $ lookup "secure" flags
+ , setCookieSameSite = case lookup "samesite" flags of
+ Just "Lax" -> Just Lax
+ Just "Strict" -> Just Strict
+ _ -> Nothing
}
where
pairs = map (parsePair . dropSpace) $ S.split 59 a ++ [S8.empty] -- 59 = semicolon
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cookie-0.4.1.6/cookie.cabal new/cookie-0.4.2/cookie.cabal
--- old/cookie-0.4.1.6/cookie.cabal 2015-06-23 10:20:33.000000000 +0200
+++ new/cookie-0.4.2/cookie.cabal 2016-04-20 07:22:10.000000000 +0200
@@ -1,15 +1,17 @@
name: cookie
-version: 0.4.1.6
+version: 0.4.2
license: BSD3
license-file: LICENSE
author: Michael Snoyman <michael(a)snoyman.com>
maintainer: Michael Snoyman <michael(a)snoyman.com>
synopsis: HTTP cookie parsing and rendering
+description: Hackage documentation generation is not reliable. For up to date documentation, please see: <https://www.stackage.org/package/cookie>.
category: Web, Yesod
stability: Stable
cabal-version: >= 1.8
build-type: Simple
homepage: http://github.com/snoyberg/cookie
+extra-source-files: README.md ChangeLog.md
library
build-depends: base >= 4 && < 5
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cookie-0.4.1.6/test/Spec.hs new/cookie-0.4.2/test/Spec.hs
--- old/cookie-0.4.1.6/test/Spec.hs 2015-06-23 10:20:33.000000000 +0200
+++ new/cookie-0.4.2/test/Spec.hs 2016-04-20 07:22:10.000000000 +0200
@@ -52,6 +52,9 @@
showList = (++) . show . concatMap show
instance Arbitrary Char' where
arbitrary = fmap (Char' . toEnum) $ choose (62, 125)
+newtype SameSiteOption' = SameSiteOption' { unSameSiteOption' :: SameSiteOption }
+instance Arbitrary SameSiteOption' where
+ arbitrary = fmap SameSiteOption' (elements [sameSiteLax, sameSiteStrict])
propParseRenderSetCookie :: SetCookie -> Bool
propParseRenderSetCookie sc =
@@ -67,6 +70,7 @@
domain <- fmap (fmap fromUnChars) arbitrary
httponly <- arbitrary
secure <- arbitrary
+ sameSite <- fmap (fmap unSameSiteOption') arbitrary
return def
{ setCookieName = name
, setCookieValue = value
@@ -75,6 +79,7 @@
, setCookieDomain = domain
, setCookieHttpOnly = httponly
, setCookieSecure = secure
+ , setCookieSameSite = sameSite
}
caseParseCookies :: Assertion
1
0
Hello community,
here is the log from the commit of package ghc-blaze-builder for openSUSE:Factory checked in at 2016-04-30 23:30:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-blaze-builder (Old)
and /work/SRC/openSUSE:Factory/.ghc-blaze-builder.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-blaze-builder"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-blaze-builder/ghc-blaze-builder.changes 2015-05-21 08:11:09.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-blaze-builder.new/ghc-blaze-builder.changes 2016-04-30 23:30:13.000000000 +0200
@@ -1,0 +2,7 @@
+Tue Apr 19 12:18:49 UTC 2016 - mimi.vx(a)gmail.com
+
+- update to 0.4.0.2
+- remove useless _service
+* Fixed warnings on GHC 7.10
+
+-------------------------------------------------------------------
Old:
----
_service
blaze-builder-0.4.0.1.tar.gz
New:
----
blaze-builder-0.4.0.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-blaze-builder.spec ++++++
--- /var/tmp/diff_new_pack.WjXPQe/_old 2016-04-30 23:30:13.000000000 +0200
+++ /var/tmp/diff_new_pack.WjXPQe/_new 2016-04-30 23:30:13.000000000 +0200
@@ -19,7 +19,7 @@
%global pkg_name blaze-builder
Name: ghc-blaze-builder
-Version: 0.4.0.1
+Version: 0.4.0.2
Release: 0
Summary: Haskell library for efficient buffered output
License: BSD-3-Clause
++++++ blaze-builder-0.4.0.1.tar.gz -> blaze-builder-0.4.0.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blaze-builder-0.4.0.1/Blaze/ByteString/Builder/Compat/Write.hs new/blaze-builder-0.4.0.2/Blaze/ByteString/Builder/Compat/Write.hs
--- old/blaze-builder-0.4.0.1/Blaze/ByteString/Builder/Compat/Write.hs 2015-02-24 00:32:49.000000000 +0100
+++ new/blaze-builder-0.4.0.2/Blaze/ByteString/Builder/Compat/Write.hs 2016-04-18 21:47:02.000000000 +0200
@@ -16,9 +16,10 @@
, writePrimBounded
) where
-import Foreign
-import Data.ByteString.Builder.Prim.Internal
-import Blaze.ByteString.Builder.Internal.Write
+import Data.ByteString.Builder.Prim.Internal (BoundedPrim, FixedPrim
+ , runB, runF, size, sizeBound)
+import Blaze.ByteString.Builder.Internal.Write (Poke(..), Write
+ , boundedWrite, exactWrite)
writePrimFixed :: FixedPrim a -> a -> Write
writePrimFixed fe a = exactWrite (size fe) (runF fe a)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blaze-builder-0.4.0.1/Blaze/ByteString/Builder/HTTP.hs new/blaze-builder-0.4.0.2/Blaze/ByteString/Builder/HTTP.hs
--- old/blaze-builder-0.4.0.1/Blaze/ByteString/Builder/HTTP.hs 2015-02-24 00:32:49.000000000 +0100
+++ new/blaze-builder-0.4.0.2/Blaze/ByteString/Builder/HTTP.hs 2016-04-18 21:47:02.000000000 +0200
@@ -1,4 +1,4 @@
-{-# LANGUAGE BangPatterns, CPP, MagicHash, OverloadedStrings, MonoPatBinds #-}
+{-# LANGUAGE BangPatterns, CPP, MagicHash, OverloadedStrings #-}
------------------------------------------------------------------------------
-- |
-- Module: Blaze.ByteString.Builder.HTTP
@@ -30,7 +30,6 @@
import Foreign
-import Data.Monoid
import qualified Data.ByteString as S
import Data.ByteString.Char8 ()
@@ -41,6 +40,10 @@
import qualified Blaze.ByteString.Builder.Char8 as Char8
+#if !MIN_VERSION_base(4,8,0)
+import Data.Monoid
+#endif
+
{-# INLINE shiftr_w32 #-}
shiftr_w32 :: Word32 -> Int -> Word32
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blaze-builder-0.4.0.1/Blaze/ByteString/Builder/Internal/Write.hs new/blaze-builder-0.4.0.2/Blaze/ByteString/Builder/Internal/Write.hs
--- old/blaze-builder-0.4.0.1/Blaze/ByteString/Builder/Internal/Write.hs 2015-02-24 00:32:49.000000000 +0100
+++ new/blaze-builder-0.4.0.2/Blaze/ByteString/Builder/Internal/Write.hs 2016-04-18 21:47:02.000000000 +0200
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP, BangPatterns, MonoPatBinds #-}
+{-# LANGUAGE CPP, BangPatterns #-}
-- |
-- Module : Blaze.ByteString.Builder.Internal.Poke
@@ -49,12 +49,14 @@
import Foreign
-import Data.Monoid
-
import Control.Monad
import Data.ByteString.Builder.Internal
+#if !MIN_VERSION_base(4,8,0)
+import Data.Monoid
+#endif
+
------------------------------------------------------------------------------
-- Poking a buffer and writing to a buffer
------------------------------------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blaze-builder-0.4.0.1/CHANGES new/blaze-builder-0.4.0.2/CHANGES
--- old/blaze-builder-0.4.0.1/CHANGES 2015-02-24 00:32:49.000000000 +0100
+++ new/blaze-builder-0.4.0.2/CHANGES 2016-04-18 21:47:02.000000000 +0200
@@ -1,3 +1,6 @@
+* 0.4.0.2
+ - Fixed warnings on GHC 7.10, courtesy of Mikhail Glushenkov.
+
* 0.4.0.1
- Tightened the version constraints on the bytestring package for GHC 7.8
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blaze-builder-0.4.0.1/blaze-builder.cabal new/blaze-builder-0.4.0.2/blaze-builder.cabal
--- old/blaze-builder-0.4.0.1/blaze-builder.cabal 2015-02-24 00:32:49.000000000 +0100
+++ new/blaze-builder-0.4.0.2/blaze-builder.cabal 2016-04-18 21:47:02.000000000 +0200
@@ -1,5 +1,5 @@
Name: blaze-builder
-Version: 0.4.0.1
+Version: 0.4.0.2
Synopsis: Efficient buffered output.
Description:
@@ -51,7 +51,7 @@
Source-repository head
Type: git
- Location: https://github.com/meiersi/blaze-builder.git
+ Location: https://github.com/lpsmith/blaze-builder.git
Library
ghc-options: -Wall
1
0
Hello community,
here is the log from the commit of package ghc-auto-update for openSUSE:Factory checked in at 2016-04-30 23:30:10
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-auto-update (Old)
and /work/SRC/openSUSE:Factory/.ghc-auto-update.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-auto-update"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-auto-update/ghc-auto-update.changes 2016-01-07 00:25:28.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-auto-update.new/ghc-auto-update.changes 2016-04-30 23:30:12.000000000 +0200
@@ -1,0 +2,6 @@
+Tue Apr 26 08:09:36 UTC 2016 - mimi.vx(a)gmail.com
+
+- update to 0.1.3.1
+* Doc improvements
+
+-------------------------------------------------------------------
Old:
----
auto-update-0.1.3.tar.gz
New:
----
auto-update-0.1.3.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-auto-update.spec ++++++
--- /var/tmp/diff_new_pack.azeNDe/_old 2016-04-30 23:30:12.000000000 +0200
+++ /var/tmp/diff_new_pack.azeNDe/_new 2016-04-30 23:30:12.000000000 +0200
@@ -19,7 +19,7 @@
%global pkg_name auto-update
Name: ghc-auto-update
-Version: 0.1.3
+Version: 0.1.3.1
Release: 0
Summary: Efficiently run periodic, on-demand actions
License: MIT
++++++ auto-update-0.1.3.tar.gz -> auto-update-0.1.3.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/auto-update-0.1.3/ChangeLog.md new/auto-update-0.1.3.1/ChangeLog.md
--- old/auto-update-0.1.3/ChangeLog.md 2015-12-16 07:13:54.000000000 +0100
+++ new/auto-update-0.1.3.1/ChangeLog.md 2016-04-25 15:26:28.000000000 +0200
@@ -1,2 +1,11 @@
-__0.1.3__ Adding a new AIP - reaperKill
-__0.1.2__ Added Control.Debounce
+## 0.1.3.1
+
+* Doc improvements
+
+## 0.1.3
+
+* Adding a new AIP - reaperKill
+
+## 0.1.2
+
+* Added Control.Debounce
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/auto-update-0.1.3/Control/AutoUpdate.hs new/auto-update-0.1.3.1/Control/AutoUpdate.hs
--- old/auto-update-0.1.3/Control/AutoUpdate.hs 2015-12-16 07:13:54.000000000 +0100
+++ new/auto-update-0.1.3.1/Control/AutoUpdate.hs 2016-04-24 15:33:08.000000000 +0200
@@ -1,21 +1,40 @@
--- | A common problem is the desire to have an action run at a scheduled
--- interval, but only if it is needed. For example, instead of having
--- every web request result in a new @getCurrentTime@ call, we'd like to
--- have a single worker thread run every second, updating an @IORef@.
--- However, if the request frequency is less than once per second, this is
--- a pessimization, and worse, kills idle GC.
---
--- This library allows you to define actions which will either be
--- performed by a dedicated thread or, in times of low volume, will be
--- executed by the calling thread.
+-- | In a multithreaded environment, running actions on a regularly scheduled
+-- background thread can dramatically improve performance.
+-- For example, web servers need to return the current time with each HTTP response.
+-- For a high-volume server, it's much faster for a dedicated thread to run every
+-- second, and write the current time to a shared 'IORef', than it is for each
+-- request to make its own call to 'getCurrentTime'.
+--
+-- But for a low-volume server, whose request frequency is less than once per
+-- second, that approach will result in /more/ calls to 'getCurrentTime' than
+-- necessary, and worse, kills idle GC.
+--
+-- This library solves that problem by allowing you to define actions which will
+-- either be performed by a dedicated thread, or, in times of low volume, will
+-- be executed by the calling thread.
+--
+-- Example usage:
+--
+-- @
+-- import "Data.Time"
+-- import "Control.AutoUpdate"
+--
+-- getTime <- 'mkAutoUpdate' 'defaultUpdateSettings'
+-- { 'updateAction' = 'Data.Time.Clock.getCurrentTime'
+-- , 'updateFreq' = 1000000 -- The default frequency, once per second
+-- }
+-- currentTime <- getTime
+-- @
+--
+-- For more examples, <http://www.yesodweb.com/blog/2014/08/announcing-auto-update see the blog post introducing this library>.
module Control.AutoUpdate (
-- * Type
UpdateSettings
, defaultUpdateSettings
-- * Accessors
+ , updateAction
, updateFreq
, updateSpawnThreshold
- , updateAction
-- * Creation
, mkAutoUpdate
) where
@@ -27,9 +46,9 @@
import Control.Monad (void)
import Data.IORef (newIORef, readIORef, writeIORef)
--- | Default value for creating an @UpdateSettings@.
+-- | Default value for creating an 'UpdateSettings'.
--
--- Since 0.1.0
+-- @since 0.1.0
defaultUpdateSettings :: UpdateSettings ()
defaultUpdateSettings = UpdateSettings
{ updateFreq = 1000000
@@ -39,44 +58,44 @@
-- | Settings to control how values are updated.
--
--- This should be constructed using @defaultUpdateSettings@ and record
+-- This should be constructed using 'defaultUpdateSettings' and record
-- update syntax, e.g.:
--
-- @
--- let set = defaultUpdateSettings { updateAction = getCurrentTime }
+-- let settings = 'defaultUpdateSettings' { 'updateAction' = 'Data.Time.Clock.getCurrentTime' }
-- @
--
--- Since 0.1.0
+-- @since 0.1.0
data UpdateSettings a = UpdateSettings
{ updateFreq :: Int
-- ^ Microseconds between update calls. Same considerations as
- -- @threadDelay@ apply.
+ -- 'threadDelay' apply.
--
-- Default: 1 second (1000000)
--
- -- Since 0.1.0
+ -- @since 0.1.0
, updateSpawnThreshold :: Int
-- ^ NOTE: This value no longer has any effect, since worker threads are
-- dedicated instead of spawned on demand.
--
- -- Previously, this determined: How many times the data must be requested
+ -- Previously, this determined how many times the data must be requested
-- before we decide to spawn a dedicated thread.
--
-- Default: 3
--
- -- Since 0.1.0
+ -- @since 0.1.0
, updateAction :: IO a
-- ^ Action to be performed to get the current value.
--
-- Default: does nothing.
--
- -- Since 0.1.0
+ -- @since 0.1.0
}
-- | Generate an action which will either read from an automatically
-- updated value, or run the update action in the current thread.
--
--- Since 0.1.0
+-- @since 0.1.0
mkAutoUpdate :: UpdateSettings a -> IO (IO a)
mkAutoUpdate us = do
-- A baton to tell the worker thread to generate a new value.
@@ -158,7 +177,7 @@
-- we have a current value, use it
Right val -> return val
--- | Turn a runtime exception into an impure exception, so that all @IO@
+-- | Turn a runtime exception into an impure exception, so that all 'IO'
-- actions will complete successfully. This simply defers the exception until
-- the value is forced.
catchSome :: IO a -> IO a
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/auto-update-0.1.3/Control/Debounce.hs new/auto-update-0.1.3.1/Control/Debounce.hs
--- old/auto-update-0.1.3/Control/Debounce.hs 2015-12-16 07:13:54.000000000 +0100
+++ new/auto-update-0.1.3.1/Control/Debounce.hs 2016-04-24 15:33:08.000000000 +0200
@@ -3,10 +3,26 @@
-- period of time.
--
-- This is useful as an optimization, for example to ensure that logs are only
--- flushed to disk at most once per second. See the fast-logger package for an
--- example usage.
+-- flushed to disk at most once per second.
--
--- Since 0.1.2
+-- Example usage:
+--
+-- @
+-- printString <- 'mkDebounce' 'defaultDebounceSettings'
+-- { 'debounceAction' = putStrLn "Running action"
+-- , 'debounceFreq' = 5000000 -- 5 seconds
+-- }
+-- @
+--
+-- >>> printString
+-- Running action
+-- >>> printString
+-- <Wait five seconds>
+-- Running action
+--
+-- See the fast-logger package ("System.Log.FastLogger") for real-world usage.
+--
+-- @since 0.1.2
module Control.Debounce
( -- * Type
DebounceSettings
@@ -25,14 +41,14 @@
-- | Settings to control how debouncing should work.
--
--- This should be constructed using @defaultDebounceSettings@ and record
+-- This should be constructed using 'defaultDebounceSettings' and record
-- update syntax, e.g.:
--
-- @
--- let set = defaultDebounceSettings { debounceAction = flushLog }
+-- let settings = 'defaultDebounceSettings' { 'debounceAction' = flushLog }
-- @
--
--- Since 0.1.2
+-- @since 0.1.2
data DebounceSettings = DebounceSettings
{ debounceFreq :: Int
-- ^ Microseconds lag required between subsequence calls to the debounced
@@ -40,7 +56,7 @@
--
-- Default: 1 second (1000000)
--
- -- Since 0.1.2
+ -- @since 0.1.2
, debounceAction :: IO ()
-- ^ Action to be performed.
--
@@ -48,12 +64,12 @@
--
-- Default: does nothing.
--
- -- Since 0.1.2
+ -- @since 0.1.2
}
--- | Default value for creating a @DebounceSettings@.
+-- | Default value for creating a 'DebounceSettings'.
--
--- Since 0.1.2
+-- @since 0.1.2
defaultDebounceSettings :: DebounceSettings
defaultDebounceSettings = DebounceSettings
{ debounceFreq = 1000000
@@ -64,7 +80,7 @@
-- performed. The action will either be performed immediately, or after the
-- current cooldown period has expired.
--
--- Since 0.1.2
+-- @since 0.1.2
mkDebounce :: DebounceSettings -> IO (IO ())
mkDebounce (DebounceSettings freq action) = do
baton <- newEmptyMVar
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/auto-update-0.1.3/Control/Reaper.hs new/auto-update-0.1.3.1/Control/Reaper.hs
--- old/auto-update-0.1.3/Control/Reaper.hs 2015-12-16 07:13:54.000000000 +0100
+++ new/auto-update-0.1.3.1/Control/Reaper.hs 2016-04-25 15:20:34.000000000 +0200
@@ -3,8 +3,18 @@
-- | This module provides the ability to create reapers: dedicated cleanup
-- threads. These threads will automatically spawn and die based on the
--- presence of a workload to process on.
+-- presence of a workload to process on. Example uses include:
+--
+-- * Killing long-running jobs
+-- * Closing unused connections in a connection pool
+-- * Pruning a cache of old items (see example below)
+--
+-- For real-world usage, search the <https://github.com/yesodweb/wai WAI family of packages>
+-- for imports of "Control.Reaper".
module Control.Reaper (
+ -- * Example: Regularly cleaning a cache
+ -- $example1
+
-- * Settings
ReaperSettings
, defaultReaperSettings
@@ -33,7 +43,7 @@
-- be a list of @item@s. This is encouraged by 'defaultReaperSettings' and
-- 'mkListAction'.
--
--- Since 0.1.1
+-- @since 0.1.1
data ReaperSettings workload item = ReaperSettings
{ reaperAction :: workload -> IO (workload -> workload)
-- ^ The action to perform on a workload. The result of this is a
@@ -46,38 +56,38 @@
-- temporary workload. This is incredibly useless; you should
-- definitely override this default.
--
- -- Since 0.1.1
+ -- @since 0.1.1
, reaperDelay :: {-# UNPACK #-} !Int
-- ^ Number of microseconds to delay between calls of 'reaperAction'.
--
-- Default: 30 seconds.
--
- -- Since 0.1.1
+ -- @since 0.1.1
, reaperCons :: item -> workload -> workload
-- ^ Add an item onto a workload.
--
-- Default: list consing.
--
- -- Since 0.1.1
+ -- @since 0.1.1
, reaperNull :: workload -> Bool
-- ^ Check if a workload is empty, in which case the worker thread
-- will shut down.
--
-- Default: 'null'.
--
- -- Since 0.1.1
+ -- @since 0.1.1
, reaperEmpty :: workload
-- ^ An empty workload.
--
-- Default: empty list.
--
- -- Since 0.1.1
+ -- @since 0.1.1
}
-- | Default @ReaperSettings@ value, biased towards having a list of work
-- items.
--
--- Since 0.1.1
+-- @since 0.1.1
defaultReaperSettings :: ReaperSettings [item] item
defaultReaperSettings = ReaperSettings
{ reaperAction = \wl -> return (wl ++)
@@ -104,11 +114,11 @@
data State workload = NoReaper -- ^ No reaper thread
| Workload workload -- ^ The current jobs
--- | Create a reaper addition function. This funciton can be used to add
+-- | Create a reaper addition function. This function can be used to add
-- new items to the workload. Spawning of reaper threads will be handled
-- for you automatically.
--
--- Since 0.1.1
+-- @since 0.1.1
mkReaper :: ReaperSettings workload item -> IO (Reaper workload item)
mkReaper settings@ReaperSettings{..} = do
stateRef <- newIORef NoReaper
@@ -187,7 +197,7 @@
-- return either a new work item, or @Nothing@ if the work item is
-- expired.
--
--- Since 0.1.1
+-- @since 0.1.1
mkListAction :: (item -> IO (Maybe item'))
-> [item]
-> IO ([item'] -> [item'])
@@ -202,3 +212,68 @@
Nothing -> front
Just y -> front . (y:)
go front' xs
+
+-- $example1
+-- In this example code, we use a 'Data.Map.Strict.Map' to cache fibonacci numbers, and a 'Reaper' to prune the cache.
+--
+-- The @main@ function first creates a 'Reaper', with fields to initialize the
+-- cache ('reaperEmpty'), add items to it ('reaperCons'), and prune it ('reaperAction').
+-- The reaper will run every two seconds ('reaperDelay'), but will stop running while
+-- 'reaperNull' is true.
+--
+-- @main@ then loops infinitely ('Control.Monad.forever'). Each second it calculates the fibonacci number
+-- for a value between 30 and 34, first trying the cache ('reaperRead' and 'Data.Map.Strict.lookup'),
+-- then falling back to manually calculating it (@fib@)
+-- and updating the cache with the result ('reaperAdd')
+--
+-- @clean@ simply removes items cached for more than 10 seconds.
+-- This function is where you would perform IO-related cleanup,
+-- like killing threads or closing connections, if that was the purpose of your reaper.
+--
+-- @
+-- module Main where
+--
+-- import "Data.Time" (UTCTime, getCurrentTime, diffUTCTime)
+-- import "Control.Reaper"
+-- import "Control.Concurrent" (threadDelay)
+-- import "Data.Map.Strict" (Map)
+-- import qualified "Data.Map.Strict" as Map
+-- import "Control.Monad" (forever)
+-- import "System.Random" (getStdRandom, randomR)
+--
+-- fib :: 'Int' -> 'Int'
+-- fib 0 = 0
+-- fib 1 = 1
+-- fib n = fib (n-1) + fib (n-2)
+--
+-- type Cache = 'Data.Map.Strict.Map' 'Int' ('Int', 'Data.Time.Clock.UTCTime')
+--
+-- main :: IO ()
+-- main = do
+-- reaper <- 'mkReaper' 'defaultReaperSettings'
+-- { 'reaperEmpty' = Map.'Data.Map.Strict.empty'
+-- , 'reaperCons' = \\(k, v, time) workload -> Map.'Data.Map.Strict.insert' k (v, time) workload
+-- , 'reaperAction' = clean
+-- , 'reaperDelay' = 1000000 * 2 -- Clean every 2 seconds
+-- , 'reaperNull' = Map.'Data.Map.Strict.null'
+-- }
+-- forever $ do
+-- fibArg <- 'System.Random.getStdRandom' ('System.Random.randomR' (30,34))
+-- cache <- 'reaperRead' reaper
+-- let cachedResult = Map.'Data.Map.Strict.lookup' fibArg cache
+-- case cachedResult of
+-- 'Just' (fibResult, _createdAt) -> 'putStrLn' $ "Found in cache: `fib " ++ 'show' fibArg ++ "` " ++ 'show' fibResult
+-- 'Nothing' -> do
+-- let fibResult = fib fibArg
+-- 'putStrLn' $ "Calculating `fib " ++ 'show' fibArg ++ "` " ++ 'show' fibResult
+-- time <- 'Data.Time.Clock.getCurrentTime'
+-- ('reaperAdd' reaper) (fibArg, fibResult, time)
+-- 'threadDelay' 1000000 -- 1 second
+--
+-- -- Remove items > 10 seconds old
+-- clean :: Cache -> IO (Cache -> Cache)
+-- clean oldMap = do
+-- currentTime <- 'Data.Time.Clock.getCurrentTime'
+-- let pruned = Map.'Data.Map.Strict.filter' (\\(_, createdAt) -> currentTime \`diffUTCTime\` createdAt < 10.0) oldMap
+-- return (\\newData -> Map.'Data.Map.Strict.union' pruned newData)
+-- @
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/auto-update-0.1.3/auto-update.cabal new/auto-update-0.1.3.1/auto-update.cabal
--- old/auto-update-0.1.3/auto-update.cabal 2015-12-16 07:13:54.000000000 +0100
+++ new/auto-update-0.1.3.1/auto-update.cabal 2016-04-25 15:26:32.000000000 +0200
@@ -1,5 +1,5 @@
name: auto-update
-version: 0.1.3
+version: 0.1.3.1
synopsis: Efficiently run periodic, on-demand actions
description: API docs and the README are available at <http://www.stackage.org/package/auto-update>.
homepage: https://github.com/yesodweb/wai
1
0
Hello community,
here is the log from the commit of package ghc-attoparsec for openSUSE:Factory checked in at 2016-04-30 23:30:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-attoparsec (Old)
and /work/SRC/openSUSE:Factory/.ghc-attoparsec.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-attoparsec"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-attoparsec/ghc-attoparsec.changes 2016-01-08 15:22:39.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-attoparsec.new/ghc-attoparsec.changes 2016-04-30 23:30:09.000000000 +0200
@@ -1,0 +2,9 @@
+Tue Apr 26 07:59:37 UTC 2016 - mimi.vx(a)gmail.com
+
+- update to 0.13.0.2
+- remove useless _service
+* Restore the fast specialised character set implementation for Text
+* Move testsuite from test-framework to tasty
+* Performance optimization of takeWhile and takeWhile1
+
+-------------------------------------------------------------------
Old:
----
_service
attoparsec-0.13.0.1.tar.gz
New:
----
attoparsec-0.13.0.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-attoparsec.spec ++++++
--- /var/tmp/diff_new_pack.2CO8XX/_old 2016-04-30 23:30:10.000000000 +0200
+++ /var/tmp/diff_new_pack.2CO8XX/_new 2016-04-30 23:30:10.000000000 +0200
@@ -20,15 +20,15 @@
%bcond_with tests
-Name: ghc-%{pkg_name}
-Version: 0.13.0.1
+Name: ghc-attoparsec
+Version: 0.13.0.2
Release: 0
Summary: Fast combinator parsing for bytestrings and text
License: BSD-3-Clause
Group: System/Libraries
-Url: http://hackage.haskell.org/package/%{pkg_name}
-Source0: http://hackage.haskell.org/packages/archive/%{pkg_name}/%{version}/%{pkg_na…
+Url: https://hackage.haskell.org/package/%{pkg_name}
+Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{ve…
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: ghc-Cabal-devel
@@ -44,8 +44,8 @@
%if %{with tests}
BuildRequires: ghc-QuickCheck-devel
BuildRequires: ghc-quickcheck-unicode-devel
-BuildRequires: ghc-test-framework-devel
-BuildRequires: ghc-test-framework-quickcheck2-devel
+BuildRequires: ghc-tasty-devel
+BuildRequires: ghc-tasty-quickcheck-devel
BuildRequires: ghc-vector-devel
%endif
# End cabal-rpm deps
@@ -58,7 +58,6 @@
%package devel
Summary: Haskell %{pkg_name} library development files
Group: Development/Libraries/Other
-Provides: %{name}-static = %{version}-%{release}
Requires: ghc-compiler = %{ghc_version}
Requires(post): ghc-compiler = %{ghc_version}
Requires(postun): ghc-compiler = %{ghc_version}
++++++ attoparsec-0.13.0.1.tar.gz -> attoparsec-0.13.0.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attoparsec-0.13.0.1/Data/Attoparsec/ByteString/Internal.hs new/attoparsec-0.13.0.2/Data/Attoparsec/ByteString/Internal.hs
--- old/attoparsec-0.13.0.1/Data/Attoparsec/ByteString/Internal.hs 2015-07-09 02:08:52.000000000 +0200
+++ new/attoparsec-0.13.0.2/Data/Attoparsec/ByteString/Internal.hs 2016-04-22 02:38:31.000000000 +0200
@@ -257,15 +257,24 @@
-- parsers loop until a failure occurs. Careless use will thus result
-- in an infinite loop.
takeWhile :: (Word8 -> Bool) -> Parser ByteString
-takeWhile p = (B.concat . reverse) `fmap` go []
+takeWhile p = do
+ s <- B8.takeWhile p <$> get
+ continue <- inputSpansChunks (B.length s)
+ if continue
+ then takeWhileAcc p [s]
+ else return s
+{-# INLINE takeWhile #-}
+
+takeWhileAcc :: (Word8 -> Bool) -> [ByteString] -> Parser ByteString
+takeWhileAcc p = go
where
go acc = do
s <- B8.takeWhile p <$> get
continue <- inputSpansChunks (B.length s)
if continue
then go (s:acc)
- else return (s:acc)
-{-# INLINE takeWhile #-}
+ else return $ concatReverse (s:acc)
+{-# INLINE takeWhileAcc #-}
takeRest :: Parser [ByteString]
takeRest = go []
@@ -329,16 +338,13 @@
-- parsers loop until a failure occurs. Careless use will thus result
-- in an infinite loop.
scan :: s -> (s -> Word8 -> Maybe s) -> Parser ByteString
-scan = scan_ $ \_ chunks ->
- case chunks of
- [x] -> return x
- xs -> return $! B.concat $ reverse xs
+scan = scan_ $ \_ chunks -> return $! concatReverse chunks
{-# INLINE scan #-}
-- | Like 'scan', but generalized to return the final state of the
-- scanner.
runScanner :: s -> (s -> Word8 -> Maybe s) -> Parser (ByteString, s)
-runScanner = scan_ $ \s xs -> return (B.concat (reverse xs), s)
+runScanner = scan_ $ \s xs -> let !sx = concatReverse xs in return (sx, s)
{-# INLINE runScanner #-}
-- | Consume input as long as the predicate returns 'True', and return
@@ -358,8 +364,9 @@
advance len
eoc <- endOfChunk
if eoc
- then (s<>) `fmap` takeWhile p
+ then takeWhileAcc p [s]
else return s
+{-# INLINE takeWhile1 #-}
-- | Match any byte in a set.
--
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attoparsec-0.13.0.1/Data/Attoparsec/Internal.hs new/attoparsec-0.13.0.2/Data/Attoparsec/Internal.hs
--- old/attoparsec-0.13.0.1/Data/Attoparsec/Internal.hs 2015-07-09 02:08:52.000000000 +0200
+++ new/attoparsec-0.13.0.2/Data/Attoparsec/Internal.hs 2016-04-22 02:38:31.000000000 +0200
@@ -20,10 +20,12 @@
, endOfInput
, atEnd
, satisfyElem
+ , concatReverse
) where
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative ((<$>))
+import Data.Monoid (Monoid, mconcat)
#endif
import Data.Attoparsec.Internal.Types
import Data.ByteString (ByteString)
@@ -159,3 +161,11 @@
| otherwise -> lose t pos more [] "satisfyElem"
Nothing -> satisfySuspended p t pos more lose succ
{-# INLINE satisfyElem #-}
+
+-- | Concatenate a monoid after reversing its elements. Used to
+-- glue together a series of textual chunks that have been accumulated
+-- \"backwards\".
+concatReverse :: Monoid m => [m] -> m
+concatReverse [x] = x
+concatReverse xs = mconcat (reverse xs)
+{-# INLINE concatReverse #-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attoparsec-0.13.0.1/Data/Attoparsec/Text/Buffer.hs new/attoparsec-0.13.0.2/Data/Attoparsec/Text/Buffer.hs
--- old/attoparsec-0.13.0.1/Data/Attoparsec/Text/Buffer.hs 2015-07-09 02:08:52.000000000 +0200
+++ new/attoparsec-0.13.0.2/Data/Attoparsec/Text/Buffer.hs 2016-04-22 02:38:31.000000000 +0200
@@ -82,10 +82,12 @@
instance Monoid Buffer where
mempty = Buf A.empty 0 0 0 0
+ {-# INLINE mempty #-}
mappend (Buf _ _ _ 0 _) b = b
mappend a (Buf _ _ _ 0 _) = a
mappend buf (Buf arr off len _ _) = append buf arr off len
+ {-# INLINE mappend #-}
mconcat [] = mempty
mconcat xs = foldl1' mappend xs
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attoparsec-0.13.0.1/Data/Attoparsec/Text/FastSet.hs new/attoparsec-0.13.0.2/Data/Attoparsec/Text/FastSet.hs
--- old/attoparsec-0.13.0.1/Data/Attoparsec/Text/FastSet.hs 2015-07-09 02:08:52.000000000 +0200
+++ new/attoparsec-0.13.0.2/Data/Attoparsec/Text/FastSet.hs 2016-04-22 02:38:31.000000000 +0200
@@ -1,38 +1,118 @@
+{-# LANGUAGE BangPatterns #-}
+
+------------------------------------------------------------------------------
-- |
--- Module : Data.Attoparsec.Text.FastSet
--- Copyright : Bryan O'Sullivan 2015
+-- Module : Data.Attoparsec.FastSet
+-- Copyright : Felipe Lessa 2010, Bryan O'Sullivan 2007-2015
-- License : BSD3
--
--- Maintainer : bos(a)serpentine.com
+-- Maintainer : felipe.lessa(a)gmail.com
-- Stability : experimental
-- Portability : unknown
--
--- Fast set membership tests for 'Char' values.
-
+-- Fast set membership tests for 'Char' values. We test for
+-- membership using a hashtable implemented with Robin Hood
+-- collision resolution. The set representation is unboxed,
+-- and the characters and hashes interleaved, for efficiency.
+--
+--
+-----------------------------------------------------------------------------
module Data.Attoparsec.Text.FastSet
(
-- * Data type
FastSet
-- * Construction
, fromList
+ , set
-- * Lookup
, member
-- * Handy interface
, charClass
) where
-import qualified Data.IntSet as I
-import Data.Char (ord)
+import Data.Bits ((.|.), (.&.), shiftR)
+import Data.Function (on)
+import Data.List (sort, sortBy)
+import qualified Data.Array.Base as AB
+import qualified Data.Array.Unboxed as A
+import qualified Data.Text as T
+
+data FastSet = FastSet {
+ table :: {-# UNPACK #-} !(A.UArray Int Int)
+ , mask :: {-# UNPACK #-} !Int
+ }
+
+data Entry = Entry {
+ key :: {-# UNPACK #-} !Char
+ , initialIndex :: {-# UNPACK #-} !Int
+ , index :: {-# UNPACK #-} !Int
+ }
+
+offset :: Entry -> Int
+offset e = index e - initialIndex e
+
+resolveCollisions :: [Entry] -> [Entry]
+resolveCollisions [] = []
+resolveCollisions [e] = [e]
+resolveCollisions (a:b:entries) = a' : resolveCollisions (b' : entries)
+ where (a', b')
+ | index a < index b = (a, b)
+ | offset a < offset b = (b { index=index a }, a { index=index a + 1 })
+ | otherwise = (a, b { index=index a + 1 })
+
+pad :: Int -> [Entry] -> [Entry]
+pad = go 0
+ where -- ensure that we pad enough so that lookups beyond the
+ -- last hash in the table fall within the array
+ go !_ !m [] = replicate (max 1 m + 1) empty
+ go k m (e:entries) = map (const empty) [k..i - 1] ++ e :
+ go (i + 1) (m + i - k - 1) entries
+ where i = index e
+ empty = Entry '\0' maxBound 0
+
+nextPowerOf2 :: Int -> Int
+nextPowerOf2 0 = 1
+nextPowerOf2 x = go (x - 1) 1
+ where go y 32 = y + 1
+ go y k = go (y .|. (y `shiftR` k)) $ k * 2
-newtype FastSet = FastSet I.IntSet
+fastHash :: Char -> Int
+fastHash = fromEnum
fromList :: String -> FastSet
-fromList = FastSet . I.fromList . map ord
+fromList s = FastSet (AB.listArray (0, length interleaved - 1) interleaved)
+ mask'
+ where s' = ordNub (sort s)
+ l = length s'
+ mask' = nextPowerOf2 ((5 * l) `div` 4) - 1
+ entries = pad mask' .
+ resolveCollisions .
+ sortBy (compare `on` initialIndex) .
+ zipWith (\c i -> Entry c i i) s' .
+ map ((.&. mask') . fastHash) $ s'
+ interleaved = concatMap (\e -> [fromEnum $ key e, initialIndex e])
+ entries
+
+ordNub :: Eq a => [a] -> [a]
+ordNub [] = []
+ordNub (y:ys) = go y ys
+ where go x (z:zs)
+ | x == z = go x zs
+ | otherwise = x : go z zs
+ go x [] = [x]
+
+set :: T.Text -> FastSet
+set = fromList . T.unpack
-- | Check the set for membership.
member :: Char -> FastSet -> Bool
-member c (FastSet s) = I.member (ord c) s
-{-# INLINE member #-}
+member c a = go (2 * i)
+ where i = fastHash c .&. mask a
+ lookupAt j b = (i' <= i) && (c == c' || b)
+ where c' = toEnum $ AB.unsafeAt (table a) j
+ i' = AB.unsafeAt (table a) $ j + 1
+ go j = lookupAt j . lookupAt (j + 2) . lookupAt (j + 4) .
+ lookupAt (j + 6) . go $ j + 8
charClass :: String -> FastSet
charClass = fromList . go
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attoparsec-0.13.0.1/Data/Attoparsec/Text/Internal.hs new/attoparsec-0.13.0.2/Data/Attoparsec/Text/Internal.hs
--- old/attoparsec-0.13.0.1/Data/Attoparsec/Text/Internal.hs 2015-07-09 02:08:52.000000000 +0200
+++ new/attoparsec-0.13.0.2/Data/Attoparsec/Text/Internal.hs 2016-04-22 02:38:31.000000000 +0200
@@ -269,14 +269,25 @@
-- parsers loop until a failure occurs. Careless use will thus result
-- in an infinite loop.
takeWhile :: (Char -> Bool) -> Parser Text
-takeWhile p = (T.concat . reverse) `fmap` go []
+takeWhile p = do
+ h <- T.takeWhile p <$> get
+ continue <- inputSpansChunks (size h)
+ -- only use slow concat path if necessary
+ if continue
+ then takeWhileAcc p [h]
+ else return h
+{-# INLINE takeWhile #-}
+
+takeWhileAcc :: (Char -> Bool) -> [Text] -> Parser Text
+takeWhileAcc p = go
where
go acc = do
h <- T.takeWhile p <$> get
continue <- inputSpansChunks (size h)
if continue
then go (h:acc)
- else return (h:acc)
+ else return $ concatReverse (h:acc)
+{-# INLINE takeWhileAcc #-}
takeRest :: Parser [Text]
takeRest = go []
@@ -334,16 +345,13 @@
-- parsers loop until a failure occurs. Careless use will thus result
-- in an infinite loop.
scan :: s -> (s -> Char -> Maybe s) -> Parser Text
-scan = scan_ $ \_ chunks ->
- case chunks of
- [x] -> return x
- xs -> return . T.concat . reverse $ xs
+scan = scan_ $ \_ chunks -> return $! concatReverse chunks
{-# INLINE scan #-}
-- | Like 'scan', but generalized to return the final state of the
-- scanner.
runScanner :: s -> (s -> Char -> Maybe s) -> Parser (Text, s)
-runScanner = scan_ $ \s xs -> return (T.concat (reverse xs), s)
+runScanner = scan_ $ \s xs -> let !sx = concatReverse xs in return (sx, s)
{-# INLINE runScanner #-}
-- | Consume input as long as the predicate returns 'True', and return
@@ -361,8 +369,9 @@
advance size'
eoc <- endOfChunk
if eoc
- then (h<>) `fmap` takeWhile p
+ then takeWhileAcc p [h]
else return h
+{-# INLINE takeWhile1 #-}
-- | Match any character in a set.
--
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attoparsec-0.13.0.1/attoparsec.cabal new/attoparsec-0.13.0.2/attoparsec.cabal
--- old/attoparsec-0.13.0.1/attoparsec.cabal 2015-07-09 02:08:52.000000000 +0200
+++ new/attoparsec-0.13.0.2/attoparsec.cabal 2016-04-22 02:38:31.000000000 +0200
@@ -1,12 +1,12 @@
name: attoparsec
-version: 0.13.0.1
+version: 0.13.0.2
license: BSD3
license-file: LICENSE
category: Text, Parsing
author: Bryan O'Sullivan <bos(a)serpentine.com>
maintainer: Bryan O'Sullivan <bos(a)serpentine.com>
stability: experimental
-tested-with: GHC == 7.0, GHC == 7.2, GHC == 7.4, GHC == 7.6, GHC == 7.8, GHC == 7.10
+tested-with: GHC == 7.0.1, GHC == 7.2.1, GHC == 7.4.2, GHC ==7.6.3, GHC ==7.8.4, GHC ==7.10.3
synopsis: Fast combinator parsing for bytestrings and text
cabal-version: >= 1.8
homepage: https://github.com/bos/attoparsec
@@ -89,6 +89,7 @@
QC.Rechunked
QC.Simple
QC.Text
+ QC.Text.FastSet
ghc-options:
-Wall -threaded -rtsopts
@@ -100,13 +101,12 @@
array,
base >= 4 && < 5,
bytestring,
- containers,
deepseq >= 1.1,
QuickCheck >= 2.7,
quickcheck-unicode,
scientific,
- test-framework >= 0.8.0.2,
- test-framework-quickcheck2 >= 0.3.0.3,
+ tasty >= 0.11,
+ tasty-quickcheck >= 0.8,
text,
transformers,
vector
@@ -136,7 +136,6 @@
base == 4.*,
bytestring >= 0.10.4.0,
case-insensitive,
- containers,
criterion >= 1.0,
deepseq >= 1.1,
directory,
@@ -146,6 +145,7 @@
parsec >= 3.1.2,
scientific,
text >= 1.1.1.0,
+ transformers,
unordered-containers,
vector
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attoparsec-0.13.0.1/benchmarks/Benchmarks.hs new/attoparsec-0.13.0.2/benchmarks/Benchmarks.hs
--- old/attoparsec-0.13.0.1/benchmarks/Benchmarks.hs 2015-07-09 02:08:52.000000000 +0200
+++ new/attoparsec-0.13.0.2/benchmarks/Benchmarks.hs 2016-04-22 02:38:31.000000000 +0200
@@ -71,10 +71,14 @@
, bench "isAlpha_ascii" $ nf (ABL.parse (AC.takeWhile AC.isAlpha_ascii)) bl
, bench "isAlpha_iso8859_15" $
nf (ABL.parse (AC.takeWhile AC.isAlpha_iso8859_15)) bl
+ , bench "T isAlpha" $ nf (AT.parse (AT.takeWhile isAlpha)) t
+ , bench "TL isAlpha" $ nf (ATL.parse (AT.takeWhile isAlpha)) tl
]
, bgroup "takeWhile1" [
bench "isAlpha" $ nf (ABL.parse (AC.takeWhile1 isAlpha)) bl
, bench "isAlpha_ascii" $ nf (ABL.parse (AC.takeWhile1 AC.isAlpha_ascii)) bl
+ , bench "T isAlpha" $ nf (AT.parse (AT.takeWhile1 isAlpha)) t
+ , bench "TL isAlpha" $ nf (ATL.parse (AT.takeWhile1 isAlpha)) tl
]
, bench "word32LE" $ nf (AB.parse word32LE) b
, bgroup "scan" [
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attoparsec-0.13.0.1/benchmarks/Main.hs new/attoparsec-0.13.0.2/benchmarks/Main.hs
--- old/attoparsec-0.13.0.1/benchmarks/Main.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/attoparsec-0.13.0.2/benchmarks/Main.hs 2016-04-22 02:38:31.000000000 +0200
@@ -0,0 +1,4 @@
+import Sets
+import Criterion.Main
+
+main = defaultMain [Sets.benchmarks]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attoparsec-0.13.0.1/benchmarks/TextFastSet.hs new/attoparsec-0.13.0.2/benchmarks/TextFastSet.hs
--- old/attoparsec-0.13.0.1/benchmarks/TextFastSet.hs 2015-07-09 02:08:52.000000000 +0200
+++ new/attoparsec-0.13.0.2/benchmarks/TextFastSet.hs 2016-04-22 02:38:31.000000000 +0200
@@ -62,7 +62,9 @@
pad :: Int -> [Entry] -> [Entry]
pad = go 0
- where go !_ !m [] = replicate (max 1 m) empty
+ where -- ensure that we pad enough so that lookups beyond the
+ -- last hash in the table fall within the array
+ go !_ !m [] = replicate (max 1 m + 1) empty
go k m (e:entries) = map (const empty) [k..i - 1] ++ e :
go (i + 1) (m + i - k - 1) entries
where i = index e
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attoparsec-0.13.0.1/benchmarks/attoparsec-benchmarks.cabal new/attoparsec-0.13.0.2/benchmarks/attoparsec-benchmarks.cabal
--- old/attoparsec-0.13.0.1/benchmarks/attoparsec-benchmarks.cabal 2015-07-09 02:08:52.000000000 +0200
+++ new/attoparsec-0.13.0.2/benchmarks/attoparsec-benchmarks.cabal 2016-04-22 02:38:31.000000000 +0200
@@ -17,6 +17,7 @@
Numbers
Network.Wai.Handler.Warp.ReadInt
Sets
+ TextFastSet
Warp
hs-source-dirs: .. . warp-3.0.1.1
ghc-options: -O2 -Wall -rtsopts
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attoparsec-0.13.0.1/changelog.md new/attoparsec-0.13.0.2/changelog.md
--- old/attoparsec-0.13.0.1/changelog.md 2015-07-09 02:08:52.000000000 +0200
+++ new/attoparsec-0.13.0.2/changelog.md 2016-04-22 02:38:31.000000000 +0200
@@ -1,3 +1,9 @@
+0.13.0.2
+
+* Restore the fast specialised character set implementation for Text
+* Move testsuite from test-framework to tasty
+* Performance optimization of takeWhile and takeWhile1
+
0.13.0.1
* Fixed a bug in the implementations of inClass and notInClass for
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attoparsec-0.13.0.1/tests/QC/Buffer.hs new/attoparsec-0.13.0.2/tests/QC/Buffer.hs
--- old/attoparsec-0.13.0.1/tests/QC/Buffer.hs 2015-07-09 02:08:52.000000000 +0200
+++ new/attoparsec-0.13.0.2/tests/QC/Buffer.hs 2016-04-22 02:38:31.000000000 +0200
@@ -8,8 +8,8 @@
import Data.Monoid (Monoid(mconcat))
#endif
import QC.Common ()
-import Test.Framework (Test)
-import Test.Framework.Providers.QuickCheck2 (testProperty)
+import Test.Tasty (TestTree)
+import Test.Tasty.QuickCheck (testProperty)
import Test.QuickCheck
import qualified Data.Attoparsec.ByteString.Buffer as BB
import qualified Data.Attoparsec.Text.Buffer as BT
@@ -82,7 +82,7 @@
i <- choose (0, T.lengthWord16 t)
return $ T.dropWord16 i t === BT.dropWord16 i buf
-tests :: [Test]
+tests :: [TestTree]
tests = [
testProperty "b_unbuffer" b_unbuffer
, testProperty "t_unbuffer" t_unbuffer
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attoparsec-0.13.0.1/tests/QC/ByteString.hs new/attoparsec-0.13.0.2/tests/QC/ByteString.hs
--- old/attoparsec-0.13.0.1/tests/QC/ByteString.hs 2015-07-09 02:08:52.000000000 +0200
+++ new/attoparsec-0.13.0.2/tests/QC/ByteString.hs 2016-04-22 02:38:31.000000000 +0200
@@ -9,8 +9,8 @@
import Data.Word (Word8)
import Prelude hiding (take, takeWhile)
import QC.Common (ASCII(..), liftOp, parseBS, toStrictBS)
-import Test.Framework (Test)
-import Test.Framework.Providers.QuickCheck2 (testProperty)
+import Test.Tasty (TestTree)
+import Test.Tasty.QuickCheck (testProperty)
import Test.QuickCheck
import qualified Data.Attoparsec.ByteString as P
import qualified Data.Attoparsec.ByteString.Char8 as P8
@@ -155,7 +155,7 @@
nonmembers s s' = property . not . any (`S.memberWord8` set) $ filter (not . (`elem` s)) s'
where set = S.fromList s
-tests :: [Test]
+tests :: [TestTree]
tests = [
testProperty "anyWord8" anyWord8
, testProperty "endOfInput" endOfInput
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attoparsec-0.13.0.1/tests/QC/Combinator.hs new/attoparsec-0.13.0.2/tests/QC/Combinator.hs
--- old/attoparsec-0.13.0.1/tests/QC/Combinator.hs 2015-07-09 02:08:52.000000000 +0200
+++ new/attoparsec-0.13.0.2/tests/QC/Combinator.hs 2016-04-22 02:38:31.000000000 +0200
@@ -8,8 +8,8 @@
import Data.Maybe (fromJust, isJust)
import Data.Word (Word8)
import QC.Common (Repack, parseBS, repackBS, toLazyBS)
-import Test.Framework (Test)
-import Test.Framework.Providers.QuickCheck2 (testProperty)
+import Test.Tasty (TestTree)
+import Test.Tasty.QuickCheck (testProperty)
import Test.QuickCheck
import qualified Data.Attoparsec.ByteString.Char8 as P
import qualified Data.Attoparsec.Combinator as C
@@ -43,7 +43,7 @@
B8.replicate x 'x', B8.pack (show n), B8.replicate y 'y'
]
-tests :: [Test]
+tests :: [TestTree]
tests = [
testProperty "choice" choice
, testProperty "count" count
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attoparsec-0.13.0.1/tests/QC/IPv6.hs new/attoparsec-0.13.0.2/tests/QC/IPv6.hs
--- old/attoparsec-0.13.0.1/tests/QC/IPv6.hs 2015-07-09 02:08:52.000000000 +0200
+++ new/attoparsec-0.13.0.2/tests/QC/IPv6.hs 1970-01-01 01:00:00.000000000 +0100
@@ -1,322 +0,0 @@
--- -----------------------------------------------------------------------------
-
--- |
--- Module : Text.IPv6Addr
--- Copyright : Copyright © Michel Boucey 2011-2015
--- License : BSD-Style
--- Maintainer : michel.boucey(a)gmail.com
---
--- Dealing with IPv6 address text representations, canonization and manipulations.
---
-
--- -----------------------------------------------------------------------------
-
-{-# LANGUAGE OverloadedStrings #-}
-
-module Text.IPv6Addr.Internal
- ( expandTokens
- , macAddr
- , maybeIPv6AddrTokens
- , ipv4AddrToIPv6AddrTokens
- , ipv6TokensToText
- , ipv6TokensToIPv6Addr
- , isIPv6Addr
- , maybeTokIPv6Addr
- , maybeTokPureIPv6Addr
- , fromDoubleColon
- , fromIPv6Addr
- , toDoubleColon
- , networkInterfacesIPv6AddrList
- ) where
-
-import Control.Monad (replicateM)
-import Data.Attoparsec.Text
-import Data.Char (isDigit,isHexDigit,toLower)
-import Data.Monoid ((<>))
-import Control.Applicative ((<|>),(<*))
-import Data.List (group,isSuffixOf,elemIndex,elemIndices,intersperse)
-import Numeric (showHex)
-import qualified Data.Text as T
-import qualified Data.Text.Read as R (decimal)
-import Data.Maybe (fromJust)
-import Network.Info
-
-import Text.IPv6Addr.Types
-
-tok0 = "0"
-
--- | Returns the 'T.Text' of an IPv6 address.
-fromIPv6Addr :: IPv6Addr -> T.Text
-fromIPv6Addr (IPv6Addr t) = t
-
--- | Given an arbitrary list of 'IPv6AddrToken', returns the corresponding 'T.Text'.
-ipv6TokensToText :: [IPv6AddrToken] -> T.Text
-ipv6TokensToText l = T.concat $ map ipv6TokenToText l
-
--- | Returns the corresponding 'T.Text' of an IPv6 address token.
-ipv6TokenToText :: IPv6AddrToken -> T.Text
-ipv6TokenToText (SixteenBit s) = s
-ipv6TokenToText Colon = ":"
-ipv6TokenToText DoubleColon = "::"
-ipv6TokenToText AllZeros = tok0 -- "A single 16-bit 0000 field MUST be represented as 0" (RFC 5952, 4.1)
-ipv6TokenToText (IPv4Addr a) = a
-
--- | Returns 'True' if a list of 'IPv6AddrToken' constitutes a valid IPv6 Address.
-isIPv6Addr :: [IPv6AddrToken] -> Bool
-isIPv6Addr [] = False
-isIPv6Addr [DoubleColon] = True
-isIPv6Addr [DoubleColon,SixteenBit tok1] = True
-isIPv6Addr tks =
- diffNext tks && (do
- let cdctks = countDoubleColon tks
- let lentks = length tks
- let lasttk = last tks
- let lenconst = (lentks == 15 && cdctks == 0) || (lentks < 15 && cdctks == 1)
- firstValidToken tks &&
- (case countIPv4Addr tks of
- 0 -> case lasttk of
- SixteenBit _ -> lenconst
- DoubleColon -> lenconst
- AllZeros -> lenconst
- _ -> False
- 1 -> case lasttk of
- IPv4Addr _ -> (lentks == 13 && cdctks == 0) || (lentks < 12 && cdctks == 1)
- _ -> False
- otherwise -> False))
- where diffNext [] = False
- diffNext [_] = True
- diffNext (t:ts) = do
- let h = head ts
- case t of
- SixteenBit _ -> case h of
- SixteenBit _ -> False
- AllZeros -> False
- _ -> diffNext ts
- AllZeros -> case h of
- SixteenBit _ -> False
- AllZeros -> False
- _ -> diffNext ts
- _ -> diffNext ts
- firstValidToken l =
- case head l of
- SixteenBit _ -> True
- DoubleColon -> True
- AllZeros -> True
- _ -> False
- countDoubleColon l = length $ elemIndices DoubleColon l
- tok1 = "1"
-
-countIPv4Addr = foldr oneMoreIPv4Addr 0
- where
- oneMoreIPv4Addr t c = case t of
- IPv4Addr _ -> c + 1
- otherwise -> c
-
--- | This is the main function which returns 'Just' the list of a tokenized IPv6
--- address text representation validated against RFC 4291 and canonized
--- in conformation with RFC 5952, or 'Nothing'.
-maybeTokIPv6Addr :: T.Text -> Maybe [IPv6AddrToken]
-maybeTokIPv6Addr t =
- case maybeIPv6AddrTokens t of
- Just ltks -> if isIPv6Addr ltks
- then Just $ (ipv4AddrReplacement . toDoubleColon . fromDoubleColon) ltks
- else Nothing
- Nothing -> Nothing
- where
- ipv4AddrReplacement ltks =
- if ipv4AddrRewrite ltks
- then init ltks ++ ipv4AddrToIPv6AddrTokens (last ltks)
- else ltks
-
--- | Returns 'Just' the list of tokenized pure IPv6 address, always rewriting an
--- embedded IPv4 address if present.
-maybeTokPureIPv6Addr :: T.Text -> Maybe [IPv6AddrToken]
-maybeTokPureIPv6Addr t = do
- ltks <- maybeIPv6AddrTokens t
- if isIPv6Addr ltks
- then Just $ (toDoubleColon . ipv4AddrReplacement . fromDoubleColon) ltks
- else Nothing
- where
- ipv4AddrReplacement ltks' = init ltks' ++ ipv4AddrToIPv6AddrTokens (last ltks')
-
--- | Tokenize a 'T.Text' into 'Just' a list of 'IPv6AddrToken', or 'Nothing'.
-maybeIPv6AddrTokens :: T.Text -> Maybe [IPv6AddrToken]
-maybeIPv6AddrTokens s =
- case readText s of
- Done r l -> if r==T.empty then Just l else Nothing
- Fail {} -> Nothing
- where
- readText s = feed (parse (many1 $ ipv4Addr <|> sixteenBit <|> doubleColon <|> colon) s) T.empty
-
--- | An embedded IPv4 address have to be rewritten to output a pure IPv6 Address
--- text representation in hexadecimal digits. But some well-known prefixed IPv6
--- addresses have to keep visible in their text representation the fact that
--- they deals with IPv4 to IPv6 transition process (RFC 5952 Section 5):
---
--- IPv4-compatible IPv6 address like "::1.2.3.4"
---
--- IPv4-mapped IPv6 address like "::ffff:1.2.3.4"
---
--- IPv4-translated address like "::ffff:0:1.2.3.4"
---
--- IPv4-translatable address like "64:ff9b::1.2.3.4"
---
--- ISATAP address like "fe80::5efe:1.2.3.4"
---
-ipv4AddrRewrite :: [IPv6AddrToken] -> Bool
-ipv4AddrRewrite tks =
- case last tks of
- IPv4Addr _ -> do
- let itks = init tks
- not (itks == [DoubleColon]
- || itks == [DoubleColon,SixteenBit tokffff,Colon]
- || itks == [DoubleColon,SixteenBit tokffff,Colon,AllZeros,Colon]
- || itks == [SixteenBit "64",Colon,SixteenBit "ff9b",DoubleColon]
- || [SixteenBit "200",Colon,SixteenBit tok5efe,Colon] `isSuffixOf` itks
- || [AllZeros,Colon,SixteenBit tok5efe,Colon] `isSuffixOf` itks
- || [DoubleColon,SixteenBit tok5efe,Colon] `isSuffixOf` itks)
- _ -> False
- where
- tokffff = "ffff"
- tok5efe = "5efe"
-
--- | Rewrites an embedded 'IPv4Addr' into the corresponding list of pure 'IPv6Addr' tokens.
---
--- > ipv4AddrToIPv6AddrTokens (IPv4Addr "127.0.0.1") == [SixteenBits "7f0",Colon,SixteenBits "1"]
---
-ipv4AddrToIPv6AddrTokens :: IPv6AddrToken -> [IPv6AddrToken]
-ipv4AddrToIPv6AddrTokens t =
- case t of
- IPv4Addr a -> do
- let m = toHex a
- [ SixteenBit ((!!) m 0 <> addZero ((!!) m 1))
- , Colon
- , SixteenBit ((!!) m 2 <> addZero ((!!) m 3)) ]
- _ -> [t]
- where
- toHex a = map (\x -> T.pack $ showHex (read (T.unpack x)::Int) "") $ T.split (=='.') a
- addZero d = if T.length d == 1 then tok0 <> d else d
-
-expandTokens :: [IPv6AddrToken] -> [IPv6AddrToken]
-expandTokens = map expandToken
- where expandToken (SixteenBit s) = SixteenBit $ T.justifyRight 4 '0' s
- expandToken AllZeros = SixteenBit "0000"
- expandToken t = t
-
-fromDoubleColon :: [IPv6AddrToken] -> [IPv6AddrToken]
-fromDoubleColon tks =
- if DoubleColon `notElem` tks
- then tks
- else do let s = splitAt (fromJust $ elemIndex DoubleColon tks) tks
- let fsts = fst s
- let snds = if not (null (snd s)) then tail(snd s) else []
- let fste = if null fsts then [] else fsts ++ [Colon]
- let snde = if null snds then [] else Colon : snds
- fste ++ allZerosTokensReplacement(quantityOfAllZerosTokenToReplace tks) ++ snde
- where
- allZerosTokensReplacement x = intersperse Colon (replicate x AllZeros)
- quantityOfAllZerosTokenToReplace x =
- ntks tks - foldl (\c x -> if (x /= DoubleColon) && (x /= Colon) then c+1 else c) 0 x
- where
- ntks tks = if countIPv4Addr tks == 1 then 7 else 8
-
-toDoubleColon :: [IPv6AddrToken] -> [IPv6AddrToken]
-toDoubleColon tks =
- zerosToDoubleColon tks (zerosRunToReplace $ zerosRunsList tks)
- where
- zerosToDoubleColon :: [IPv6AddrToken] -> (Int,Int) -> [IPv6AddrToken]
- -- No all zeros token, so no double colon replacement...
- zerosToDoubleColon ls (_,0) = ls
- -- "The symbol '::' MUST NOT be used to shorten just one 16-bit 0 field" (RFC 5952 4.2.2)
- zerosToDoubleColon ls (_,1) = ls
- zerosToDoubleColon ls (i,l) =
- let ls' = filter (/= Colon) ls
- in intersperse Colon (Prelude.take i ls') ++ [DoubleColon] ++ intersperse Colon (drop (i+l) ls')
- zerosRunToReplace t =
- let l = longestLengthZerosRun t
- in (firstLongestZerosRunIndex t l,l)
- where
- firstLongestZerosRunIndex x y = sum . snd . unzip $ Prelude.takeWhile (/=(True,y)) x
- longestLengthZerosRun x =
- maximum $ map longest x
- where longest t = case t of
- (True,i) -> i
- _ -> 0
- zerosRunsList x = map helper $ groupZerosRuns x
- where
- helper h = (head h == AllZeros, lh) where lh = length h
- groupZerosRuns = group . filter (/= Colon)
-
-ipv6TokensToIPv6Addr :: [IPv6AddrToken] -> Maybe IPv6Addr
-ipv6TokensToIPv6Addr l = Just $ IPv6Addr $ ipv6TokensToText l
-
-networkInterfacesIPv6AddrList :: IO [(String,IPv6)]
-networkInterfacesIPv6AddrList =
- getNetworkInterfaces >>= \n -> return $ map networkInterfacesIPv6Addr n
- where
- networkInterfacesIPv6Addr (NetworkInterface n _ a _) = (n,a)
-
-fullSixteenBit :: T.Text -> Maybe IPv6AddrToken
-fullSixteenBit t =
- case parse ipv6AddrFullChunk t of
- Done a b -> if a==T.empty then Just $ SixteenBit $ T.pack b else Nothing
- _ -> Nothing
-
-macAddr :: Parser (Maybe [IPv6AddrToken])
-macAddr = do
- n1 <- count 2 hexaChar <* ":"
- n2 <- count 2 hexaChar <* ":"
- n3 <- count 2 hexaChar <* ":"
- n4 <- count 2 hexaChar <* ":"
- n5 <- count 2 hexaChar <* ":"
- n6 <- count 2 hexaChar
- return $ maybeIPv6AddrTokens $ T.pack $ concat [n1,n2,n3,n4,n5,n6]
-
-sixteenBit :: Parser IPv6AddrToken
-sixteenBit = do
- r <- ipv6AddrFullChunk <|> count 3 hexaChar <|> count 2 hexaChar <|> count 1 hexaChar
- -- "Leading zeros MUST be suppressed" (RFC 5952, 4.1)
- let r' = T.dropWhile (=='0') $ T.pack r
- return $ if T.null r'
- then AllZeros
- -- Hexadecimal digits MUST be in lowercase (RFC 5952 4.3)
- else SixteenBit $ T.toLower r'
-
-ipv4Addr :: Parser IPv6AddrToken
-ipv4Addr = do
- n1 <- manyDigits <* "."
- if n1 /= T.empty
- then do n2 <- manyDigits <* "."
- if n2 /= T.empty
- then do n3 <- manyDigits <* "."
- if n3 /= T.empty
- then do n4 <- manyDigits
- if n4 /= T.empty
- then return $ IPv4Addr $ T.intercalate "." [n1,n2,n3,n4]
- else parserFailure
- else parserFailure
- else parserFailure
- else parserFailure
- where
- parserFailure = fail "ipv4Addr parsing failure"
- manyDigits = do
- ds <- takeWhile1 isDigit
- case R.decimal ds of
- Right (n,_) -> return (if n < 256 then T.pack $ show n else T.empty)
- Left _ -> return T.empty
-
-doubleColon :: Parser IPv6AddrToken
-doubleColon = do
- string "::"
- return DoubleColon
-
-colon :: Parser IPv6AddrToken
-colon = do
- string ":"
- return Colon
-
-ipv6AddrFullChunk :: Parser String
-ipv6AddrFullChunk = count 4 hexaChar
-
-hexaChar :: Parser Char
-hexaChar = satisfy (inClass "0-9a-fA-F")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attoparsec-0.13.0.1/tests/QC/Simple.hs new/attoparsec-0.13.0.2/tests/QC/Simple.hs
--- old/attoparsec-0.13.0.1/tests/QC/Simple.hs 2015-07-09 02:08:52.000000000 +0200
+++ new/attoparsec-0.13.0.2/tests/QC/Simple.hs 2016-04-22 02:38:31.000000000 +0200
@@ -10,8 +10,8 @@
import Data.List (foldl')
import Data.Maybe (fromMaybe)
import QC.Rechunked (rechunkBS)
-import Test.Framework (Test)
-import Test.Framework.Providers.QuickCheck2 (testProperty)
+import Test.Tasty (TestTree)
+import Test.Tasty.QuickCheck (testProperty)
import Test.QuickCheck (Property, counterexample, forAll)
import qualified Data.Attoparsec.ByteString.Char8 as A
@@ -31,7 +31,7 @@
parse p (x:xs) = foldl' A.feed (A.parse p x) xs
parse p [] = A.parse p ""
-tests :: [Test]
+tests :: [TestTree]
tests = [
testProperty "issue75" t_issue75
]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attoparsec-0.13.0.1/tests/QC/Text/FastSet.hs new/attoparsec-0.13.0.2/tests/QC/Text/FastSet.hs
--- old/attoparsec-0.13.0.1/tests/QC/Text/FastSet.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/attoparsec-0.13.0.2/tests/QC/Text/FastSet.hs 2016-04-22 02:38:31.000000000 +0200
@@ -0,0 +1,15 @@
+module QC.Text.FastSet where
+
+import Test.Tasty (TestTree)
+import Test.Tasty.QuickCheck (testProperty)
+import Test.QuickCheck
+import qualified Data.Attoparsec.Text.FastSet as FastSet
+
+membershipCorrect :: String -> String -> Property
+membershipCorrect members others =
+ let fs = FastSet.fromList members
+ correct c = (c `FastSet.member` fs) == (c `elem` members)
+ in property $ all correct (members ++ others)
+
+tests :: [TestTree]
+tests = [ testProperty "membership is correct" membershipCorrect ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attoparsec-0.13.0.1/tests/QC/Text.hs new/attoparsec-0.13.0.2/tests/QC/Text.hs
--- old/attoparsec-0.13.0.1/tests/QC/Text.hs 2015-07-09 02:08:52.000000000 +0200
+++ new/attoparsec-0.13.0.2/tests/QC/Text.hs 2016-04-22 02:38:31.000000000 +0200
@@ -8,8 +8,9 @@
import Data.Int (Int64)
import Prelude hiding (take, takeWhile)
import QC.Common (liftOp, parseT)
-import Test.Framework (Test)
-import Test.Framework.Providers.QuickCheck2 (testProperty)
+import qualified QC.Text.FastSet as FastSet
+import Test.Tasty (TestTree, testGroup)
+import Test.Tasty.QuickCheck (testProperty)
import Test.QuickCheck
import qualified Data.Attoparsec.Text as P
import qualified Data.Attoparsec.Text.Lazy as PL
@@ -160,7 +161,7 @@
nonmembers s s' = property . not . any (`S.member` set) $ filter (not . (`elem` s)) s'
where set = S.fromList s
-tests :: [Test]
+tests :: [TestTree]
tests = [
testProperty "anyChar" anyChar
, testProperty "asciiCI" asciiCI
@@ -188,4 +189,5 @@
, testProperty "takeWhile1_empty" takeWhile1_empty
, testProperty "members" members
, testProperty "nonmembers" nonmembers
+ , testGroup "FastSet" FastSet.tests
]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attoparsec-0.13.0.1/tests/QC.hs new/attoparsec-0.13.0.2/tests/QC.hs
--- old/attoparsec-0.13.0.1/tests/QC.hs 2015-07-09 02:08:52.000000000 +0200
+++ new/attoparsec-0.13.0.2/tests/QC.hs 2016-04-22 02:38:31.000000000 +0200
@@ -6,11 +6,11 @@
import qualified QC.Combinator as Combinator
import qualified QC.Simple as Simple
import qualified QC.Text as Text
-import Test.Framework (defaultMain, testGroup)
+import Test.Tasty (defaultMain, testGroup)
main = defaultMain tests
-tests = [
+tests = testGroup "tests" [
testGroup "bs" ByteString.tests
, testGroup "buf" Buffer.tests
, testGroup "combinator" Combinator.tests
1
0
Hello community,
here is the log from the commit of package ubuntu-themes for openSUSE:Factory checked in at 2016-04-30 23:30:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ubuntu-themes (Old)
and /work/SRC/openSUSE:Factory/.ubuntu-themes.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ubuntu-themes"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ubuntu-themes/ubuntu-themes.changes 2016-03-11 12:29:49.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.ubuntu-themes.new/ubuntu-themes.changes 2016-04-30 23:30:07.000000000 +0200
@@ -1,0 +2,25 @@
+Tue Apr 19 07:30:12 UTC 2016 - sor.alexei(a)meowr.ru
+
+- Update to version 14.04~bzr20160415:
+ * Add 1px padding to calendar widget elements; looks better.
+ * Suru icon theme: Normalisation of arrows used in mono icons,
+ plus minor additions or updates to existing designs (lp#1518934).
+ * Add these fixes for Calendar: lp#1551744, lp#1558659.
+
+-------------------------------------------------------------------
+Mon Apr 11 10:02:03 UTC 2016 - sor.alexei(a)meowr.ru
+
+- Update to version 14.04~bzr20160324.1:
+ * Ambiance, Radiance: use inverted gradient in headerbar when in
+ toolbar-mode (lp#1515810).
+ * Reduce the padding on flat entries, that's needed with Gtk 3.18
+ otherwise the entry is displayed over new rows in listview when
+ editing, that's also what the Gtk upstream themes are doing.
+ * Show the cursor index better in Totem videos (lp#1545026).
+ * Override box shadow and border settings for linked dialog
+ buttons so they don't looked mashed together. Extra border
+ radius is required to stop the button background bleeding
+ through the border (lp#1513856).
+- Remove themes-csd-titlebar-fix.patch.
+
+-------------------------------------------------------------------
Old:
----
themes-csd-titlebar-fix.patch
ubuntu-themes_14.04+16.04.20160209.orig.tar.gz
New:
----
ubuntu-themes_14.04+16.04.20160415.orig.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ubuntu-themes.spec ++++++
--- /var/tmp/diff_new_pack.ojS3qB/_old 2016-04-30 23:30:09.000000000 +0200
+++ /var/tmp/diff_new_pack.ojS3qB/_new 2016-04-30 23:30:09.000000000 +0200
@@ -16,19 +16,17 @@
#
-%define _version 14.04+16.04.20160209
+%define _version 14.04+16.04.20160415
Name: ubuntu-themes
-Version: 14.04~bzr20160209
+Version: 14.04~bzr20160415
Release: 0
Summary: Eyecandy from Ubuntu
License: GPL-3.0+
Group: System/GUI/Other
Url: https://launchpad.net/ubuntu-themes
Source: http://archive.ubuntu.com/ubuntu/pool/main/u/%{name}/%{name}_%{_version}.or…
-# PATCH-FIX-UPSTREAM themes-csd-titlebar-fix.patch sor.alexei(a)meowr.ru -- Fix transparent titlebars in Gtk3 CSD.
-Patch0: themes-csd-titlebar-fix.patch
# PATCH-FIX-UPSTREAM themes-mate-panel.patch sor.alexei(a)meowr.ru -- Add proper theming for mate-panel.
-Patch1: themes-mate-panel.patch
+Patch0: themes-mate-panel.patch
BuildRequires: fdupes
BuildRequires: hicolor-icon-theme
BuildRequires: python-base
@@ -124,9 +122,8 @@
Dark and Light panel icons to make desktop beautiful.
%prep
-%setup -q -n %{name}-%{_version}
+%setup -q -c
%patch0 -p1
-%patch1 -p1
cp -f Ambiance/gtk-2.0/apps/mate-panel.rc Radiance/gtk-2.0/apps/mate-panel.rc
%build
++++++ ubuntu-themes_14.04+16.04.20160209.orig.tar.gz -> ubuntu-themes_14.04+16.04.20160415.orig.tar.gz ++++++
/work/SRC/openSUSE:Factory/ubuntu-themes/ubuntu-themes_14.04+16.04.20160209.orig.tar.gz /work/SRC/openSUSE:Factory/.ubuntu-themes.new/ubuntu-themes_14.04+16.04.20160415.orig.tar.gz differ: char 4, line 1
1
0
Hello community,
here is the log from the commit of package libvirt for openSUSE:Factory checked in at 2016-04-30 23:30:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libvirt (Old)
and /work/SRC/openSUSE:Factory/.libvirt.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libvirt"
Changes:
--------
--- /work/SRC/openSUSE:Factory/libvirt/libvirt.changes 2016-04-22 16:24:21.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.libvirt.new/libvirt.changes 2016-04-30 23:30:05.000000000 +0200
@@ -1,0 +2,14 @@
+Mon Apr 18 21:32:37 UTC 2016 - jfehlig(a)suse.com
+
+- qemu: perf: Fix crash/memory corruption on failed VM start
+ 03e8d5fb-qemu-perf-memory-corruption.patch
+ bsc#977131
+
+-------------------------------------------------------------------
+Mon Apr 18 19:34:10 UTC 2016 - jfehlig(a)suse.com
+
+- Fix setting implicit video devices as primary
+ 6d8b6d28-mark-implicit-video-primary.patch
+ bsc#977150
+
+-------------------------------------------------------------------
New:
----
03e8d5fb-qemu-perf-memory-corruption.patch
6d8b6d28-mark-implicit-video-primary.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libvirt.spec ++++++
--- /var/tmp/diff_new_pack.Ohp4yE/_old 2016-04-30 23:30:07.000000000 +0200
+++ /var/tmp/diff_new_pack.Ohp4yE/_new 2016-04-30 23:30:07.000000000 +0200
@@ -461,6 +461,8 @@
Source100: %{name}-rpmlintrc
# Upstream patches
Patch0: 216650f1-libxl-build-fix.patch
+Patch1: 6d8b6d28-mark-implicit-video-primary.patch
+Patch2: 03e8d5fb-qemu-perf-memory-corruption.patch
# Patches pending upstream review
# Need to go upstream
Patch150: xen-pv-cdrom.patch
@@ -990,6 +992,8 @@
%prep
%setup -q
%patch0 -p1
+%patch1 -p1
+%patch2 -p1
%patch150 -p1
%patch151 -p1
%patch152 -p1
++++++ 03e8d5fb-qemu-perf-memory-corruption.patch ++++++
commit 03e8d5fb54c7c897225ed9ea56d83b894930f144
Author: Peter Krempa <pkrempa(a)redhat.com>
Date: Thu Apr 7 12:50:15 2016 +0200
qemu: perf: Fix crash/memory corruption on failed VM start
The new perf code didn't bother to clear a pointer in 'priv' causing a
double free or other memory corruption goodness if a VM failed to start.
Clear the pointer after freeing the memory.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1324757
Index: libvirt-1.3.3/src/qemu/qemu_process.c
===================================================================
--- libvirt-1.3.3.orig/src/qemu/qemu_process.c
+++ libvirt-1.3.3/src/qemu/qemu_process.c
@@ -3444,6 +3444,7 @@ qemuDomainPerfRestart(virDomainObjPtr vm
cleanup:
virPerfFree(priv->perf);
+ priv->perf = NULL;
return -1;
}
@@ -5959,6 +5960,7 @@ void qemuProcessStop(virQEMUDriverPtr dr
virCgroupFree(&priv->cgroup);
virPerfFree(priv->perf);
+ priv->perf = NULL;
qemuProcessRemoveDomainStatus(driver, vm);
++++++ 6d8b6d28-mark-implicit-video-primary.patch ++++++
++++ 914 lines (skipped)
1
0
Hello community,
here is the log from the commit of package python-s3transfer for openSUSE:Factory checked in at 2016-04-30 23:30:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-s3transfer (Old)
and /work/SRC/openSUSE:Factory/.python-s3transfer.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-s3transfer"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-s3transfer/python-s3transfer.changes 2016-04-14 13:07:14.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python-s3transfer.new/python-s3transfer.changes 2016-04-30 23:30:03.000000000 +0200
@@ -1,0 +2,5 @@
+Mon Apr 18 17:47:19 UTC 2016 - rjschwei(a)suse.com
+
+- Include in SLE 12 (FATE#320748, bsc#974993, bsc#975949)
+
+-------------------------------------------------------------------
@@ -10 +15 @@
-- Initial build include in SLE 12 (FATE#320748, bsc#974993)
+- Initial build
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
1
0
Hello community,
here is the log from the commit of package lua51-mpack for openSUSE:Factory checked in at 2016-04-30 23:29:54
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/lua51-mpack (Old)
and /work/SRC/openSUSE:Factory/.lua51-mpack.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lua51-mpack"
Changes:
--------
New Changes file:
--- /dev/null 2016-04-07 01:36:33.300037506 +0200
+++ /work/SRC/openSUSE:Factory/.lua51-mpack.new/lua51-mpack.changes 2016-04-30 23:29:55.000000000 +0200
@@ -0,0 +1,5 @@
+-------------------------------------------------------------------
+Fri Apr 22 00:50:42 UTC 2016 - ronisbr(a)gmail.com
+
+- Initial version.
+
New:
----
1.0.2.tar.gz
lua51-mpack.changes
lua51-mpack.spec
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ lua51-mpack.spec ++++++
#
# spec file for package lua51-mpack
#
# Copyright (c) 2016 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
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define lua_version %(lua -e 'print(_VERSION)' | cut -d ' ' -f 2)
%define lua_archdir %{_libdir}/lua/%{lua_version}
Name: lua51-mpack
Version: 1.0.2
Release: 0
Summary: Implementation of MessagePack for Lua 5.1
License: MIT
Group: Development/Libraries/Other
Url: https://github.com/tarruda/libmpack
Source: https://github.com/tarruda/libmpack/archive/%{version}.tar.gz
BuildRequires: gcc
BuildRequires: libtool
BuildRequires: lua51-devel
Requires: lua51
%description
mpack is a small binary serialization/RPC library that implements
both the msgpack and msgpack-rpc specifications.
%prep
%setup -q -n libmpack-%{version}
%build
gcc -O2 -I%{_includedir}/lua/%{lua_version} -shared -fPIC -o mpack.so binding/lua/lmpack.c
%install
mkdir -p %{buildroot}%{lua_archdir}
install -Dm755 mpack.so %{buildroot}%{lua_archdir}
%files
%defattr(-,root,root)
%doc LICENSE-MIT README.md
%dir %{lua_archdir}
%{lua_archdir}/*
%changelog
1
0
Hello community,
here is the log from the commit of package adms for openSUSE:Factory checked in at 2016-04-30 23:29:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/adms (Old)
and /work/SRC/openSUSE:Factory/.adms.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "adms"
Changes:
--------
--- /work/SRC/openSUSE:Factory/adms/adms.changes 2014-10-05 20:31:32.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.adms.new/adms.changes 2016-04-30 23:29:43.000000000 +0200
@@ -1,0 +2,32 @@
+Mon Apr 25 12:06:14 UTC 2016 - p.drouand(a)gmail.com
+
+- Update to version 2.3.5
+ * Change license to GPLv3.
+ * Add new simplified constants.vams and discplines.vams.
+ Tested to work with models currently in use by Qucs, Ngspice, Xyce and Gnucap.
+ Whenever these headers are used, adms informs the user about the
+ availability of the standard headers at:
+ http://accellera.org/downloads/standards/v-ams
+ * Remove non-GPL constants.vams and disciplines.vams headers.
+ These files are copyright of Accellera. With the LRM v2.4.0 updated versions
+ of these files are freely accessible. However modification is not allowed.
+ Hence, these files are not GPL and should not be included in adms.
+ * Autotools, add back support for static and shared libraries build.
+ Build shared libraries by default. Tested on Linux, Mac OSX, and MSYS2.
+ See the configure --disable-shared flag to change that.
+ CMake contiues to builds static libraries only.
+ * Fix out-of-tree build for Autotools and CMake.
+ * Check scaling factors againd LRM v2.4.0
+ Add missing K scaling (uppercase kilo)
+ standard scale_factor T|G|M|K|k|m|u|n|p|f|a
+ Add testset (va and xml files) to test the scaling factors
+ * Handle non-standard scaling factors with warning E|P|D|h|d|c|A
+ * Relax Bison requirement, tested with (2.5, 3.0.2)
+ * Perl GD module is no longer required at build time.
+ The GD module is becoming hard to install, and it is only used to create
+ a few images used on the html documentation. If images need to be changed,
+ run the mkimage.pl script and update the repository.
+- Change license to GPL-3.0, accordingly with upstream changes
+- Remove perl-GD build dependency; not needed anymore
+
+-------------------------------------------------------------------
Old:
----
adms-2.3.4.tar.gz
New:
----
adms-2.3.5.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ adms.spec ++++++
--- /var/tmp/diff_new_pack.IWAoJO/_old 2016-04-30 23:29:44.000000000 +0200
+++ /var/tmp/diff_new_pack.IWAoJO/_new 2016-04-30 23:29:44.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package adms
#
-# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,10 +17,10 @@
Name: adms
-Version: 2.3.4
+Version: 2.3.5
Release: 0
Summary: An automatic device model synthesizer
-License: LGPL-2.1
+License: GPL-3.0
Group: Productivity/Scientific/Electronics
Url: http://sourceforge.net/projects/mot-adms/
Source0: http://downloads.sourceforge.net/mot-adms/%{name}-%{version}.tar.gz
@@ -30,7 +30,6 @@
BuildRequires: flex
BuildRequires: gcc-c++
BuildRequires: libtool
-BuildRequires: perl-GD
BuildRequires: perl-XML-LibXML
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -45,17 +44,23 @@
%patch1 -p1
%build
-%configure
+%configure --disable-static
make %{?_smp_mflags}
%install
%make_install
+find %{buildroot} -type f -name "*.la" -delete -print
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING
%{_bindir}/admsCheck
%{_bindir}/admsXml
+# Do not split out libraries for the moment; nothing else but adms (can) use them
+%{_libdir}/lib%{name}*.*
%{_mandir}/man1/admsCheck.1.gz
%{_mandir}/man1/admsXml.1.gz
++++++ adms-2.3.4.tar.gz -> adms-2.3.5.tar.gz ++++++
++++ 46373 lines of diff (skipped)
1
0