mirror of
https://github.com/Start9Labs/registry.git
synced 2026-04-01 20:44:15 +00:00
fix handling of using index endpoint to fetch package at specific version
This commit is contained in:
committed by
Keagan McClelland
parent
455e1d9e77
commit
0cf13f46e6
@@ -38,7 +38,9 @@ import Database.Esqueleto.Experimental
|
||||
)
|
||||
import Lib.Types.AppIndex ( PkgId )
|
||||
import Lib.Types.Category
|
||||
import Lib.Types.Emver ( Version )
|
||||
import Lib.Types.Emver ( Version
|
||||
, VersionRange
|
||||
)
|
||||
import Model
|
||||
import Startlude hiding ( (%)
|
||||
, from
|
||||
@@ -103,10 +105,10 @@ zipVersions = awaitForever $ \i -> do
|
||||
filterOsCompatible :: Monad m
|
||||
=> (Version -> Bool)
|
||||
-> ConduitT
|
||||
(Entity PkgRecord, [Entity VersionRecord])
|
||||
(Entity PkgRecord, [Entity VersionRecord])
|
||||
(Entity PkgRecord, [Entity VersionRecord], VersionRange)
|
||||
(Entity PkgRecord, [Entity VersionRecord], VersionRange)
|
||||
m
|
||||
()
|
||||
filterOsCompatible p = awaitForever $ \(app, versions) -> do
|
||||
filterOsCompatible p = awaitForever $ \(app, versions, requestedVersion) -> do
|
||||
let compatible = filter (p . versionRecordOsVersion . entityVal) versions
|
||||
when (not $ null compatible) $ yield (app, compatible)
|
||||
when (not $ null compatible) $ yield (app, compatible, requestedVersion)
|
||||
|
||||
Reference in New Issue
Block a user