From 69b24c6cfa524d5367df1b9b5a7b5c8bcd8da259 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Wed, 27 Sep 2023 19:58:16 +0200 Subject: universal-ctags: Finish migrating the updater --- app/Main.hs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'app/Main.hs') diff --git a/app/Main.hs b/app/Main.hs index 5b888b4..3ea1539 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -78,14 +78,17 @@ updatePackage Package{..} version = do } Package.Updater _ downloadTemplate = latest + repository' <- SlackBuilderT $ asks repository uri' <- liftIO $ Package.renderDownloadWithVersion downloadTemplate version - let tarball = "slackbuilds/development/universal-ctags/ctags-#{version}.tar.gz" + let relativeTarball = Text.replace "#{version}" version + "development/universal-ctags/ctags-#{version}.tar.gz" + tarball = repository' Text.unpack relativeTarball + liftIO $ putStrLn + $ "Downloading " <> Text.unpack (URI.render uri') <> " to " <> tarball <> "." checksum <- fromMaybe undefined <$> download uri' tarball - download' <- liftIO - $ mkURI + download' <- liftIO $ mkURI $ Text.replace "#{version}" version "https://download.dlackware.com/hosted-sources/universal-ctags/ctags-#{version}.tar.gz" - repository' <- SlackBuilderT $ asks repository let infoFilePath = repository' Text.unpack packagePath (Text.unpack name <.> "info") @@ -93,8 +96,9 @@ updatePackage Package{..} version = do $ Package.infoTemplate package' [Package.Download download' checksum False] updateSlackBuildVersion packagePath version - remotePath' <- SlackBuilderT $ asks remotePath - uploadCommand (Text.pack tarball) $ remotePath' <> "/universal-ctags" + liftIO $ putStrLn + $ "Upload the source tarball " <> Text.unpack relativeTarball + uploadCommand relativeTarball "/universal-ctags" commit packagePath version -- cgit v1.2.3