From 5ff928a5a05c5687bdff31693d9e256ffd891a23 Mon Sep 17 00:00:00 2001 From: Christopher Sasarak Date: Fri, 17 Feb 2023 15:51:58 -0600 Subject: [PATCH 1/4] Increase version bounds for deps. The motiviation for this is that newer versions of the compiler use a version of bytestring than this package and its deps allow. Fixup fixup --- cabal.project | 10 ++++++++++ codec-rpm.cabal | 12 ++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 cabal.project diff --git a/cabal.project b/cabal.project new file mode 100644 index 0000000..bf3f21f --- /dev/null +++ b/cabal.project @@ -0,0 +1,10 @@ +packages: . + +-- cpio-conduit-0.7.2 on hackage has an incompatibility with newer versions of +-- base16-bytestring. A PR was merged to fix this, but +-- a new release was never cut to hackage. +-- Remove this when version 0.7.3 is released to hackage. +source-repository-package + type: git + location: https://github.com/da-x/cpio-conduit + tag: 30d92919e82c5033fffac7b34288f5a7fd28e9be \ No newline at end of file diff --git a/codec-rpm.cabal b/codec-rpm.cabal index 1dcde31..020c201 100644 --- a/codec-rpm.cabal +++ b/codec-rpm.cabal @@ -1,5 +1,5 @@ name: codec-rpm -version: 0.2.2 +version: 0.2.3 synopsis: A library for manipulating RPM files description: This module provides a library for reading RPM files and converting them into useful data structures. There is currently no way to operate in @@ -10,7 +10,7 @@ author: Chris Lumens maintainer: clumens@redhat.com license: LGPL-2.1 license-file: LICENSE -cabal-version: >= 1.18 +cabal-version: 1.18 build-type: Simple extra-source-files: ChangeLog.md, @@ -36,10 +36,10 @@ library other-modules: Codec.RPM.Internal.Numbers - build-depends: attoparsec >= 0.12.1.4 && < 0.14, + build-depends: attoparsec >= 0.12.1.4 && < 0.15, attoparsec-binary >= 0.2 && < 0.3, base >= 4.7 && < 5.0, - bytestring >= 0.10 && < 0.11, + bytestring >= 0.10 && < 0.12, conduit >= 1.2.8 && < 1.4, conduit-extra >= 1.1.15 && < 1.4, cpio-conduit >= 0.7.0 && < 0.8.0, @@ -83,10 +83,10 @@ test-suite tests Codec.RPM.VersionSpec build-depends: HUnit >= 1.5.0.0 && < 1.7, - hspec >= 2.4.4 && < 2.6, + hspec >= 2.4.4 && < 2.11, hspec-attoparsec >= 0.1.0.2 && < 0.2, base >= 4.7 && < 5.0, - bytestring >= 0.10 && < 0.11, + bytestring >= 0.10 && < 0.12, attoparsec >= 0.12.1.4 && < 0.14, attoparsec-binary >= 0.2 && < 0.3, parsec >= 3.1.11 && < 3.2, From 408a829e587953fc78610ca747a6aea502f6929c Mon Sep 17 00:00:00 2001 From: Christopher Sasarak Date: Fri, 17 Feb 2023 15:52:56 -0600 Subject: [PATCH 2/4] Clean up deprecation warnings for use of Conduit --- Codec/RPM/Conduit.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Codec/RPM/Conduit.hs b/Codec/RPM/Conduit.hs index 063725c..77fb554 100644 --- a/Codec/RPM/Conduit.hs +++ b/Codec/RPM/Conduit.hs @@ -21,7 +21,7 @@ import Control.Monad.Except(MonadError, throwError) import Control.Monad.Trans.Resource(MonadResource) import qualified Data.ByteString as BS import qualified Data.ByteString.Char8 as C -import Data.Conduit((.|), Conduit, awaitForever, yield) +import Data.Conduit((.|), ConduitT, awaitForever, yield) import Data.Conduit.Attoparsec(ParseError, conduitParserEither) import Data.Conduit.Lzma(decompress) import Data.CPIO(Entry, readCPIO) @@ -40,19 +40,19 @@ import Codec.RPM.Types(RPM(..)) -- On success, the 'RPM' record will be passed down the conduit for futher processing or -- consumption. On error, the rest of the conduit will be skipped and the 'ParseError' will -- be returned as the result to be dealt with. -parseRPMC :: MonadError ParseError m => Conduit C.ByteString m RPM +parseRPMC :: MonadError ParseError m => ConduitT C.ByteString RPM m () parseRPMC = conduitParserEither parseRPM .| consumer where consumer = awaitForever $ either throwError (yield . snd) -- | Extract the package payload from an 'RPM', returning it in the conduit. -payloadC :: Monad m => Conduit RPM m BS.ByteString +payloadC :: Monad m => ConduitT RPM BS.ByteString m () payloadC = awaitForever (yield . rpmArchive) -- | Extract the package payload from an 'RPM', decompress it, and return each element of -- the payload as a 'Data.CPIO.Entry'. -payloadContentsC :: (MonadResource m, MonadThrow m) => Conduit RPM m Entry +payloadContentsC :: (MonadResource m, MonadThrow m) => ConduitT RPM Entry m () payloadContentsC = payloadC .| decompress Nothing .| readCPIO From 37081e93b0fbdb3e560be6a390fa7f7120a1b95d Mon Sep 17 00:00:00 2001 From: Christopher Sasarak Date: Fri, 17 Feb 2023 17:25:35 -0600 Subject: [PATCH 3/4] Fix tests, conditionally import (<>) --- Codec/RPM/Version.hs | 7 +++++++ codec-rpm.cabal | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Codec/RPM/Version.hs b/Codec/RPM/Version.hs index c691611..20472d6 100644 --- a/Codec/RPM/Version.hs +++ b/Codec/RPM/Version.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} -- | -- Module: Codec.RPM.Parse -- Copyright: (c) 2017 Red Hat, Inc. @@ -23,7 +24,13 @@ module Codec.RPM.Version( import Data.Char(digitToInt, isAsciiLower, isAsciiUpper, isDigit, isSpace) import Data.Maybe(fromMaybe) + +#if MIN_VERSION_base(4,11,0) +import Data.Semigroup () +#else import Data.Monoid((<>)) +#endif + import qualified Data.Ord as Ord import qualified Data.Text as T import Data.Word(Word32) diff --git a/codec-rpm.cabal b/codec-rpm.cabal index 020c201..06f2826 100644 --- a/codec-rpm.cabal +++ b/codec-rpm.cabal @@ -82,12 +82,14 @@ test-suite tests Codec.RPM.Version, Codec.RPM.VersionSpec + build-tool-depends: hspec-discover:hspec-discover >=2.10.0.0 && < 2.11 + build-depends: HUnit >= 1.5.0.0 && < 1.7, hspec >= 2.4.4 && < 2.11, hspec-attoparsec >= 0.1.0.2 && < 0.2, base >= 4.7 && < 5.0, bytestring >= 0.10 && < 0.12, - attoparsec >= 0.12.1.4 && < 0.14, + attoparsec >= 0.12.1.4 && < 0.15, attoparsec-binary >= 0.2 && < 0.3, parsec >= 3.1.11 && < 3.2, pretty >= 1.1.2.0, From 0f7431423d47fdf36945e4ff31fbee76005b7e68 Mon Sep 17 00:00:00 2001 From: Christopher Sasarak Date: Mon, 13 Mar 2023 12:15:31 -0400 Subject: [PATCH 4/4] Update text (for GHC 9.4) --- codec-rpm.cabal | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codec-rpm.cabal b/codec-rpm.cabal index 06f2826..7948b2d 100644 --- a/codec-rpm.cabal +++ b/codec-rpm.cabal @@ -49,7 +49,7 @@ library parsec >= 3.1.11 && < 3.2, pretty >= 1.1.2.0, resourcet >= 1.1.9 && < 1.3, - text >= 1.2.2.0 && < 1.3 + text >= 1.2.2.0 && < 2.1 default-language: Haskell2010 @@ -93,7 +93,7 @@ test-suite tests attoparsec-binary >= 0.2 && < 0.3, parsec >= 3.1.11 && < 3.2, pretty >= 1.1.2.0, - text >= 1.2.2.0 && < 1.3 + text >= 1.2.2.0 && < 2.1 default-language: Haskell2010