Support modifying reuploaded tarballs

This commit is contained in:
2023-10-08 12:28:46 +02:00
parent f3beee3e19
commit 5e161c3dad
8 changed files with 115 additions and 56 deletions

View File

@ -17,10 +17,8 @@ data Settings = Settings
, maintainer :: MaintainerSettings
} deriving (Eq, Show)
data MaintainerSettings = MaintainerSettings
{ name :: !Text
, email :: !Text
, signature :: !Bool
newtype MaintainerSettings = MaintainerSettings
{ signature :: Bool
} deriving (Eq, Show)
settingsCodec :: Toml.TomlCodec Settings
@ -34,6 +32,4 @@ settingsCodec = Settings
maintainerSettingsCodec :: Toml.TomlCodec MaintainerSettings
maintainerSettingsCodec = MaintainerSettings
<$> Toml.text "name" .= name
<*> Toml.text "email" .= email
<*> Toml.bool "signature" .= signature
<$> Toml.bool "signature" .= signature

View File

@ -174,8 +174,8 @@ generate pkg = Lazy.Text.toStrict $ Text.Builder.toLazyText builder
<> "HOMEPAGE=\"" <> Text.Builder.fromText (homepage pkg) <> "\"\n"
<> generateMultiEntry "DOWNLOAD" (render <$> downloads pkg)
<> generateMultiEntry "MD5SUM" (digestToText <$> checksums pkg)
<> generateMultiEntry "DOWNLOAD_x86_64" (render <$> downloads pkg)
<> generateMultiEntry "MD5SUM_x86_64" (digestToText <$> checksums pkg)
<> generateMultiEntry "DOWNLOAD_x86_64" (render <$> downloadX64 pkg)
<> generateMultiEntry "MD5SUM_x86_64" (digestToText <$> checksumX64 pkg)
<> "REQUIRES=\"" <> fromByteStringWords (requires pkg) <> "\"\n"
<> "MAINTAINER=\"" <> Text.Builder.fromText (maintainer pkg) <> "\"\n"
<> "EMAIL=\"" <> Text.Builder.fromText (email pkg) <> "\"\n"

View File

@ -17,15 +17,14 @@ import qualified Text.URI as URI
import Crypto.Hash (Digest, MD5)
import SlackBuilder.Trans
import Control.Monad.Catch (MonadThrow)
import System.Process (CmdSpec(..))
-- | Contains information how a package can be updated.
data Package = Package
{ latest :: Updater
, category :: Text
, name :: Text
, homepage :: URI
, requires :: [Text]
, reupload :: Bool
, reupload :: Maybe [CmdSpec]
}
-- | Download URI with the MD5 checksum of the target.