Add version filter to the configuration
All checks were successful
Build / audit (push) Successful in 8s
Build / test (push) Successful in 15m9s

This commit is contained in:
Eugen Wissner 2024-09-30 14:39:38 +02:00
parent 8168804d71
commit f395d57b33
Signed by: belka
GPG Key ID: A27FDC1E8EE902C0
3 changed files with 14 additions and 12 deletions

View File

@ -33,6 +33,7 @@ data PackageSettings = PackageSettings
{ name :: Text
, template :: Text
, is64 :: Bool
, version :: Text
, github :: Maybe (Text, Text)
, packagist :: Maybe (Text, Text)
, text :: Maybe (Text, [String])
@ -58,6 +59,7 @@ packageSettingsCodec = PackageSettings
<$> Toml.text "name" .= name
<*> Toml.text "template" .= template
<*> Toml.bool "is64" .= is64
<*> Toml.text "version" .= version
<*> Toml.dioptional (Toml.table githubCodec "github") .= github
<*> Toml.dioptional (Toml.table packagistCodec "packagist") .= packagist
<*> Toml.dioptional (Toml.table textCodec "text") .= text

View File

@ -190,7 +190,7 @@ latestPackagist PackageOwner{..} = do
fullName = Text.intercalate "/" [owner, name]
pure $ HashMap.lookup fullName packagistPackages
>>= fmap (version . fst) . Vector.uncons
>>= fmap (getField @"version" . fst) . Vector.uncons
-- * Remote text file

View File

@ -41,7 +41,7 @@ autoUpdatable packageSettings =
setting = fromJust $ find ((== "universal-ctags") . getField @"name") packageSettings
template = Package.DownloadTemplate $ getField @"template" setting
in Package.Updater
{ detectLatest = latestGitHub ghArguments "(v)\\."
{ detectLatest = latestGitHub ghArguments (getField @"version" setting)
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
, is64 = getField @"is64" setting
}
@ -67,7 +67,7 @@ autoUpdatable packageSettings =
setting = fromJust $ find ((== "jitsi-meet-desktop") . getField @"name") packageSettings
template = Package.DownloadTemplate $ getField @"template" setting
in Package.Updater
{ detectLatest = latestGitHub ghArguments "(v)*"
{ detectLatest = latestGitHub ghArguments (getField @"version" setting)
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
, is64 = getField @"is64" setting
}
@ -80,7 +80,7 @@ autoUpdatable packageSettings =
setting = fromJust $ find ((== "php82") . getField @"name") packageSettings
template = Package.DownloadTemplate $ getField @"template" setting
in Package.Updater
{ detectLatest = latestGitHub ghArguments "(php-)8.2.\\d"
{ detectLatest = latestGitHub ghArguments (getField @"version" setting)
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
, is64 = getField @"is64" setting
}
@ -93,7 +93,7 @@ autoUpdatable packageSettings =
setting = fromJust $ find ((== "kitty") . getField @"name") packageSettings
template = Package.DownloadTemplate $ getField @"template" setting
in Package.Updater
{ detectLatest = latestGitHub ghArguments "(v)\\."
{ detectLatest = latestGitHub ghArguments (getField @"version" setting)
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
, is64 = getField @"is64" setting
}
@ -106,7 +106,7 @@ autoUpdatable packageSettings =
setting = fromJust $ find ((== "rdiff-backup") . getField @"name") packageSettings
template = Package.DownloadTemplate $ getField @"template" setting
in Package.Updater
{ detectLatest = latestGitHub ghArguments "(v)\\."
{ detectLatest = latestGitHub ghArguments (getField @"version" setting)
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
, is64 = getField @"is64" setting
}
@ -119,7 +119,7 @@ autoUpdatable packageSettings =
setting = fromJust $ find ((== "webex") . getField @"name") packageSettings
template = Package.DownloadTemplate $ getField @"template" setting
in Package.Updater
{ detectLatest = latestText textArguments "(Linux—)*"
{ detectLatest = latestText textArguments (getField @"version" setting)
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
, is64 = getField @"is64" setting
}
@ -132,7 +132,7 @@ autoUpdatable packageSettings =
setting = fromJust $ find ((== "librsync") . getField @"name") packageSettings
template = Package.DownloadTemplate $ getField @"template" setting
in Package.Updater
{ detectLatest = latestGitHub ghArguments "(v)\\."
{ detectLatest = latestGitHub ghArguments (getField @"version" setting)
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
, is64 = getField @"is64" setting
}
@ -145,7 +145,7 @@ autoUpdatable packageSettings =
setting = fromJust $ find ((== "dmd") . getField @"name") packageSettings
template = Package.DownloadTemplate $ getField @"template" setting
in Package.Updater
{ detectLatest = latestText textArguments "\\."
{ detectLatest = latestText textArguments (getField @"version" setting)
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
, is64 = getField @"is64" setting
}
@ -158,7 +158,7 @@ autoUpdatable packageSettings =
setting = fromJust $ find ((== "d-tools") . getField @"name") packageSettings
template = Package.DownloadTemplate $ getField @"template" setting
in Package.Updater
{ detectLatest = latestText textArguments "\\."
{ detectLatest = latestText textArguments (getField @"version" setting)
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
, is64 = getField @"is64" setting
}
@ -197,7 +197,7 @@ autoUpdatable packageSettings =
setting = fromJust $ find ((== "simde") . getField @"name") packageSettings
template = Package.DownloadTemplate $ getField @"template" setting
in Package.Updater
{ detectLatest = latestGitHub ghArguments "(v)\\."
{ detectLatest = latestGitHub ghArguments (getField @"version" setting)
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
, is64 = getField @"is64" setting
}
@ -210,7 +210,7 @@ autoUpdatable packageSettings =
setting = fromJust $ find ((== "nginx") . getField @"name") packageSettings
template = Package.DownloadTemplate $ getField @"template" setting
in Package.Updater
{ detectLatest = latestGitHub ghArguments "(release-)\\d.[02468].\\d"
{ detectLatest = latestGitHub ghArguments (getField @"version" setting)
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
, is64 = getField @"is64" setting
}