Hello community,
here is the log from the commit of package ghc-ansi-terminal for
openSUSE:Factory checked in at 2020-08-18 12:24:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-ansi-terminal (Old)
and /work/SRC/openSUSE:Factory/.ghc-ansi-terminal.new.3399 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-ansi-terminal"
Tue Aug 18 12:24:35 2020 rev:17 rq:825794 version:0.11
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-ansi-terminal/ghc-ansi-terminal.changes
2020-06-19 17:07:46.685161838 +0200
+++
/work/SRC/openSUSE:Factory/.ghc-ansi-terminal.new.3399/ghc-ansi-terminal.changes
2020-08-18 12:24:36.791811624 +0200
@@ -1,0 +2,9 @@
+Tue Aug 11 02:00:29 UTC 2020 - [email protected]
+
+- Update ansi-terminal to version 0.11.
+ Upstream has edited the change log file since the last release in
+ a non-trivial way, i.e. they did more than just add a new entry
+ at the top. You can review the file at:
+ http://hackage.haskell.org/package/ansi-terminal-0.11/src/CHANGELOG.md
+
+-------------------------------------------------------------------
Old:
----
ansi-terminal-0.10.3.tar.gz
New:
----
ansi-terminal-0.11.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-ansi-terminal.spec ++++++
--- /var/tmp/diff_new_pack.AkgWpK/_old 2020-08-18 12:24:37.627811973 +0200
+++ /var/tmp/diff_new_pack.AkgWpK/_new 2020-08-18 12:24:37.631811975 +0200
@@ -18,7 +18,7 @@
%global pkg_name ansi-terminal
Name: ghc-%{pkg_name}
-Version: 0.10.3
+Version: 0.11
Release: 0
Summary: Simple ANSI terminal support, with Windows compatibility
License: BSD-3-Clause
++++++ ansi-terminal-0.10.3.tar.gz -> ansi-terminal-0.11.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ansi-terminal-0.10.3/CHANGELOG.md
new/ansi-terminal-0.11/CHANGELOG.md
--- old/ansi-terminal-0.10.3/CHANGELOG.md 2020-02-08 21:13:04.000000000
+0100
+++ new/ansi-terminal-0.11/CHANGELOG.md 2020-08-10 23:42:47.000000000 +0200
@@ -1,8 +1,20 @@
Changes
=======
+Version 0.11
+------------
+
+* Remove deprecated `getCursorPosition0`. (Use `getCursorPosition` instead.)
+* On Unix-like operating systems, the temporary turning off of echoing is moved
+ from `getReportedCursorPosition` to `hGetCursorPositon`.
+* On Unix-like operating systems, fix a bug in `getCursorPosition` and
+ `hGetCursorPosition`, where the console input stream was was not always
+ clear before the cursor position was emitted into it.
+
+
Version 0.10.3
--------------
+
* Add `getCursorPosition` as a synonym of `getCursorPosition0` and deprecate
the
latter.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ansi-terminal-0.10.3/ansi-terminal.cabal
new/ansi-terminal-0.11/ansi-terminal.cabal
--- old/ansi-terminal-0.10.3/ansi-terminal.cabal 2020-02-08
21:19:11.000000000 +0100
+++ new/ansi-terminal-0.11/ansi-terminal.cabal 2020-08-11 00:19:27.000000000
+0200
@@ -1,6 +1,6 @@
Name: ansi-terminal
-Version: 0.10.3
-Cabal-Version: >= 1.8
+Version: 0.11
+Cabal-Version: >= 1.10
Category: User Interfaces
Synopsis: Simple ANSI terminal support, with Windows compatibility
Description: ANSI terminal support for Haskell: allows cursor movement,
@@ -57,10 +57,11 @@
Cpp-Options: -DUNIX
Other-Modules: System.Console.ANSI.Unix
- Extensions: CPP
+ Default-Extensions: CPP
ForeignFunctionInterface
- Ghc-Options: -Wall
+ Ghc-Options: -Wall
+ Default-Language: Haskell2010
Executable ansi-terminal-example
Hs-Source-Dirs: app
@@ -71,3 +72,4 @@
Ghc-Options: -Wall
if !flag(example)
Buildable: False
+ Default-Language: Haskell2010
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ansi-terminal-0.10.3/app/Example.hs
new/ansi-terminal-0.11/app/Example.hs
--- old/ansi-terminal-0.10.3/app/Example.hs 2020-02-08 21:13:04.000000000
+0100
+++ new/ansi-terminal-0.11/app/Example.hs 2020-08-11 00:29:28.000000000
+0200
@@ -260,18 +260,18 @@
-- 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 A A B B C C D D E E F F
forM_ [Dull .. Vivid] $ \intensity -> do
forM_ [Black .. White] $ \color -> do
- let i = fromEnum intensity * 8 + fromEnum color
- eol = i == 15
- setSGR [SetPaletteColor Background $ xtermSystem intensity color]
- setSGR [SetPaletteColor Foreground $ xtermSystem Dull Black]
- printf "%X " i
- setSGR [SetPaletteColor Foreground $ xtermSystem Vivid White]
- printf "%X" i
- if eol
- then putStrLn ""
- else do
- setSGR [Reset]
- putStr " "
+ let i = fromEnum intensity * 8 + fromEnum color
+ eol = i == 15
+ setSGR [SetPaletteColor Background $ xtermSystem intensity color]
+ setSGR [SetPaletteColor Foreground $ xtermSystem Dull Black]
+ printf "%X " i
+ setSGR [SetPaletteColor Foreground $ xtermSystem Vivid White]
+ printf "%X" i
+ if eol
+ then putStrLn ""
+ else do
+ setSGR [Reset]
+ putStr " "
putStrLn ""
-- Next 216 colors (6 level RGB in xterm protocol), in 12 rows of 18
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ansi-terminal-0.10.3/src/System/Console/ANSI/Unix.hs
new/ansi-terminal-0.11/src/System/Console/ANSI/Unix.hs
--- old/ansi-terminal-0.10.3/src/System/Console/ANSI/Unix.hs 2020-02-08
21:13:04.000000000 +0100
+++ new/ansi-terminal-0.11/src/System/Console/ANSI/Unix.hs 2020-08-10
22:33:32.000000000 +0200
@@ -11,8 +11,10 @@
import Data.Maybe (fromMaybe)
import Control.Exception.Base (bracket)
+import Control.Monad (when)
import System.IO (BufferMode (..), Handle, hGetBuffering, hGetEcho,
- hIsTerminalDevice, hIsWritable, hPutStr, hSetBuffering, hSetEcho, stdin)
+ hIsTerminalDevice, hIsWritable, hPutStr, hReady, hSetBuffering, hSetEcho,
+ stdin)
import System.Timeout (timeout)
import Text.ParserCombinators.ReadP (readP_to_S)
@@ -81,8 +83,7 @@
-- getReportedCursorPosition :: IO String
-- (See Common-Include.hs for Haddock documentation)
-getReportedCursorPosition = bracket (hGetEcho stdin) (hSetEcho stdin) $ \_ ->
do
- hSetEcho stdin False -- Turn echo off
+getReportedCursorPosition = do
-- If, unexpectedly, no data is available on the console input stream then
-- the timeout will prevent the getChar blocking. For consistency with the
-- Windows equivalent, returns "" if the expected information is unavailable.
@@ -110,15 +111,24 @@
to0base (row, col) = (row - 1, col - 1)
getCursorPosition' = do
input <- bracket (hGetBuffering stdin) (hSetBuffering stdin) $ \_ -> do
- hSetBuffering stdin NoBuffering -- set no buffering (the contents of the
- -- buffer will be discarded, so this
needs
- -- to be done before the cursor positon
is
- -- emitted)
- hReportCursorPosition h
- hFlush h -- ensure the report cursor position code is sent to the
- -- operating system
- getReportedCursorPosition
+ -- set no buffering (if 'no buffering' is not already set, the contents
of
+ -- the buffer will be discarded, so this needs to be done before the
+ -- cursor positon is emitted)
+ hSetBuffering stdin NoBuffering
+ -- ensure that echoing is off
+ bracket (hGetEcho stdin) (hSetEcho stdin) $ \_ -> do
+ hSetEcho stdin False
+ clearStdin
+ hReportCursorPosition h
+ hFlush h -- ensure the report cursor position code is sent to the
+ -- operating system
+ getReportedCursorPosition
case readP_to_S cursorPosition input of
[] -> return Nothing
[((row, col),_)] -> return $ Just (row, col)
(_:_) -> return Nothing
+ clearStdin = do
+ isReady <- hReady stdin
+ when isReady $ do
+ _ <-getChar
+ clearStdin
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ansi-terminal-0.10.3/src/includes/Common-Include.hs
new/ansi-terminal-0.11/src/includes/Common-Include.hs
--- old/ansi-terminal-0.10.3/src/includes/Common-Include.hs 2020-02-08
21:13:04.000000000 +0100
+++ new/ansi-terminal-0.11/src/includes/Common-Include.hs 2020-08-10
22:36:14.000000000 +0200
@@ -207,14 +207,17 @@
--
-- For example, on a Unix-like operating system:
--
--- > hSetBuffering stdin NoBuffering -- set no buffering (the contents of the
--- > -- buffer will be discarded, so this needs
--- > -- to be done before the cursor positon is
--- > -- emitted)
--- > reportCursorPosition
--- > hFlush stdout -- ensure the report cursor position code is sent to the
--- > -- operating system
--- > input <- getReportedCursorPosition
+-- > -- set no buffering (if 'no buffering' is not already set, the contents of
+-- > -- the buffer will be discarded, so this needs to be done before the
cursor
+-- > -- positon is emitted)
+-- > hSetBuffering stdin NoBuffering
+-- > -- ensure that echoing is off
+-- > input <- bracket (hGetEcho stdin) (hSetEcho stdin) $ \_ -> do
+-- > hSetEcho stdin False
+-- > reportCursorPosition
+-- > hFlush stdout -- ensure the report cursor position code is sent to the
+-- > -- operating system
+-- > getReportedCursorPosition
--
-- On Windows operating systems, the function is not supported on consoles,
such
-- as mintty, that are not based on the Win32 console of the Windows API.
@@ -242,13 +245,6 @@
getCursorPosition :: IO (Maybe (Int, Int))
getCursorPosition = hGetCursorPosition stdout
--- | A synonym for 'getCursorPosition'.
---
--- @since 0.8.2
-{-# DEPRECATED getCursorPosition0 "Use getCursorPosition instead." #-}
-getCursorPosition0 :: IO (Maybe (Int, Int))
-getCursorPosition0 = getCursorPosition
-
-- | Attempts to get the reported cursor position, combining the functions
-- 'hReportCursorPosition' (with the specified handle),
-- 'getReportedCursorPosition' and 'cursorPosition'. Any position
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ansi-terminal-0.10.3/src/includes/Exports-Include.hs
new/ansi-terminal-0.11/src/includes/Exports-Include.hs
--- old/ansi-terminal-0.10.3/src/includes/Exports-Include.hs 2020-02-08
21:13:04.000000000 +0100
+++ new/ansi-terminal-0.11/src/includes/Exports-Include.hs 2020-08-10
22:36:14.000000000 +0200
@@ -119,6 +119,3 @@
-- * Getting the terminal size
, getTerminalSize
, hGetTerminalSize
-
- -- * Deprecated
- , getCursorPosition0