definition:
|
findAllVersions :: LookupSet -> String -> Bool -> [Package]
findAllVersions (LookupSet ls o) p pre = localSorted' ++ nonLocalSorted
where
packageVersions = case Table.lookup p ls of
Nothing -> []
Just vs -> vs
onlyLocal = filter isLocal packageVersions
onlyNonLocal = filter (not . isLocal) packageVersions
localSorted = sortedByVersion $ preFiltered $ sameName $ ps $ onlyLocal
localSorted' = filter (not . (flip elem) (ignoreLocalVersions o) . name) localSorted
nonLocalSorted = sortedByVersion $ preFiltered $ sameName $ ps $ onlyNonLocal
sortedByVersion = sortBy (\a b -> (version a) `vgt` (version b))
preFiltered = filter filterPre
sameName = filter ((== p) . name)
filterPre p' = pre || (not . isPreRelease . version) p'
isLocal (FromLocalCache, _) = True
isLocal (FromGlobalCache, _) = False
isLocal (FromRepository, _) = False
ps = map snd
|
demand:
|
argument 1
|
deterministic:
|
deterministic operation
|
documentation:
|
--- Finds all versions of a package known to the lookup set. Returns the
--- packages from the local cache first, and then from other sources. Each
--- group is sorted from newest do oldest version.
---
--- @param l the lookup set
--- @param p the name of the package to search for
--- @param pre should pre-release versions be included?
|
failfree:
|
<FAILING>
|
indeterministic:
|
referentially transparent operation
|
infix:
|
no fixity defined
|
iotype:
|
{({LookupSet},_,_) |-> _}
|
name:
|
findAllVersions
|
precedence:
|
no precedence defined
|
result-values:
|
_
|
signature:
|
LookupSet -> String -> Prelude.Bool -> [CPM.Package.Package]
|
solution-complete:
|
operation might suspend on free variables
|
terminating:
|
possibly non-terminating
|
totally-defined:
|
possibly non-reducible on same data term
|