Commit 8899f9fc authored by Oleg Grenrus's avatar Oleg Grenrus

Add CabalSpecV3_4, make cabalSpecLatest be it

parent c5cfe272
...@@ -26,11 +26,8 @@ data CabalSpecVersion ...@@ -26,11 +26,8 @@ data CabalSpecVersion
| CabalSpecV2_2 | CabalSpecV2_2
| CabalSpecV2_4 | CabalSpecV2_4
| CabalSpecV3_0 | CabalSpecV3_0
-- ^ we need this value for solver -- 3.2: no changes
-- to represent GPDs which it should skip | CabalSpecV3_4
--
-- We could filter the files already in package reading phase,
-- but then files would be silently omitted.
deriving (Eq, Ord, Show, Read, Enum, Bounded, Typeable, Data, Generic) deriving (Eq, Ord, Show, Read, Enum, Bounded, Typeable, Data, Generic)
instance Binary CabalSpecVersion instance Binary CabalSpecVersion
...@@ -41,6 +38,7 @@ instance NFData CabalSpecVersion where rnf = genericRnf ...@@ -41,6 +38,7 @@ instance NFData CabalSpecVersion where rnf = genericRnf
-- --
-- @since 3.0.0.0 -- @since 3.0.0.0
showCabalSpecVersion :: CabalSpecVersion -> String showCabalSpecVersion :: CabalSpecVersion -> String
showCabalSpecVersion CabalSpecV3_4 = "3.4"
showCabalSpecVersion CabalSpecV3_0 = "3.0" showCabalSpecVersion CabalSpecV3_0 = "3.0"
showCabalSpecVersion CabalSpecV2_4 = "2.4" showCabalSpecVersion CabalSpecV2_4 = "2.4"
showCabalSpecVersion CabalSpecV2_2 = "2.2" showCabalSpecVersion CabalSpecV2_2 = "2.2"
...@@ -58,7 +56,7 @@ showCabalSpecVersion CabalSpecV1_2 = "1.2" ...@@ -58,7 +56,7 @@ showCabalSpecVersion CabalSpecV1_2 = "1.2"
showCabalSpecVersion CabalSpecV1_0 = "1.0" showCabalSpecVersion CabalSpecV1_0 = "1.0"
cabalSpecLatest :: CabalSpecVersion cabalSpecLatest :: CabalSpecVersion
cabalSpecLatest = CabalSpecV3_0 cabalSpecLatest = CabalSpecV3_4
-- | Parse 'CabalSpecVersion' from version digits. -- | Parse 'CabalSpecVersion' from version digits.
-- --
...@@ -66,6 +64,7 @@ cabalSpecLatest = CabalSpecV3_0 ...@@ -66,6 +64,7 @@ cabalSpecLatest = CabalSpecV3_0
-- --
cabalSpecFromVersionDigits :: [Int] -> Maybe CabalSpecVersion cabalSpecFromVersionDigits :: [Int] -> Maybe CabalSpecVersion
cabalSpecFromVersionDigits v cabalSpecFromVersionDigits v
| v == [3,4] = Just CabalSpecV3_4
| v == [3,0] = Just CabalSpecV3_0 | v == [3,0] = Just CabalSpecV3_0
| v >= [3] = Nothing | v >= [3] = Nothing
| v >= [2,3] = Just CabalSpecV2_4 | v >= [2,3] = Just CabalSpecV2_4
...@@ -85,6 +84,7 @@ cabalSpecFromVersionDigits v ...@@ -85,6 +84,7 @@ cabalSpecFromVersionDigits v
-- | @since 3.4.0.0 -- | @since 3.4.0.0
cabalSpecToVersionDigits :: CabalSpecVersion -> [Int] cabalSpecToVersionDigits :: CabalSpecVersion -> [Int]
cabalSpecToVersionDigits CabalSpecV3_4 = [3,4]
cabalSpecToVersionDigits CabalSpecV3_0 = [3,0] cabalSpecToVersionDigits CabalSpecV3_0 = [3,0]
cabalSpecToVersionDigits CabalSpecV2_4 = [2,4] cabalSpecToVersionDigits CabalSpecV2_4 = [2,4]
cabalSpecToVersionDigits CabalSpecV2_2 = [2,2] cabalSpecToVersionDigits CabalSpecV2_2 = [2,2]
......
...@@ -23,6 +23,6 @@ tests = testGroup "Distribution.Utils.Structured" ...@@ -23,6 +23,6 @@ tests = testGroup "Distribution.Utils.Structured"
, testCase "SPDX.License" $ structureHash (Proxy :: Proxy License) @?= Fingerprint 0xd3d4a09f517f9f75 0xbc3d16370d5a853a , testCase "SPDX.License" $ structureHash (Proxy :: Proxy License) @?= Fingerprint 0xd3d4a09f517f9f75 0xbc3d16370d5a853a
-- The difference is in encoding of newtypes -- The difference is in encoding of newtypes
#if MIN_VERSION_base(4,7,0) #if MIN_VERSION_base(4,7,0)
, testCase "LocalBuildInfo" $ structureHash (Proxy :: Proxy LocalBuildInfo) @?= Fingerprint 0xe0f5a6119058a02c 0x703cb61a72aa4564 , testCase "LocalBuildInfo" $ structureHash (Proxy :: Proxy LocalBuildInfo) @?= Fingerprint 0xe426ef7c5c6e25e8 0x79b156f0f3c58f79
#endif #endif
] ]
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