mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-22 17:01:57 +01:00
update to lts-18
- Cabal 3.2 PackageDescription uses ShortText - esqueleto module changes - silence a few warnings
This commit is contained in:
parent
1638873d8d
commit
2f8e8ba95a
@ -81,7 +81,7 @@ main = do
|
|||||||
execParser $
|
execParser $
|
||||||
info
|
info
|
||||||
(optsParser <*
|
(optsParser <*
|
||||||
abortOption ShowHelpText (long "help" <> short 'h' <> help "Display this message."))
|
abortOption (ShowHelpText Nothing) (long "help" <> short 'h' <> help "Display this message."))
|
||||||
(header "stackage-cron - Keep stackage.org up to date" <>
|
(header "stackage-cron - Keep stackage.org up to date" <>
|
||||||
progDesc
|
progDesc
|
||||||
"Uses github.com/commercialhaskell/stackage-snapshots repository as a source \
|
"Uses github.com/commercialhaskell/stackage-snapshots repository as a source \
|
||||||
|
|||||||
@ -62,7 +62,7 @@ dependencies:
|
|||||||
- zlib
|
- zlib
|
||||||
- unordered-containers
|
- unordered-containers
|
||||||
- hashable
|
- hashable
|
||||||
- Cabal
|
- Cabal >= 3.2
|
||||||
- mono-traversable
|
- mono-traversable
|
||||||
- process
|
- process
|
||||||
- cmark-gfm
|
- cmark-gfm
|
||||||
|
|||||||
@ -25,8 +25,8 @@ import qualified Data.IntMap.Strict as IntMap
|
|||||||
import Data.Monoid (Any(..))
|
import Data.Monoid (Any(..))
|
||||||
import Data.Streaming.Network (bindPortTCP)
|
import Data.Streaming.Network (bindPortTCP)
|
||||||
import Data.Yaml (decodeFileEither)
|
import Data.Yaml (decodeFileEither)
|
||||||
import Database.Persist
|
import Database.Persist hiding (exists)
|
||||||
import Database.Persist.Postgresql
|
import Database.Persist.Postgresql hiding (exists)
|
||||||
import qualified Hoogle
|
import qualified Hoogle
|
||||||
import Network.AWS hiding (Request, Response)
|
import Network.AWS hiding (Request, Response)
|
||||||
import Network.AWS.Data.Text (toText)
|
import Network.AWS.Data.Text (toText)
|
||||||
|
|||||||
@ -38,6 +38,7 @@ import Distribution.Types.Library (exposedModules)
|
|||||||
import Distribution.Types.PackageDescription (PackageDescription(package))
|
import Distribution.Types.PackageDescription (PackageDescription(package))
|
||||||
import Distribution.Types.VersionRange (VersionRange, intersectVersionRanges,
|
import Distribution.Types.VersionRange (VersionRange, intersectVersionRanges,
|
||||||
normaliseVersionRange, withinRange)
|
normaliseVersionRange, withinRange)
|
||||||
|
import Distribution.Utils.ShortText (fromShortText)
|
||||||
import Distribution.Version (simplifyVersionRange)
|
import Distribution.Version (simplifyVersionRange)
|
||||||
import RIO
|
import RIO
|
||||||
import qualified RIO.Map as Map
|
import qualified RIO.Map as Map
|
||||||
@ -71,15 +72,15 @@ toPackageInfo ::
|
|||||||
-> PackageInfo
|
-> PackageInfo
|
||||||
toPackageInfo gpd mreadme mchangelog =
|
toPackageInfo gpd mreadme mchangelog =
|
||||||
PackageInfo
|
PackageInfo
|
||||||
{ piSynopsis = T.pack $ synopsis pd
|
{ piSynopsis = T.pack $ fromShortText $ synopsis pd
|
||||||
, piDescription = renderHaddock (description pd)
|
, piDescription = renderHaddock $ fromShortText (description pd)
|
||||||
, piReadme = maybe mempty (\(Readme bs isMarkdown) -> renderContent bs isMarkdown) mreadme
|
, piReadme = maybe mempty (\(Readme bs isMarkdown) -> renderContent bs isMarkdown) mreadme
|
||||||
, piChangelog =
|
, piChangelog =
|
||||||
maybe mempty (\(Changelog bs isMarkdown) -> renderContent bs isMarkdown) mchangelog
|
maybe mempty (\(Changelog bs isMarkdown) -> renderContent bs isMarkdown) mchangelog
|
||||||
, piAuthors = parseIdentitiesLiberally $ T.pack $ author pd
|
, piAuthors = parseIdentitiesLiberally $ T.pack . fromShortText $ author pd
|
||||||
, piMaintainers = parseIdentitiesLiberally $ T.pack $ maintainer pd
|
, piMaintainers = parseIdentitiesLiberally $ T.pack . fromShortText $ maintainer pd
|
||||||
, piHomepage =
|
, piHomepage =
|
||||||
case T.strip $ T.pack $ homepage pd of
|
case T.strip . T.pack . fromShortText $ homepage pd of
|
||||||
"" -> Nothing
|
"" -> Nothing
|
||||||
x -> Just x
|
x -> Just x
|
||||||
, piLicenseName = T.pack $ prettyShow $ license pd
|
, piLicenseName = T.pack $ prettyShow $ license pd
|
||||||
@ -93,7 +94,7 @@ toPackageInfo gpd mreadme mchangelog =
|
|||||||
else toHtml $ Textarea txt
|
else toHtml $ Textarea txt
|
||||||
|
|
||||||
getSynopsis :: GenericPackageDescription -> Text
|
getSynopsis :: GenericPackageDescription -> Text
|
||||||
getSynopsis = T.pack . synopsis . packageDescription
|
getSynopsis = T.pack . fromShortText . synopsis . packageDescription
|
||||||
|
|
||||||
extractModuleNames :: GenericPackageDescription -> [ModuleNameP]
|
extractModuleNames :: GenericPackageDescription -> [ModuleNameP]
|
||||||
extractModuleNames = maybe [] (coerce . exposedModules . condTreeData) . condLibrary
|
extractModuleNames = maybe [] (coerce . exposedModules . condTreeData) . condLibrary
|
||||||
|
|||||||
@ -78,9 +78,10 @@ module Stackage.Database.Query
|
|||||||
|
|
||||||
import qualified Data.Aeson as A
|
import qualified Data.Aeson as A
|
||||||
import qualified Data.List as L
|
import qualified Data.List as L
|
||||||
import Database.Esqueleto
|
import Database.Esqueleto.Legacy
|
||||||
import Database.Esqueleto.Internal.Language (FromPreprocess)
|
import Database.Esqueleto.Internal.Internal (FromPreprocess, SqlSelect,
|
||||||
import Database.Esqueleto.Internal.Sql
|
unsafeSqlCastAs,
|
||||||
|
unsafeSqlFunction)
|
||||||
import Distribution.Types.PackageId (PackageIdentifier(PackageIdentifier))
|
import Distribution.Types.PackageId (PackageIdentifier(PackageIdentifier))
|
||||||
import Distribution.PackageDescription (packageDescription)
|
import Distribution.PackageDescription (packageDescription)
|
||||||
import Distribution.Types.PackageDescription (PackageDescription(package))
|
import Distribution.Types.PackageDescription (PackageDescription(package))
|
||||||
@ -604,7 +605,7 @@ getSnapshotPackageLatestVersionQuery ::
|
|||||||
PackageNameP -> ReaderT SqlBackend (RIO env) (Maybe SnapshotPackageInfo)
|
PackageNameP -> ReaderT SqlBackend (RIO env) (Maybe SnapshotPackageInfo)
|
||||||
getSnapshotPackageLatestVersionQuery pname =
|
getSnapshotPackageLatestVersionQuery pname =
|
||||||
fmap snd . listToMaybe <$>
|
fmap snd . listToMaybe <$>
|
||||||
(snapshotPackageInfoQuery $ \_sp s pn v spiQ -> do
|
(snapshotPackageInfoQuery $ \_sp s pn _v spiQ -> do
|
||||||
where_ (pn ^. PackageNameName ==. val pname)
|
where_ (pn ^. PackageNameName ==. val pname)
|
||||||
orderBy [desc (s ^. SnapshotId)]
|
orderBy [desc (s ^. SnapshotId)]
|
||||||
limit 1
|
limit 1
|
||||||
|
|||||||
@ -55,7 +55,7 @@ import Data.Hashable (hashUsing, hashWithSalt)
|
|||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
import qualified Data.Text.Read as Reader
|
import qualified Data.Text.Read as Reader
|
||||||
import Data.Typeable
|
import Data.Typeable
|
||||||
import Database.Esqueleto.Internal.Language
|
import Database.Esqueleto.Internal.Internal
|
||||||
import Database.Persist
|
import Database.Persist
|
||||||
import Database.Persist.Sql (PersistFieldSql(sqlType))
|
import Database.Persist.Sql (PersistFieldSql(sqlType))
|
||||||
import qualified Distribution.ModuleName as DT (components, fromComponents,
|
import qualified Distribution.ModuleName as DT (components, fromComponents,
|
||||||
|
|||||||
21
stack.yaml
21
stack.yaml
@ -1,19 +1,10 @@
|
|||||||
resolver: lts-16.31
|
resolver: lts-18.28
|
||||||
extra-deps:
|
extra-deps:
|
||||||
- barrier-0.1.1@sha256:2021f84c3aba67bb635d72825d3bc0371942444dc014bc307b875071e29eea98,3931
|
- amazonka-1.6.1
|
||||||
- hackage-security-0.6.0.1
|
- barrier-0.1.1
|
||||||
- hoogle-5.0.18
|
- classy-prelude-yesod-1.5.0
|
||||||
- yesod-gitrepo-0.3.0@sha256:7aad996935065726ce615c395d735cc01dcef3993b1788f670f6bfc866085e02,1191
|
- unliftio-core-0.1.2.0
|
||||||
- github: commercialhaskell/pantry
|
- yesod-gitrepo-0.3.0
|
||||||
commit: c4e7c3dff9770e7937c93edfb6564dd6a1acd55e
|
|
||||||
- github: fpco/casa
|
|
||||||
commit: fc0ed26858bfc4f2966ed2dfb2871bae9266dda6
|
|
||||||
subdirs:
|
|
||||||
- casa-client
|
|
||||||
- casa-types
|
|
||||||
- github: yesodweb/persistent
|
|
||||||
commit: f66ed6f472ff3faa140db37bf4649e5b80be4c57
|
|
||||||
subdirs: [persistent]
|
|
||||||
|
|
||||||
drop-packages:
|
drop-packages:
|
||||||
- Cabal
|
- Cabal
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user