arch-hs-0.4.0.0: Distribute hackage packages to archlinux
Copyright(c) 2020 berberman
LicenseMIT
Maintainerberberman <1793913507@qq.com>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Distribution.ArchHs.Utils

Description

Miscellaneous functions used crossing modules.

Synopsis

Documentation

getPkgVersion :: PackageDescription -> Version Source #

Extract the package version from PackageDescription.

unExe :: ExeDependency -> PackageName Source #

Extract the package name from a ExeDependency.

unExeV :: ExeDependency -> (PackageName, VersionRange) Source #

Extract the package name and the version range from a ExeDependency.

unLegacyExeV :: LegacyExeDependency -> (PackageName, VersionRange) Source #

Extract the package name and the version range from a LegacyExeDependency.

unBuildTools :: ([LegacyExeDependency], [ExeDependency]) -> [(PackageName, VersionRange)] Source #

Extract and join package names and version ranges of '[LegacyExeDependency]' and '[ExeDependency]'.

getUrl :: PackageDescription -> String Source #

Extract the url from PackageDescription. It tries homepage, the head of sourceRepos, and finally fallback into hackage website.

getTwo :: Getting b s b -> s -> s -> (b, b) Source #

Apply a Getting to two values respectively, and get the result as a pair.

buildToolsAndbuildToolDependsIfBuild :: BuildInfo -> ([LegacyExeDependency], [ExeDependency]) Source #

buildToolDepends combined with buildTools, and check if this is buildable. Actually, we should avoid accessing these two fields directly, in in favor of getAllToolDependencies

trace' :: MemberWithError Trace r => String -> Sem r () Source #

Trace with prefix [TRACE].

depNotMyself :: PackageName -> SolvedDependency -> Bool Source #

SolvedDependency x's name is not equal to name.

extractFromEVR :: String -> CommunityVersion Source #

Extract package version from epoch-version-release.

>>> extractFromEVR "8.10.2-1"
"8.10.2"
>>> extractFromEVR "3:2.4.11-19"
"2.4.11"