Copyright | (c) 2021-2025 berberman |
---|---|
License | MIT |
Maintainer | berberman <[email protected]> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
NvFetcher.Nvchecker
Description
nvchecker is a program checking new versions of packages.
We encode the checking process into shake build system, generating configuration of nvchecker and calling it externally.
Now we call nvchecker for each VersionSource
, which seems not to be efficient, but it's tolerable when running in parallel.
Meanwhile, we lose the capabilities of tracking version updates, i.e. normally nvchecker will help us maintain a list of old versions,
so that we are able to know which package's version is updated in this run. Fortunately, we can reimplement this in shake,
see nvcheckerRule
for details.
Synopsis
- data VersionSortMethod
- data ListOptions = ListOptions {}
- data CheckVersion = CheckVersion VersionSource NvcheckerOptions
- data NvcheckerOptions = NvcheckerOptions {}
- data VersionSource
- = GitHubRelease { }
- | GitHubTag {
- _owner :: Text
- _repo :: Text
- _listOptions :: ListOptions
- | Git { }
- | Pypi { }
- | ArchLinux { }
- | Aur { }
- | Manual { }
- | Repology { }
- | Webpage {
- _vurl :: Text
- _regex :: Text
- _listOptions :: ListOptions
- | HttpHeader {
- _vurl :: Text
- _regex :: Text
- _listOptions :: ListOptions
- | OpenVsx {
- _ovPublisher :: Text
- _ovExtName :: Text
- | VscodeMarketplace {
- _vsmPublisher :: Text
- _vsmExtName :: Text
- | Cmd { }
- | Container { }
- data NvcheckerResult = NvcheckerResult {}
- nvcheckerRule :: Rules ()
- checkVersion :: VersionSource -> NvcheckerOptions -> PackageKey -> Action NvcheckerResult
- checkVersion' :: VersionSource -> NvcheckerOptions -> Action NvcheckerResult
Types
data VersionSortMethod Source #
Constructors
ParseVersion | |
Vercmp |
Instances
data ListOptions Source #
Filter-like configuration for some version sources. See https://nvchecker.readthedocs.io/en/latest/usage.html#list-options for details.
Constructors
ListOptions | |
Fields |
Instances
Generic ListOptions Source # | |||||
Defined in NvFetcher.Types Associated Types
| |||||
Show ListOptions Source # | |||||
Defined in NvFetcher.Types Methods showsPrec :: Int -> ListOptions -> ShowS # show :: ListOptions -> String # showList :: [ListOptions] -> ShowS # | |||||
Binary ListOptions Source # | |||||
Defined in NvFetcher.Types | |||||
Default ListOptions Source # | |||||
Defined in NvFetcher.Types Methods def :: ListOptions # | |||||
NFData ListOptions Source # | |||||
Defined in NvFetcher.Types Methods rnf :: ListOptions -> () # | |||||
Eq ListOptions Source # | |||||
Defined in NvFetcher.Types | |||||
Ord ListOptions Source # | |||||
Defined in NvFetcher.Types Methods compare :: ListOptions -> ListOptions -> Ordering # (<) :: ListOptions -> ListOptions -> Bool # (<=) :: ListOptions -> ListOptions -> Bool # (>) :: ListOptions -> ListOptions -> Bool # (>=) :: ListOptions -> ListOptions -> Bool # max :: ListOptions -> ListOptions -> ListOptions # min :: ListOptions -> ListOptions -> ListOptions # | |||||
Hashable ListOptions Source # | |||||
Defined in NvFetcher.Types | |||||
Pretty ListOptions Source # | |||||
Defined in NvFetcher.Types | |||||
type Rep ListOptions Source # | |||||
Defined in NvFetcher.Types type Rep ListOptions = D1 ('MetaData "ListOptions" "NvFetcher.Types" "nvfetcher-0.7.0.0-HR4PcHwfHzb7yxLfyxb35a" 'False) (C1 ('MetaCons "ListOptions" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_includeRegex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "_excludeRegex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "_sortVersionKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe VersionSortMethod)) :*: S1 ('MetaSel ('Just "_ignored") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))))) |
data CheckVersion Source #
The input of nvchecker
Constructors
CheckVersion VersionSource NvcheckerOptions |
Instances
Generic CheckVersion Source # | |||||
Defined in NvFetcher.Types Associated Types
| |||||
Show CheckVersion Source # | |||||
Defined in NvFetcher.Types Methods showsPrec :: Int -> CheckVersion -> ShowS # show :: CheckVersion -> String # showList :: [CheckVersion] -> ShowS # | |||||
Binary CheckVersion Source # | |||||
Defined in NvFetcher.Types | |||||
NFData CheckVersion Source # | |||||
Defined in NvFetcher.Types Methods rnf :: CheckVersion -> () # | |||||
Eq CheckVersion Source # | |||||
Defined in NvFetcher.Types | |||||
Ord CheckVersion Source # | |||||
Defined in NvFetcher.Types Methods compare :: CheckVersion -> CheckVersion -> Ordering # (<) :: CheckVersion -> CheckVersion -> Bool # (<=) :: CheckVersion -> CheckVersion -> Bool # (>) :: CheckVersion -> CheckVersion -> Bool # (>=) :: CheckVersion -> CheckVersion -> Bool # max :: CheckVersion -> CheckVersion -> CheckVersion # min :: CheckVersion -> CheckVersion -> CheckVersion # | |||||
Hashable CheckVersion Source # | |||||
Defined in NvFetcher.Types | |||||
Pretty CheckVersion Source # | |||||
Defined in NvFetcher.Types | |||||
type Rep CheckVersion Source # | |||||
Defined in NvFetcher.Types type Rep CheckVersion = D1 ('MetaData "CheckVersion" "NvFetcher.Types" "nvfetcher-0.7.0.0-HR4PcHwfHzb7yxLfyxb35a" 'False) (C1 ('MetaCons "CheckVersion" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VersionSource) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NvcheckerOptions))) | |||||
type RuleResult CheckVersion Source # | |||||
Defined in NvFetcher.Types |
data NvcheckerOptions Source #
Configuration available for evey version sourece. See https://nvchecker.readthedocs.io/en/latest/usage.html#global-options for details.
Constructors
NvcheckerOptions | |
Fields
|
Instances
Generic NvcheckerOptions Source # | |||||
Defined in NvFetcher.Types Associated Types
Methods from :: NvcheckerOptions -> Rep NvcheckerOptions x # to :: Rep NvcheckerOptions x -> NvcheckerOptions # | |||||
Show NvcheckerOptions Source # | |||||
Defined in NvFetcher.Types Methods showsPrec :: Int -> NvcheckerOptions -> ShowS # show :: NvcheckerOptions -> String # showList :: [NvcheckerOptions] -> ShowS # | |||||
Binary NvcheckerOptions Source # | |||||
Defined in NvFetcher.Types Methods put :: NvcheckerOptions -> Put # get :: Get NvcheckerOptions # putList :: [NvcheckerOptions] -> Put # | |||||
Default NvcheckerOptions Source # | |||||
Defined in NvFetcher.Types Methods def :: NvcheckerOptions # | |||||
NFData NvcheckerOptions Source # | |||||
Defined in NvFetcher.Types Methods rnf :: NvcheckerOptions -> () # | |||||
Eq NvcheckerOptions Source # | |||||
Defined in NvFetcher.Types Methods (==) :: NvcheckerOptions -> NvcheckerOptions -> Bool # (/=) :: NvcheckerOptions -> NvcheckerOptions -> Bool # | |||||
Ord NvcheckerOptions Source # | |||||
Defined in NvFetcher.Types Methods compare :: NvcheckerOptions -> NvcheckerOptions -> Ordering # (<) :: NvcheckerOptions -> NvcheckerOptions -> Bool # (<=) :: NvcheckerOptions -> NvcheckerOptions -> Bool # (>) :: NvcheckerOptions -> NvcheckerOptions -> Bool # (>=) :: NvcheckerOptions -> NvcheckerOptions -> Bool # max :: NvcheckerOptions -> NvcheckerOptions -> NvcheckerOptions # min :: NvcheckerOptions -> NvcheckerOptions -> NvcheckerOptions # | |||||
Hashable NvcheckerOptions Source # | |||||
Defined in NvFetcher.Types | |||||
Pretty NvcheckerOptions Source # | |||||
Defined in NvFetcher.Types | |||||
type Rep NvcheckerOptions Source # | |||||
Defined in NvFetcher.Types type Rep NvcheckerOptions = D1 ('MetaData "NvcheckerOptions" "NvFetcher.Types" "nvfetcher-0.7.0.0-HR4PcHwfHzb7yxLfyxb35a" 'False) (C1 ('MetaCons "NvcheckerOptions" 'PrefixI 'True) (S1 ('MetaSel ('Just "_stripPrefix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "_fromPattern") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "_toPattern") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))))) |
data VersionSource Source #
Upstream version source for nvchecker to check
Constructors
GitHubRelease | |
GitHubTag | |
Fields
| |
Git | |
Pypi | |
ArchLinux | |
Aur | |
Manual | |
Repology | |
Webpage | |
Fields
| |
HttpHeader | |
Fields
| |
OpenVsx | |
Fields
| |
VscodeMarketplace | |
Fields
| |
Cmd | |
Container | |
Fields |
Instances
Generic VersionSource Source # | |||||
Defined in NvFetcher.Types Associated Types
| |||||
Show VersionSource Source # | |||||
Defined in NvFetcher.Types Methods showsPrec :: Int -> VersionSource -> ShowS # show :: VersionSource -> String # showList :: [VersionSource] -> ShowS # | |||||
Binary VersionSource Source # | |||||
Defined in NvFetcher.Types | |||||
NFData VersionSource Source # | |||||
Defined in NvFetcher.Types Methods rnf :: VersionSource -> () # | |||||
Eq VersionSource Source # | |||||
Defined in NvFetcher.Types Methods (==) :: VersionSource -> VersionSource -> Bool # (/=) :: VersionSource -> VersionSource -> Bool # | |||||
Ord VersionSource Source # | |||||
Defined in NvFetcher.Types Methods compare :: VersionSource -> VersionSource -> Ordering # (<) :: VersionSource -> VersionSource -> Bool # (<=) :: VersionSource -> VersionSource -> Bool # (>) :: VersionSource -> VersionSource -> Bool # (>=) :: VersionSource -> VersionSource -> Bool # max :: VersionSource -> VersionSource -> VersionSource # min :: VersionSource -> VersionSource -> VersionSource # | |||||
Hashable VersionSource Source # | |||||
Defined in NvFetcher.Types | |||||
Pretty VersionSource Source # | |||||
Defined in NvFetcher.Types | |||||
type Rep VersionSource Source # | |||||
Defined in NvFetcher.Types type Rep VersionSource = D1 ('MetaData "VersionSource" "NvFetcher.Types" "nvfetcher-0.7.0.0-HR4PcHwfHzb7yxLfyxb35a" 'False) (((C1 ('MetaCons "GitHubRelease" 'PrefixI 'True) (S1 ('MetaSel ('Just "_owner") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "_repo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: (C1 ('MetaCons "GitHubTag" 'PrefixI 'True) (S1 ('MetaSel ('Just "_owner") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "_repo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "_listOptions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ListOptions))) :+: C1 ('MetaCons "Git" 'PrefixI 'True) (S1 ('MetaSel ('Just "_vurl") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "_vbranch") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Branch)))) :+: ((C1 ('MetaCons "Pypi" 'PrefixI 'True) (S1 ('MetaSel ('Just "_pypi") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "ArchLinux" 'PrefixI 'True) (S1 ('MetaSel ('Just "_archpkg") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) :+: (C1 ('MetaCons "Aur" 'PrefixI 'True) (S1 ('MetaSel ('Just "_aur") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "Manual" 'PrefixI 'True) (S1 ('MetaSel ('Just "_manual") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))))) :+: ((C1 ('MetaCons "Repology" 'PrefixI 'True) (S1 ('MetaSel ('Just "_repology") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "_repo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: (C1 ('MetaCons "Webpage" 'PrefixI 'True) (S1 ('MetaSel ('Just "_vurl") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "_regex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "_listOptions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ListOptions))) :+: C1 ('MetaCons "HttpHeader" 'PrefixI 'True) (S1 ('MetaSel ('Just "_vurl") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "_regex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "_listOptions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ListOptions))))) :+: ((C1 ('MetaCons "OpenVsx" 'PrefixI 'True) (S1 ('MetaSel ('Just "_ovPublisher") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "_ovExtName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "VscodeMarketplace" 'PrefixI 'True) (S1 ('MetaSel ('Just "_vsmPublisher") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "_vsmExtName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) :+: (C1 ('MetaCons "Cmd" 'PrefixI 'True) (S1 ('MetaSel ('Just "_vcmd") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "Container" 'PrefixI 'True) (S1 ('MetaSel ('Just "_vcontainer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "_listOptions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ListOptions)))))) |
data NvcheckerResult Source #
The result of nvchecker rule
Constructors
NvcheckerResult | |
Instances
Generic NvcheckerResult Source # | |||||
Defined in NvFetcher.Types Associated Types
Methods from :: NvcheckerResult -> Rep NvcheckerResult x # to :: Rep NvcheckerResult x -> NvcheckerResult # | |||||
Show NvcheckerResult Source # | |||||
Defined in NvFetcher.Types Methods showsPrec :: Int -> NvcheckerResult -> ShowS # show :: NvcheckerResult -> String # showList :: [NvcheckerResult] -> ShowS # | |||||
Binary NvcheckerResult Source # | |||||
Defined in NvFetcher.Types Methods put :: NvcheckerResult -> Put # get :: Get NvcheckerResult # putList :: [NvcheckerResult] -> Put # | |||||
NFData NvcheckerResult Source # | |||||
Defined in NvFetcher.Types Methods rnf :: NvcheckerResult -> () # | |||||
Eq NvcheckerResult Source # | |||||
Defined in NvFetcher.Types Methods (==) :: NvcheckerResult -> NvcheckerResult -> Bool # (/=) :: NvcheckerResult -> NvcheckerResult -> Bool # | |||||
Hashable NvcheckerResult Source # | |||||
Defined in NvFetcher.Types | |||||
type Rep NvcheckerResult Source # | |||||
Defined in NvFetcher.Types type Rep NvcheckerResult = D1 ('MetaData "NvcheckerResult" "NvFetcher.Types" "nvfetcher-0.7.0.0-HR4PcHwfHzb7yxLfyxb35a" 'False) (C1 ('MetaCons "NvcheckerResult" 'PrefixI 'True) (S1 ('MetaSel ('Just "nvNow") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version) :*: (S1 ('MetaSel ('Just "nvOld") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Version)) :*: S1 ('MetaSel ('Just "nvStale") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))) |
Rules
nvcheckerRule :: Rules () Source #
Rules of nvchecker
Functions
checkVersion :: VersionSource -> NvcheckerOptions -> PackageKey -> Action NvcheckerResult Source #
Run nvchecker given PackageKey
Recording version changes and using stale version are available.
checkVersion' :: VersionSource -> NvcheckerOptions -> Action NvcheckerResult Source #
Run nvchecker without cache