Unverified Commit 95a6ee3b authored by Oleg Grenrus's avatar Oleg Grenrus Committed by GitHub

Merge pull request #6663 from phadej/cabalspec-3.4

Cabalspec 3.4
parents d4ebb699 7494da98
......@@ -26,11 +26,8 @@ data CabalSpecVersion
| CabalSpecV2_2
| CabalSpecV2_4
| CabalSpecV3_0
-- ^ we need this value for solver
-- to represent GPDs which it should skip
--
-- We could filter the files already in package reading phase,
-- but then files would be silently omitted.
-- 3.2: no changes
| CabalSpecV3_4
deriving (Eq, Ord, Show, Read, Enum, Bounded, Typeable, Data, Generic)
instance Binary CabalSpecVersion
......@@ -41,6 +38,7 @@ instance NFData CabalSpecVersion where rnf = genericRnf
--
-- @since 3.0.0.0
showCabalSpecVersion :: CabalSpecVersion -> String
showCabalSpecVersion CabalSpecV3_4 = "3.4"
showCabalSpecVersion CabalSpecV3_0 = "3.0"
showCabalSpecVersion CabalSpecV2_4 = "2.4"
showCabalSpecVersion CabalSpecV2_2 = "2.2"
......@@ -58,7 +56,7 @@ showCabalSpecVersion CabalSpecV1_2 = "1.2"
showCabalSpecVersion CabalSpecV1_0 = "1.0"
cabalSpecLatest :: CabalSpecVersion
cabalSpecLatest = CabalSpecV3_0
cabalSpecLatest = CabalSpecV3_4
-- | Parse 'CabalSpecVersion' from version digits.
--
......@@ -66,6 +64,7 @@ cabalSpecLatest = CabalSpecV3_0
--
cabalSpecFromVersionDigits :: [Int] -> Maybe CabalSpecVersion
cabalSpecFromVersionDigits v
| v == [3,4] = Just CabalSpecV3_4
| v == [3,0] = Just CabalSpecV3_0
| v >= [3] = Nothing
| v >= [2,3] = Just CabalSpecV2_4
......@@ -85,6 +84,7 @@ cabalSpecFromVersionDigits v
-- | @since 3.4.0.0
cabalSpecToVersionDigits :: CabalSpecVersion -> [Int]
cabalSpecToVersionDigits CabalSpecV3_4 = [3,4]
cabalSpecToVersionDigits CabalSpecV3_0 = [3,0]
cabalSpecToVersionDigits CabalSpecV2_4 = [2,4]
cabalSpecToVersionDigits CabalSpecV2_2 = [2,2]
......
......@@ -14,6 +14,7 @@ data LicenseListVersion
deriving (Eq, Ord, Show, Enum, Bounded)
cabalSpecVersionToSPDXListVersion :: CabalSpecVersion -> LicenseListVersion
cabalSpecVersionToSPDXListVersion CabalSpecV3_4 = LicenseListVersion_3_8
cabalSpecVersionToSPDXListVersion CabalSpecV3_0 = LicenseListVersion_3_6
cabalSpecVersionToSPDXListVersion CabalSpecV2_4 = LicenseListVersion_3_2
cabalSpecVersionToSPDXListVersion _ = LicenseListVersion_3_0
......@@ -19,6 +19,12 @@ relative to the respective preceding *published* version.
versions of the ``Cabal`` library denote unreleased development
branches which have no stability guarantee.
``cabal-version: 3.4``
----------------------
* License fields use identifiers from SPDX License List version
``3.8 2020-02-09``
``cabal-version: 3.0``
----------------------
......
......@@ -23,6 +23,6 @@ tests = testGroup "Distribution.Utils.Structured"
, testCase "SPDX.License" $ structureHash (Proxy :: Proxy License) @?= Fingerprint 0xd3d4a09f517f9f75 0xbc3d16370d5a853a
-- The difference is in encoding of newtypes
#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
]
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