mirror of
https://github.com/input-output-hk/foliage.git
synced 2024-12-01 21:02:16 +03:00
Merge pull request #66 from amesgen/fix-deprecations
Fix `preferred-versions` format
This commit is contained in:
commit
7474ed7e4c
@ -320,8 +320,13 @@ getExtraEntries packageVersions =
|
|||||||
-- Calculate (by applying them chronologically) the effective `VersionRange` for the package group.
|
-- Calculate (by applying them chronologically) the effective `VersionRange` for the package group.
|
||||||
effectiveRanges :: [(UTCTime, VersionRange)]
|
effectiveRanges :: [(UTCTime, VersionRange)]
|
||||||
effectiveRanges = NE.tail $ NE.scanl applyChangeToRange (posixSecondsToUTCTime 0, anyVersion) deprecationChanges
|
effectiveRanges = NE.tail $ NE.scanl applyChangeToRange (posixSecondsToUTCTime 0, anyVersion) deprecationChanges
|
||||||
|
|
||||||
-- Create a `Tar.Entry` for the package group, its computed `VersionRange` and a timestamp.
|
-- Create a `Tar.Entry` for the package group, its computed `VersionRange` and a timestamp.
|
||||||
createTarEntry (ts, effectiveRange) = mkTarEntry (BL.pack $ prettyShow effectiveRange) (IndexPkgPrefs pn) ts
|
createTarEntry (ts, effectiveRange) = mkTarEntry (BL.pack $ prettyShow dep) (IndexPkgPrefs pn) ts
|
||||||
|
where
|
||||||
|
-- Cabal uses `Dependency` to represent preferred versions, cf.
|
||||||
|
-- `parsePreferredVersions`. The (sub)libraries part is ignored.
|
||||||
|
dep = mkDependency pn effectiveRange mainLibSet
|
||||||
in foldMap generateEntriesForGroup groupedPackageVersions
|
in foldMap generateEntriesForGroup groupedPackageVersions
|
||||||
|
|
||||||
-- TODO: the functions belows should be moved to Foliage.PreparedPackageVersion
|
-- TODO: the functions belows should be moved to Foliage.PreparedPackageVersion
|
||||||
|
Loading…
Reference in New Issue
Block a user