Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ghc-ansi-terminal for 
openSUSE:Factory checked in at 2022-02-11 23:08:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-ansi-terminal (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-ansi-terminal.new.1956 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-ansi-terminal"

Fri Feb 11 23:08:31 2022 rev:20 rq:953431 version:0.11.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-ansi-terminal/ghc-ansi-terminal.changes      
2020-12-22 11:34:30.449200830 +0100
+++ 
/work/SRC/openSUSE:Factory/.ghc-ansi-terminal.new.1956/ghc-ansi-terminal.changes
    2022-02-11 23:10:29.095132593 +0100
@@ -1,0 +2,12 @@
+Tue Nov 23 21:11:35 UTC 2021 - Peter Simons <[email protected]>
+
+- Update ansi-terminal to version 0.11.1.
+  Version 0.11.1
+  --------------
+
+  * On Windows, fix compatability with the Windows I/O Manager (WinIO) 
introduced
+    in GHC 9.0.1, by incorporating changes made in package `Win32-2.13.2.0` in
+    that regard.
+  * Improvements to Haddock documentation.
+
+-------------------------------------------------------------------

Old:
----
  ansi-terminal-0.11.tar.gz

New:
----
  ansi-terminal-0.11.1.tar.gz

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

Other differences:
------------------
++++++ ghc-ansi-terminal.spec ++++++
--- /var/tmp/diff_new_pack.p8X45l/_old  2022-02-11 23:10:29.587134016 +0100
+++ /var/tmp/diff_new_pack.p8X45l/_new  2022-02-11 23:10:29.591134028 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package ghc-ansi-terminal
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %global pkg_name ansi-terminal
 Name:           ghc-%{pkg_name}
-Version:        0.11
+Version:        0.11.1
 Release:        0
 Summary:        Simple ANSI terminal support, with Windows compatibility
 License:        BSD-3-Clause

++++++ ansi-terminal-0.11.tar.gz -> ansi-terminal-0.11.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ansi-terminal-0.11/CHANGELOG.md 
new/ansi-terminal-0.11.1/CHANGELOG.md
--- old/ansi-terminal-0.11/CHANGELOG.md 2020-08-10 23:42:47.000000000 +0200
+++ new/ansi-terminal-0.11.1/CHANGELOG.md       2021-11-23 22:07:49.000000000 
+0100
@@ -1,6 +1,14 @@
 Changes
 =======
 
+Version 0.11.1
+--------------
+
+* On Windows, fix compatability with the Windows I/O Manager (WinIO) introduced
+  in GHC 9.0.1, by incorporating changes made in package `Win32-2.13.2.0` in
+  that regard.
+* Improvements to Haddock documentation.
+
 Version 0.11
 ------------
 
@@ -11,7 +19,6 @@
   `hGetCursorPosition`, where the console input stream was was not always
   clear before the cursor position was emitted into it.
 
-
 Version 0.10.3
 --------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ansi-terminal-0.11/README.md 
new/ansi-terminal-0.11.1/README.md
--- old/ansi-terminal-0.11/README.md    2018-03-09 21:58:25.000000000 +0100
+++ new/ansi-terminal-0.11.1/README.md  2021-11-23 21:48:27.000000000 +0100
@@ -1,4 +1,4 @@
-ansi-terminal
+ansi-terminal [![GitHub 
CI](https://github.com/UnkindPartition/ansi-terminal/workflows/CI/badge.svg)](https://github.com/UnkindPartition/ansi-terminal/actions)
 =============
 
 A Haskell package providing support for 'ANSI' control character sequences for
@@ -60,7 +60,7 @@
 -------
 
 A full example is
-[available](https://github.com/feuerbach/ansi-terminal/blob/master/app/Example.hs),
+[available](https://github.com/UnkindPartition/ansi-terminal/blob/master/app/Example.hs),
 but for a taste of how the library works try the following code:
 
 ``` haskell
@@ -98,7 +98,7 @@
 Maintainers
 -----------
 
-[Mike Pilgrem](https://github.com/mpilgrem) and [Roman 
Cheplyaka](https://github.com/feuerbach) are the primary maintainers.
+[Mike Pilgrem](https://github.com/mpilgrem) and [Roman 
Cheplyaka](https://github.com/UnkindPartition) are the primary maintainers.
 
 [Oliver Charles](https://github.com/ocharles) is the backup maintainer. Please
 get in touch with him if the primary maintainers cannot be reached.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ansi-terminal-0.11/ansi-terminal.cabal 
new/ansi-terminal-0.11.1/ansi-terminal.cabal
--- old/ansi-terminal-0.11/ansi-terminal.cabal  2020-08-11 00:19:27.000000000 
+0200
+++ new/ansi-terminal-0.11.1/ansi-terminal.cabal        2021-11-23 
22:07:49.000000000 +0100
@@ -1,5 +1,5 @@
 Name:                ansi-terminal
-Version:             0.11
+Version:             0.11.1
 Cabal-Version:       >= 1.10
 Category:            User Interfaces
 Synopsis:            Simple ANSI terminal support, with Windows compatibility
@@ -10,7 +10,7 @@
 License-File:        LICENSE
 Author:              Max Bolingbroke
 Maintainer:          Mike Pilgrem <[email protected]>, Roman Cheplyaka 
<[email protected]>
-Homepage:            https://github.com/feuerbach/ansi-terminal
+Homepage:            https://github.com/UnkindPartition/ansi-terminal
 Build-Type:          Simple
 
 Extra-Source-Files:     src/includes/Common-Include.hs
@@ -23,7 +23,7 @@
 
 Source-repository head
   type:     git
-  location: git://github.com/feuerbach/ansi-terminal.git
+  location: git://github.com/UnkindPartition/ansi-terminal.git
 
 Flag Example
         Description:    Build the example application
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/ansi-terminal-0.11/src/System/Console/ANSI/Windows/Emulator.hs 
new/ansi-terminal-0.11.1/src/System/Console/ANSI/Windows/Emulator.hs
--- old/ansi-terminal-0.11/src/System/Console/ANSI/Windows/Emulator.hs  
2020-02-08 21:13:04.000000000 +0100
+++ new/ansi-terminal-0.11.1/src/System/Console/ANSI/Windows/Emulator.hs        
2021-11-23 21:48:27.000000000 +0100
@@ -509,5 +509,5 @@
 getCPExceptionHandler e = error msg
  where
   msg = "Error: " ++ show e ++ "\nThis error may be avoided by using a " ++
-        "console based on the Win32 console of the Windows API, such as " ++
-        "Command Prompt or PowerShell."
+        "console based on the Windows' Console API, such as Command Prompt " ++
+        "or PowerShell."
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/ansi-terminal-0.11/src/System/Console/ANSI/Windows/Foreign.hs 
new/ansi-terminal-0.11.1/src/System/Console/ANSI/Windows/Foreign.hs
--- old/ansi-terminal-0.11/src/System/Console/ANSI/Windows/Foreign.hs   
2019-09-05 22:30:23.000000000 +0200
+++ new/ansi-terminal-0.11.1/src/System/Console/ANSI/Windows/Foreign.hs 
2021-11-23 21:48:27.000000000 +0100
@@ -327,7 +327,7 @@
     "Prompt or PowerShell). That may occur, for example, if output has\n" ++
     "been redirected to a file.\n\n" ++
     "If that is unexpected, please post an issue at:\n" ++
-    "https://github.com/feuerbach/ansi-terminal/issues\n";
+    "https://github.com/UnkindPartition/ansi-terminal/issues\n";
   show (ConsoleException errCode) = "ConsoleException " ++ show errCode
 
 instance Exception ConsoleException
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ansi-terminal-0.11/src/System/Console/ANSI.hs 
new/ansi-terminal-0.11.1/src/System/Console/ANSI.hs
--- old/ansi-terminal-0.11/src/System/Console/ANSI.hs   2020-02-08 
21:13:04.000000000 +0100
+++ new/ansi-terminal-0.11.1/src/System/Console/ANSI.hs 2021-11-23 
21:48:27.000000000 +0100
@@ -119,7 +119,7 @@
 >   setSGR [Reset]  -- reset to default colour scheme
 
 For many more examples, see the project's extensive
-<https://github.com/feuerbach/ansi-terminal/blob/master/app/Example.hs 
Example.hs> file.
+<https://github.com/UnkindPartition/ansi-terminal/blob/master/app/Example.hs 
Example.hs> file.
 -}
 #if defined(WINDOWS)
 module System.Console.ANSI
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ansi-terminal-0.11/src/System/Win32/Compat.hs 
new/ansi-terminal-0.11.1/src/System/Win32/Compat.hs
--- old/ansi-terminal-0.11/src/System/Win32/Compat.hs   2019-09-05 
22:30:23.000000000 +0200
+++ new/ansi-terminal-0.11.1/src/System/Win32/Compat.hs 2021-11-23 
21:48:27.000000000 +0100
@@ -9,6 +9,10 @@
 functionality first added to Win32-2.5.0.0 or Win32-2.5.1.0 (from ansi-terminal
 itself).
 
+Win32-2.9.0.0 introduced support for the Windows I/O Manager, introduced with
+GHC 9.0.1. However, before Win32-2.13.2.0, this changed the behaviour of
+`withHandleFromHANDLE`.
+
 This module provides functions available in those later versions of Win32 to a
 wider range of compilers, reducing the use of CPP pragmas in other modules.
 -}
@@ -32,45 +36,88 @@
   , withTString
   ) where
 
-#if !MIN_VERSION_Win32(2,5,0)
-import Foreign.C.Types (CShort (..))
+import System.Win32.Types (BOOL, DWORD, ErrCode, HANDLE, LPCTSTR, LPDWORD,
+  TCHAR, UINT, WORD, failIfFalse_, getLastError, iNVALID_HANDLE_VALUE,
+  nullHANDLE, withTString)
+
+-- Circumstances in which the patching of Win32 package is required
+#if 
!MIN_VERSION_Win32(2,5,1)||(defined(__IO_MANAGER_WINIO__)&&!MIN_VERSION_Win32(2,13,2))
+#define PATCHING_WIN32_PACKAGE
 #endif
 
-#if !MIN_VERSION_Win32(2,5,1)
+#if !defined(PATCHING_WIN32_PACKAGE)
+
+import System.Win32.Types (SHORT, withHandleToHANDLE)
+
+#else
+
 import Control.Concurrent.MVar (readMVar)
 import Control.Exception (bracket)
-import Foreign.C.Types (CInt (..))
-import Foreign.StablePtr (StablePtr, freeStablePtr, newStablePtr)
 import Data.Typeable (cast)
-import GHC.IO.FD (FD(..)) -- A wrapper around an Int32
+import Foreign.StablePtr (StablePtr, freeStablePtr, newStablePtr)
 import GHC.IO.Handle.Types (Handle (..), Handle__ (..))
-#endif
 
-import System.Win32.Types (BOOL, DWORD, ErrCode, HANDLE, LPCTSTR, LPDWORD,
-  TCHAR, UINT, WORD, failIfFalse_, getLastError, iNVALID_HANDLE_VALUE,
-  nullHANDLE, withTString)
+#if defined(__IO_MANAGER_WINIO__)&&!MIN_VERSION_Win32(2,13,2)
+import GHC.IO.Exception (IOErrorType (InappropriateType), IOException 
(IOError),
+  ioException)
+import GHC.IO.SubSystem ((<!>))
+import GHC.IO.Windows.Handle (ConsoleHandle, Io, NativeHandle, toHANDLE)
+import System.Win32.Types (withHandleToHANDLEPosix)
+#endif
 
-#if MIN_VERSION_Win32(2,5,0)
+#if !MIN_VERSION_Win32(2,5,0)
+import Foreign.C.Types (CShort (..))
+#else
 import System.Win32.Types (SHORT)
 #endif
 
-#if MIN_VERSION_Win32(2,5,1)
-import System.Win32.Types (withHandleToHANDLE)
+#if !MIN_VERSION_Win32(2,5,1)
+import Foreign.C.Types (CInt (..))
+import GHC.IO.FD (FD(..)) -- A wrapper around an Int32
 #endif
 
+#endif
+
+#if defined(PATCHING_WIN32_PACKAGE)
+
 #if !MIN_VERSION_Win32(2,5,0)
 type SHORT = CShort
 #endif
 
-#if !MIN_VERSION_Win32(2,5,1)
+withStablePtr :: a -> (StablePtr a -> IO b) -> IO b
+withStablePtr value = bracket (newStablePtr value) freeStablePtr
 
-#if defined(i386_HOST_ARCH)
-#define WINDOWS_CCONV stdcall
-#elif defined(x86_64_HOST_ARCH)
-#define WINDOWS_CCONV ccall
+#if defined(__IO_MANAGER_WINIO__)&&!MIN_VERSION_Win32(2,13,2)
+
+withHandleToHANDLE :: Handle -> (HANDLE -> IO a) -> IO a
+withHandleToHANDLE = withHandleToHANDLEPosix <!> withHandleToHANDLENative
+
+-- | `withHandleToHANDLENative` does not behave as expected for GHC option
+-- -with-rtsopts=--io-manager=native when Win32 < 2.13.2. Taken from
+-- package Win32-2.13.2.0 `System.Win32.Types.withHandleToHANDLENative`.
+
+withHandleToHANDLENative :: Handle -> (HANDLE -> IO a) -> IO a
+withHandleToHANDLENative haskell_handle action =
+  withStablePtr haskell_handle $ const $ do
+    let write_handle_mvar = case haskell_handle of
+            FileHandle _ handle_mvar     -> handle_mvar
+            DuplexHandle _ _ handle_mvar -> handle_mvar
+    windows_handle <- readMVar write_handle_mvar >>= handle_ToHANDLE
+    action windows_handle
+ where
+  handle_ToHANDLE :: Handle__ -> IO HANDLE
+  handle_ToHANDLE (Handle__{haDevice = dev}) =
+    case ( cast dev :: Maybe (Io NativeHandle)
+         , cast dev :: Maybe (Io ConsoleHandle)) of
+      (Just hwnd, Nothing) -> return $ toHANDLE hwnd
+      (Nothing, Just hwnd) -> return $ toHANDLE hwnd
+      _                    -> throwErr "not a known HANDLE"
+
+  throwErr msg = ioException $ IOError (Just haskell_handle)
+    InappropriateType "withHandleToHANDLENative" msg Nothing Nothing
+
+-- defined(__IO_MANAGER_WINIO__)&&!MIN_VERSION_Win32(2,13,2)
 #else
-#error Unknown mingw32 arch
-#endif
 
 -- | This bit is all highly dubious. The problem is that we want to output ANSI
 -- to arbitrary Handles rather than forcing people to use stdout.  However, the
@@ -101,12 +148,22 @@
     -- Do what the user originally wanted
     action windows_handle
 
+#if defined(i386_HOST_ARCH)
+#define WINDOWS_CCONV stdcall
+#elif defined(x86_64_HOST_ARCH)
+#define WINDOWS_CCONV ccall
+#else
+#error Unknown mingw32 arch
+#endif
+
 -- This essential function comes from the C runtime system. It is certainly
 -- provided by msvcrt, and also seems to be provided by the mingw C library -
 -- hurrah!
 foreign import WINDOWS_CCONV unsafe "_get_osfhandle"
   cget_osfhandle :: CInt -> IO HANDLE
 
-withStablePtr :: a -> (StablePtr a -> IO b) -> IO b
-withStablePtr value = bracket (newStablePtr value) freeStablePtr
+-- defined(__IO_MANAGER_WINIO__)&&!MIN_VERSION_Win32(2,13,2)
+#endif
+
+-- defined(PATCHING_WIN32_PACKAGE)
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ansi-terminal-0.11/src/includes/Common-Include.hs 
new/ansi-terminal-0.11.1/src/includes/Common-Include.hs
--- old/ansi-terminal-0.11/src/includes/Common-Include.hs       2020-08-10 
22:36:14.000000000 +0200
+++ new/ansi-terminal-0.11.1/src/includes/Common-Include.hs     2021-11-23 
21:48:28.000000000 +0100
@@ -220,8 +220,8 @@
 -- >   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.
--- (Command Prompt and PowerShell are based on the Win32 console.)
+-- as mintty, that are not based on the Windows' Console API. (Command Prompt
+-- and PowerShell are based on the Console API.)
 --
 -- @since 0.7.1
 getReportedCursorPosition :: IO String
@@ -238,8 +238,8 @@
 -- general function.
 --
 -- 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.
--- (Command Prompt and PowerShell are based on the Win32 console.)
+-- as mintty, that are not based on the Windows' Console API. (Command Prompt
+-- and PowerShell are based on the Console API.)
 --
 -- @since 0.10.3
 getCursorPosition :: IO (Maybe (Int, Int))
@@ -256,21 +256,29 @@
 -- parsed by 'cursorPosition'.
 --
 -- 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.
--- (Command Prompt and PowerShell are based on the Win32 console.)
+-- as mintty, that are not based on the Windows' Console API. (Command Prompt
+-- and PowerShell are based on the Console API.)
 --
 -- @since 0.10.1
 hGetCursorPosition :: Handle -> IO (Maybe (Int, Int))
 
 -- | Attempts to get the current terminal size (height in rows, width in
--- columns), by using 'getCursorPosition' to query the console input stream
--- after attempting to set the cursor position beyond the bottom right corner 
of
--- the terminal. Uses 'stdout'. If 'stdout' will be redirected, see
--- 'hGetTerminalSize' for a more general function.
+-- columns).
+--
+-- There is no \'ANSI\' control character sequence that reports the terminal
+-- size. So, it attempts to set the cursor position beyond the bottom right
+-- corner of the terminal and then use 'getCursorPosition' to query the console
+-- input stream. It works only on terminals that support each step. Uses
+-- 'stdout'. If 'stdout' will be redirected, see 'hGetTerminalSize' for a more
+-- general function.
 --
 -- 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.
--- (Command Prompt and PowerShell are based on the Win32 console.)
+-- as mintty, that are not based on Windows' Console API. (Command Prompt and
+-- PowerShell are based on the Console API.)
+--
+-- For a different approach, one that does not use control character sequences,
+-- see the
+-- <https://hackage.haskell.org/package/terminal-size terminal-size> package.
 --
 -- @since 0.9
 getTerminalSize :: IO (Maybe (Int, Int))
@@ -278,13 +286,20 @@
 
 -- | Attempts to get the current terminal size (height in rows, width in
 -- columns), by writing control character sequences to the specified handle
--- (which will typically be 'stdout' or 'stderr') and using 
'hGetCursorPosition'
--- to query the console input stream after attempting to set the cursor 
position
--- beyond the bottom right corner of the terminal.
+-- (which will typically be 'stdout' or 'stderr').
+--
+-- There is no \'ANSI\' control character sequence that reports the terminal
+-- size. So, it attempts to set the cursor position beyond the bottom right
+-- corner of the terminal and then use 'hGetCursorPosition' to query the 
console
+-- input stream. It works only on terminals that support each step.
 --
 -- 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.
--- (Command Prompt and PowerShell are based on the Win32 console.)
+-- as mintty, that are not based on the Windows' Console API. (Command Prompt
+-- and PowerShell are based on the Console API.)
+--
+-- For a different approach, one that does not use control character sequences,
+-- see the
+-- <https://hackage.haskell.org/package/terminal-size terminal-size> package.
 --
 -- @since 0.10.1
 hGetTerminalSize :: Handle -> IO (Maybe (Int, Int))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ansi-terminal-0.11/src/includes/Exports-Include.hs 
new/ansi-terminal-0.11.1/src/includes/Exports-Include.hs
--- old/ansi-terminal-0.11/src/includes/Exports-Include.hs      2020-08-10 
22:36:14.000000000 +0200
+++ new/ansi-terminal-0.11.1/src/includes/Exports-Include.hs    2021-11-23 
21:48:28.000000000 +0100
@@ -26,7 +26,7 @@
     -- the same.
     --
     -- Also keep in mind that @*Line@ functions are not as portable. See
-    -- <https://github.com/feuerbach/ansi-terminal/issues/10> for the details.
+    -- <https://github.com/UnkindPartition/ansi-terminal/issues/10> for the 
details.
   , cursorUpLine
   , cursorDownLine
   , hCursorUpLine

Reply via email to