-- | Generates a 'PackageKey' from a 'PackageId', sorted package keys of the
-- immediate dependencies.
mkPackageKey :: Bool -- are modern style package keys supported?
             -> PackageId
             -> [LibraryName] -- dependencies
             -> PackageKey
mkPackageKey True pid deps =
    fingerprintPackageKey . fingerprintString $
        display pid ++ "\n" ++
        concat [ display dep ++ "\n" | dep <- sort deps ]
mkPackageKey :: Bool -- are modern style package keys supported?
             -> PackageId
             -> [LibraryName] -- dependencies
             -> PackageKey
mkPackageKey True pid deps =
    fingerprintPackageKey . fingerprintString $
        display pid ++ "\n" ++
        concat [ display dep ++ "\n" | dep <- sort deps ]
mkPackageKey True pid deps =
    fingerprintPackageKey . fingerprintString $
        display pid ++ "\n" ++
        concat [ display dep ++ "\n" | dep <- sort deps ]