arch-hs-0.6.1.0: Distribute hackage packages to archlinux
Copyright(c) 2020 berberman
LicenseMIT
Maintainerberberman <berberman@yandex.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]'.

unSystemDependency :: ([PkgconfigDependency], [String]) -> [SystemDependency] Source #

Extract dependency names from '[PkgconfigDependency]' and '[SystemDependency]'. >>> (PkgconfigDependency "foo" _ver) --> (SystemDependency "foo.pc") >>> "foo" --> (SystemDependency "libfoo.so")

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 -> ArchLinuxVersion 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"

isProvided :: SolvedPackage -> Bool Source #

Whether a SolvedPackage is provided

filterFirstDiff :: [Diff a] -> [Diff a] Source #

Filter values from only First list

filterFirstAndBothDiff :: [Diff a] -> [Diff a] Source #

Filter values from First and Both list

filterSecondDiff :: [Diff a] -> [Diff a] Source #

Filter values from only Second list

filterSecondAndBothDiff :: [Diff a] -> [Diff a] Source #

Filter values from Second and Both list

noDiff :: [Diff a] -> Bool Source #

Whether it only has Both

mapDiff :: (a -> b) -> Diff a -> Diff b Source #

Map value of diff

unDiff :: Diff a -> a Source #

Extract value from diff