Commit 64172015 authored by Adam C. Foltzer's avatar Adam C. Foltzer Committed by tibbe
Browse files

Build a Version the right way in Strip module

per @23Skidoo's suggestion in #2356

(cherry picked from commit 62545735)
parent d34630c7
...@@ -15,11 +15,11 @@ import Distribution.Simple.Program (ProgramConfiguration, lookupProgram ...@@ -15,11 +15,11 @@ import Distribution.Simple.Program (ProgramConfiguration, lookupProgram
, stripProgram) , stripProgram)
import Distribution.Simple.Utils (warn) import Distribution.Simple.Utils (warn)
import Distribution.System (Arch(..), Platform(..), OS (..), buildOS) import Distribution.System (Arch(..), Platform(..), OS (..), buildOS)
import Distribution.Text (simpleParse)
import Distribution.Verbosity (Verbosity) import Distribution.Verbosity (Verbosity)
import Distribution.Version (withinRange) import Distribution.Version (orLaterVersion, withinRange)
import Control.Monad (unless) import Control.Monad (unless)
import Data.Version (Version(..))
import System.FilePath (takeBaseName) import System.FilePath (takeBaseName)
runStrip :: Verbosity -> ProgramConfiguration -> FilePath -> [String] -> IO () runStrip :: Verbosity -> ProgramConfiguration -> FilePath -> [String] -> IO ()
...@@ -59,7 +59,7 @@ stripLib verbosity (Platform arch os) conf path = do ...@@ -59,7 +59,7 @@ stripLib verbosity (Platform arch os) conf path = do
Linux | arch == I386 -> Linux | arch == I386 ->
-- Versions of 'strip' on 32-bit Linux older than 2.18 are -- Versions of 'strip' on 32-bit Linux older than 2.18 are
-- broken. See #2339. -- broken. See #2339.
let (Just okVersion) = simpleParse ">= 2.18" let okVersion = orLaterVersion (Version [2,18] [])
in case programVersion =<< lookupProgram stripProgram conf of in case programVersion =<< lookupProgram stripProgram conf of
Just v | withinRange v okVersion -> Just v | withinRange v okVersion ->
runStrip verbosity conf path args runStrip verbosity conf path args
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment