Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ghc-rio for openSUSE:Factory checked in at 2021-08-25 20:57:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-rio (Old) and /work/SRC/openSUSE:Factory/.ghc-rio.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-rio" Wed Aug 25 20:57:35 2021 rev:19 rq:912756 version:0.1.21.0 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-rio/ghc-rio.changes 2021-02-16 22:45:44.910366384 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-rio.new.1899/ghc-rio.changes 2021-08-25 20:58:50.785110920 +0200 @@ -1,0 +2,8 @@ +Mon Aug 9 15:16:53 UTC 2021 - [email protected] + +- Update rio to version 0.1.21.0. + ## 0.1.21.0 + + * Fix minor bug in `augmentPathMap` on windows wrt [#234](https://github.com/commercialhaskell/rio/issues/234) not adhering to case-insensitive semantics + +------------------------------------------------------------------- Old: ---- rio-0.1.20.0.tar.gz New: ---- rio-0.1.21.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-rio.spec ++++++ --- /var/tmp/diff_new_pack.MoX1Ir/_old 2021-08-25 20:58:51.177110405 +0200 +++ /var/tmp/diff_new_pack.MoX1Ir/_new 2021-08-25 20:58:51.181110400 +0200 @@ -19,7 +19,7 @@ %global pkg_name rio %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.1.20.0 +Version: 0.1.21.0 Release: 0 Summary: A standard library for Haskell License: MIT ++++++ rio-0.1.20.0.tar.gz -> rio-0.1.21.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rio-0.1.20.0/ChangeLog.md new/rio-0.1.21.0/ChangeLog.md --- old/rio-0.1.20.0/ChangeLog.md 2021-01-25 05:18:07.000000000 +0100 +++ new/rio-0.1.21.0/ChangeLog.md 2021-08-09 16:53:57.000000000 +0200 @@ -1,5 +1,9 @@ # Changelog for rio +## 0.1.21.0 + +* Fix minor bug in `augmentPathMap` on windows wrt [#234](https://github.com/commercialhaskell/rio/issues/234) not adhering to case-insensitive semantics + ## 0.1.20.0 * Export `UnliftIO.QSem` and `UnliftIO.QSemN` in `RIO` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rio-0.1.20.0/README.md new/rio-0.1.21.0/README.md --- old/rio-0.1.20.0/README.md 2021-01-25 05:18:07.000000000 +0100 +++ new/rio-0.1.21.0/README.md 2021-08-09 16:21:34.000000000 +0200 @@ -4,7 +4,7 @@  -[](https://dev.azure.com/snoyberg/rio/_build/latest?definitionId=6&branchName=master) + The goal of the `rio` library is to make it easier to adopt Haskell for writing production software. It is intended as a cross between: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rio-0.1.20.0/rio.cabal new/rio-0.1.21.0/rio.cabal --- old/rio-0.1.20.0/rio.cabal 2021-01-25 05:18:07.000000000 +0100 +++ new/rio-0.1.21.0/rio.cabal 2021-08-09 16:54:24.000000000 +0200 @@ -1,13 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.33.0. +-- This file has been generated from package.yaml by hpack version 0.34.4. -- -- see: https://github.com/sol/hpack --- --- hash: f3c92fe72c8e7fd35fdebcde2b50c754eec24d9c4d5bc1bded6f7876503fb693 name: rio -version: 0.1.20.0 +version: 0.1.21.0 synopsis: A standard library for Haskell description: See README and Haddocks at <https://www.stackage.org/package/rio> category: Control @@ -94,7 +92,7 @@ hs-source-dirs: src/ build-depends: - base >=4.10 && <10 + base >=4.12 && <10 , bytestring , containers , deepseq @@ -142,7 +140,7 @@ test build-depends: QuickCheck - , base >=4.10 && <10 + , base >=4.12 && <10 , bytestring , containers , deepseq @@ -172,3 +170,5 @@ build-depends: unix default-language: Haskell2010 + build-tool-depends: + hspec-discover:hspec-discover diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rio-0.1.20.0/src/RIO/Prelude/Logger.hs new/rio-0.1.21.0/src/RIO/Prelude/Logger.hs --- old/rio-0.1.20.0/src/RIO/Prelude/Logger.hs 2021-01-25 05:18:07.000000000 +0100 +++ new/rio-0.1.21.0/src/RIO/Prelude/Logger.hs 2021-08-09 05:30:06.000000000 +0200 @@ -335,6 +335,8 @@ -- | Create a 'LogOptions' value from the given 'Handle' and whether -- to perform verbose logging or not. Individiual settings can be -- overridden using appropriate @set@ functions. +-- Logging output is guaranteed to be non-interleaved only for a +-- UTF-8 'Handle' in a multi-thread environment. -- -- When Verbose Flag is @True@, the following happens: -- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rio-0.1.20.0/src/RIO/Process.hs new/rio-0.1.21.0/src/RIO/Process.hs --- old/rio-0.1.20.0/src/RIO/Process.hs 2021-01-25 05:18:07.000000000 +0100 +++ new/rio-0.1.21.0/src/RIO/Process.hs 2021-08-09 16:53:57.000000000 +0200 @@ -5,6 +5,7 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE ViewPatterns #-} -- | Interacting with external processes. -- @@ -190,7 +191,7 @@ | ExecutableNotFound String [FilePath] | ExecutableNotFoundAt FilePath | PathsInvalidInPath [FilePath] - deriving Typeable + deriving (Typeable, Eq) instance Show ProcessException where show NoPathFound = "PATH not found in ProcessContext" show (ExecutableNotFound name path) = concat @@ -269,7 +270,7 @@ -- -- @since 0.0.3.0 mkProcessContext :: MonadIO m => EnvVars -> m ProcessContext -mkProcessContext tm' = do +mkProcessContext (normalizePathEnv -> tm) = do ref <- newIORef Map.empty return ProcessContext { pcTextMap = tm @@ -287,10 +288,6 @@ , pcWorkingDir = Nothing } where - -- Fix case insensitivity of the PATH environment variable on Windows. - tm - | isWindows = Map.fromList $ map (first T.toUpper) $ Map.toList tm' - | otherwise = tm' -- Default value for PATHTEXT on Windows versions after Windows XP. (The -- documentation of the default at -- https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/start @@ -298,6 +295,14 @@ defaultPATHEXT = ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC" +-- Fix case insensitivity of the PATH environment variable on Windows, +-- by forcing all keys full uppercase. +normalizePathEnv :: EnvVars -> EnvVars +normalizePathEnv env + | isWindows = Map.fromList $ map (first T.toUpper) $ Map.toList env + | otherwise = env + + -- | Reset the executable cache. -- -- @since 0.0.3.0 @@ -654,7 +659,8 @@ pc <- view processContextL return $ pcExeExtensions pc --- | Augment the PATH environment variable with the given extra paths. +-- | Augment the PATH environment variable with the given extra paths, +-- which are prepended (as in: they take precedence). -- -- @since 0.0.3.0 augmentPath :: [FilePath] -> Maybe Text -> Either ProcessException Text @@ -670,7 +676,7 @@ -- -- @since 0.0.3.0 augmentPathMap :: [FilePath] -> EnvVars -> Either ProcessException EnvVars -augmentPathMap dirs origEnv = +augmentPathMap dirs (normalizePathEnv -> origEnv) = do path <- augmentPath dirs mpath return $ Map.insert "PATH" path origEnv where diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rio-0.1.20.0/test/RIO/Prelude/ExtraSpec.hs new/rio-0.1.21.0/test/RIO/Prelude/ExtraSpec.hs --- old/rio-0.1.20.0/test/RIO/Prelude/ExtraSpec.hs 2021-01-25 05:18:07.000000000 +0100 +++ new/rio-0.1.21.0/test/RIO/Prelude/ExtraSpec.hs 2021-08-09 16:53:57.000000000 +0200 @@ -1,8 +1,16 @@ +{-# LANGUAGE CPP #-} +{-# LANGUAGE OverloadedStrings #-} + module RIO.Prelude.ExtraSpec (spec) where import RIO +import RIO.Process import Test.Hspec +import qualified Data.Map as Map +import qualified Data.Text as T +import qualified System.FilePath as FP + spec :: Spec spec = do describe "foldMapM" $ do @@ -11,3 +19,25 @@ helper = pure . pure res <- foldMapM helper [1..10] res `shouldBe` [1..10] + describe "augmentPathMap" $ do + -- https://github.com/commercialhaskell/rio/issues/234 + it "Doesn't duplicate PATH keys on windows" $ do + let pathKey :: T.Text +#if WINDOWS + pathKey = "Path" +#else + pathKey = "PATH" +#endif + origEnv :: EnvVars + origEnv = Map.fromList [ ("foo", "3") + , ("bar", "baz") + , (pathKey, makePath ["/local/bin", "/usr/bin"]) + ] + let res = second (fmap getPaths . Map.lookup "PATH") $ augmentPathMap ["/bin"] origEnv + res `shouldBe` Right (Just ["/bin", "/local/bin", "/usr/bin"]) + where + makePath :: [T.Text] -> T.Text + makePath = T.intercalate (T.singleton FP.searchPathSeparator) + + getPaths :: T.Text -> [T.Text] + getPaths = fmap T.pack . FP.splitSearchPath . T.unpack
