Add version filter to the configuration
This commit is contained in:
parent
8168804d71
commit
f395d57b33
@ -33,6 +33,7 @@ data PackageSettings = PackageSettings
|
|||||||
{ name :: Text
|
{ name :: Text
|
||||||
, template :: Text
|
, template :: Text
|
||||||
, is64 :: Bool
|
, is64 :: Bool
|
||||||
|
, version :: Text
|
||||||
, github :: Maybe (Text, Text)
|
, github :: Maybe (Text, Text)
|
||||||
, packagist :: Maybe (Text, Text)
|
, packagist :: Maybe (Text, Text)
|
||||||
, text :: Maybe (Text, [String])
|
, text :: Maybe (Text, [String])
|
||||||
@ -58,6 +59,7 @@ packageSettingsCodec = PackageSettings
|
|||||||
<$> Toml.text "name" .= name
|
<$> Toml.text "name" .= name
|
||||||
<*> Toml.text "template" .= template
|
<*> Toml.text "template" .= template
|
||||||
<*> Toml.bool "is64" .= is64
|
<*> Toml.bool "is64" .= is64
|
||||||
|
<*> Toml.text "version" .= version
|
||||||
<*> Toml.dioptional (Toml.table githubCodec "github") .= github
|
<*> Toml.dioptional (Toml.table githubCodec "github") .= github
|
||||||
<*> Toml.dioptional (Toml.table packagistCodec "packagist") .= packagist
|
<*> Toml.dioptional (Toml.table packagistCodec "packagist") .= packagist
|
||||||
<*> Toml.dioptional (Toml.table textCodec "text") .= text
|
<*> Toml.dioptional (Toml.table textCodec "text") .= text
|
||||||
|
@ -190,7 +190,7 @@ latestPackagist PackageOwner{..} = do
|
|||||||
fullName = Text.intercalate "/" [owner, name]
|
fullName = Text.intercalate "/" [owner, name]
|
||||||
|
|
||||||
pure $ HashMap.lookup fullName packagistPackages
|
pure $ HashMap.lookup fullName packagistPackages
|
||||||
>>= fmap (version . fst) . Vector.uncons
|
>>= fmap (getField @"version" . fst) . Vector.uncons
|
||||||
|
|
||||||
-- * Remote text file
|
-- * Remote text file
|
||||||
|
|
||||||
|
22
src/Main.hs
22
src/Main.hs
@ -41,7 +41,7 @@ autoUpdatable packageSettings =
|
|||||||
setting = fromJust $ find ((== "universal-ctags") . getField @"name") packageSettings
|
setting = fromJust $ find ((== "universal-ctags") . getField @"name") packageSettings
|
||||||
template = Package.DownloadTemplate $ getField @"template" setting
|
template = Package.DownloadTemplate $ getField @"template" setting
|
||||||
in Package.Updater
|
in Package.Updater
|
||||||
{ detectLatest = latestGitHub ghArguments "(v)\\."
|
{ detectLatest = latestGitHub ghArguments (getField @"version" setting)
|
||||||
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
|
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
|
||||||
, is64 = getField @"is64" setting
|
, is64 = getField @"is64" setting
|
||||||
}
|
}
|
||||||
@ -67,7 +67,7 @@ autoUpdatable packageSettings =
|
|||||||
setting = fromJust $ find ((== "jitsi-meet-desktop") . getField @"name") packageSettings
|
setting = fromJust $ find ((== "jitsi-meet-desktop") . getField @"name") packageSettings
|
||||||
template = Package.DownloadTemplate $ getField @"template" setting
|
template = Package.DownloadTemplate $ getField @"template" setting
|
||||||
in Package.Updater
|
in Package.Updater
|
||||||
{ detectLatest = latestGitHub ghArguments "(v)*"
|
{ detectLatest = latestGitHub ghArguments (getField @"version" setting)
|
||||||
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
|
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
|
||||||
, is64 = getField @"is64" setting
|
, is64 = getField @"is64" setting
|
||||||
}
|
}
|
||||||
@ -80,7 +80,7 @@ autoUpdatable packageSettings =
|
|||||||
setting = fromJust $ find ((== "php82") . getField @"name") packageSettings
|
setting = fromJust $ find ((== "php82") . getField @"name") packageSettings
|
||||||
template = Package.DownloadTemplate $ getField @"template" setting
|
template = Package.DownloadTemplate $ getField @"template" setting
|
||||||
in Package.Updater
|
in Package.Updater
|
||||||
{ detectLatest = latestGitHub ghArguments "(php-)8.2.\\d"
|
{ detectLatest = latestGitHub ghArguments (getField @"version" setting)
|
||||||
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
|
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
|
||||||
, is64 = getField @"is64" setting
|
, is64 = getField @"is64" setting
|
||||||
}
|
}
|
||||||
@ -93,7 +93,7 @@ autoUpdatable packageSettings =
|
|||||||
setting = fromJust $ find ((== "kitty") . getField @"name") packageSettings
|
setting = fromJust $ find ((== "kitty") . getField @"name") packageSettings
|
||||||
template = Package.DownloadTemplate $ getField @"template" setting
|
template = Package.DownloadTemplate $ getField @"template" setting
|
||||||
in Package.Updater
|
in Package.Updater
|
||||||
{ detectLatest = latestGitHub ghArguments "(v)\\."
|
{ detectLatest = latestGitHub ghArguments (getField @"version" setting)
|
||||||
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
|
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
|
||||||
, is64 = getField @"is64" setting
|
, is64 = getField @"is64" setting
|
||||||
}
|
}
|
||||||
@ -106,7 +106,7 @@ autoUpdatable packageSettings =
|
|||||||
setting = fromJust $ find ((== "rdiff-backup") . getField @"name") packageSettings
|
setting = fromJust $ find ((== "rdiff-backup") . getField @"name") packageSettings
|
||||||
template = Package.DownloadTemplate $ getField @"template" setting
|
template = Package.DownloadTemplate $ getField @"template" setting
|
||||||
in Package.Updater
|
in Package.Updater
|
||||||
{ detectLatest = latestGitHub ghArguments "(v)\\."
|
{ detectLatest = latestGitHub ghArguments (getField @"version" setting)
|
||||||
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
|
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
|
||||||
, is64 = getField @"is64" setting
|
, is64 = getField @"is64" setting
|
||||||
}
|
}
|
||||||
@ -119,7 +119,7 @@ autoUpdatable packageSettings =
|
|||||||
setting = fromJust $ find ((== "webex") . getField @"name") packageSettings
|
setting = fromJust $ find ((== "webex") . getField @"name") packageSettings
|
||||||
template = Package.DownloadTemplate $ getField @"template" setting
|
template = Package.DownloadTemplate $ getField @"template" setting
|
||||||
in Package.Updater
|
in Package.Updater
|
||||||
{ detectLatest = latestText textArguments "(Linux—)*"
|
{ detectLatest = latestText textArguments (getField @"version" setting)
|
||||||
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
|
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
|
||||||
, is64 = getField @"is64" setting
|
, is64 = getField @"is64" setting
|
||||||
}
|
}
|
||||||
@ -132,7 +132,7 @@ autoUpdatable packageSettings =
|
|||||||
setting = fromJust $ find ((== "librsync") . getField @"name") packageSettings
|
setting = fromJust $ find ((== "librsync") . getField @"name") packageSettings
|
||||||
template = Package.DownloadTemplate $ getField @"template" setting
|
template = Package.DownloadTemplate $ getField @"template" setting
|
||||||
in Package.Updater
|
in Package.Updater
|
||||||
{ detectLatest = latestGitHub ghArguments "(v)\\."
|
{ detectLatest = latestGitHub ghArguments (getField @"version" setting)
|
||||||
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
|
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
|
||||||
, is64 = getField @"is64" setting
|
, is64 = getField @"is64" setting
|
||||||
}
|
}
|
||||||
@ -145,7 +145,7 @@ autoUpdatable packageSettings =
|
|||||||
setting = fromJust $ find ((== "dmd") . getField @"name") packageSettings
|
setting = fromJust $ find ((== "dmd") . getField @"name") packageSettings
|
||||||
template = Package.DownloadTemplate $ getField @"template" setting
|
template = Package.DownloadTemplate $ getField @"template" setting
|
||||||
in Package.Updater
|
in Package.Updater
|
||||||
{ detectLatest = latestText textArguments "\\."
|
{ detectLatest = latestText textArguments (getField @"version" setting)
|
||||||
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
|
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
|
||||||
, is64 = getField @"is64" setting
|
, is64 = getField @"is64" setting
|
||||||
}
|
}
|
||||||
@ -158,7 +158,7 @@ autoUpdatable packageSettings =
|
|||||||
setting = fromJust $ find ((== "d-tools") . getField @"name") packageSettings
|
setting = fromJust $ find ((== "d-tools") . getField @"name") packageSettings
|
||||||
template = Package.DownloadTemplate $ getField @"template" setting
|
template = Package.DownloadTemplate $ getField @"template" setting
|
||||||
in Package.Updater
|
in Package.Updater
|
||||||
{ detectLatest = latestText textArguments "\\."
|
{ detectLatest = latestText textArguments (getField @"version" setting)
|
||||||
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
|
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
|
||||||
, is64 = getField @"is64" setting
|
, is64 = getField @"is64" setting
|
||||||
}
|
}
|
||||||
@ -197,7 +197,7 @@ autoUpdatable packageSettings =
|
|||||||
setting = fromJust $ find ((== "simde") . getField @"name") packageSettings
|
setting = fromJust $ find ((== "simde") . getField @"name") packageSettings
|
||||||
template = Package.DownloadTemplate $ getField @"template" setting
|
template = Package.DownloadTemplate $ getField @"template" setting
|
||||||
in Package.Updater
|
in Package.Updater
|
||||||
{ detectLatest = latestGitHub ghArguments "(v)\\."
|
{ detectLatest = latestGitHub ghArguments (getField @"version" setting)
|
||||||
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
|
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
|
||||||
, is64 = getField @"is64" setting
|
, is64 = getField @"is64" setting
|
||||||
}
|
}
|
||||||
@ -210,7 +210,7 @@ autoUpdatable packageSettings =
|
|||||||
setting = fromJust $ find ((== "nginx") . getField @"name") packageSettings
|
setting = fromJust $ find ((== "nginx") . getField @"name") packageSettings
|
||||||
template = Package.DownloadTemplate $ getField @"template" setting
|
template = Package.DownloadTemplate $ getField @"template" setting
|
||||||
in Package.Updater
|
in Package.Updater
|
||||||
{ detectLatest = latestGitHub ghArguments "(release-)\\d.[02468].\\d"
|
{ detectLatest = latestGitHub ghArguments (getField @"version" setting)
|
||||||
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
|
, getVersion = repackageWithTemplate (getField @"repackage" setting) template
|
||||||
, is64 = getField @"is64" setting
|
, is64 = getField @"is64" setting
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user