Add nginx
All checks were successful
Build / audit (push) Successful in 7s
Build / test (push) Successful in 14m54s

This commit is contained in:
Eugen Wissner 2024-09-09 16:47:44 +02:00
parent 1418e0ae46
commit 6ead225e88
Signed by: belka
GPG Key ID: A27FDC1E8EE902C0
2 changed files with 27 additions and 4 deletions

View File

@ -54,9 +54,9 @@ data PackageOwner = PackageOwner
} deriving (Eq, Show)
data MatchState = MatchState
{ ignoring :: Bool
, matched :: Text
, pattern' :: [MatchToken]
{ ignoring :: !Bool
, matched :: !Text
, pattern' :: ![MatchToken]
} deriving (Eq, Show)
data MatchToken
@ -68,7 +68,7 @@ data MatchToken
deriving (Eq, Show)
-- | Matches a string (for example a version name or CVS tag) against a pattern.
-- Returns the matched part of the string or 'Nothing' if there is no match.
-- Returns the matched part of the string or 'Nothing' if there is not match.
--
-- The pattern is just a list of characters with some special characters and
-- sequences.
@ -79,6 +79,8 @@ data MatchToken
-- * \\. - Matches zero or more digits or dots.
-- * \\\\ - Matches a back slash.
-- * * - Matches everything.
-- * [ ] - Match one of the characters inbetween. The characters are
-- matched verbatim.
--
-- For example the following expression matches tags like @v1.2.3@, but returns
-- only @1.2.3@.
@ -112,6 +114,11 @@ match fullPattern input =
Just ('\\', remaining') -> SymbolMatchToken '\\'
: parsePattern remaining'
Just (_, remaining') -> parsePattern remaining'
| Just (firstChar, remaining) <- Text.uncons input'
, firstChar == '['
, Just lastBracket <- Text.findIndex (== ']') remaining
= OneOfMatchToken (Text.unpack $ Text.take lastBracket remaining)
: parsePattern (Text.drop (succ lastBracket) remaining)
| Just (firstChar, remaining) <- Text.uncons input' =
let token =
case firstChar of

View File

@ -237,6 +237,22 @@ autoUpdatable =
, name = "simde"
, downloaders = mempty
}
, PackageDescription
{ latest =
let ghArguments = PackageOwner
{ owner = "nginx"
, name = "nginx"
}
template = Package.DownloadTemplate
"http://nginx.org/download/nginx-{version}.tar.gz"
in Package.Updater
{ detectLatest = latestGitHub ghArguments "(release-)\\d.[02468].\\d"
, getVersion = downloadWithTemplate template
, is64 = False
}
, name = "nginx"
, downloaders = mempty
}
]
up2Date :: Maybe Text -> SlackBuilderT ()