summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2023-10-28 03:31:10 +0200
committerEugen Wissner <belka@caraus.de>2023-10-28 03:32:39 +0200
commitfa6d93c5ca84a67a222d7b18f958cbf21130d330 (patch)
treedb9c84a3138b216e06f1f6776a8ca6ee160253af /lib
parent6c0e2c2d24f380e5bdf6f1fce36ea7ee11afe6ea (diff)
downloadslackbuilder-fa6d93c5ca84a67a222d7b18f958cbf21130d330.tar.gz
Allow updater save a function for each download
There are source that can be downloaded as archive, for example cloning repositories with submodules. So how source are downloaded should be changable per download.
Diffstat (limited to 'lib')
-rw-r--r--lib/SlackBuilder/Package.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/SlackBuilder/Package.hs b/lib/SlackBuilder/Package.hs
index 6907d47..8310858 100644
--- a/lib/SlackBuilder/Package.hs
+++ b/lib/SlackBuilder/Package.hs
@@ -17,7 +17,6 @@ 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
@@ -25,7 +24,6 @@ data Package = Package
, downloaders :: [Updater]
, category :: Text
, name :: Text
- , reupload :: Maybe [CmdSpec]
}
-- | Download URI with the MD5 checksum of the target.
@@ -79,4 +77,7 @@ renderDownloadWithVersion (DownloadTemplate components) version =
f VersionPlaceholder = (version <>)
-- | Function used to get the latest version of a source.
-data Updater = Updater (SlackBuilderT (Maybe Text)) DownloadTemplate
+data Updater = Updater
+ { detectLatest :: SlackBuilderT (Maybe Text)
+ , getVersion :: Text -> Text -> SlackBuilderT (URI, Digest MD5)
+ }