Add nginx
This commit is contained in:
parent
1418e0ae46
commit
6ead225e88
@ -54,9 +54,9 @@ data PackageOwner = PackageOwner
|
|||||||
} deriving (Eq, Show)
|
} deriving (Eq, Show)
|
||||||
|
|
||||||
data MatchState = MatchState
|
data MatchState = MatchState
|
||||||
{ ignoring :: Bool
|
{ ignoring :: !Bool
|
||||||
, matched :: Text
|
, matched :: !Text
|
||||||
, pattern' :: [MatchToken]
|
, pattern' :: ![MatchToken]
|
||||||
} deriving (Eq, Show)
|
} deriving (Eq, Show)
|
||||||
|
|
||||||
data MatchToken
|
data MatchToken
|
||||||
@ -68,7 +68,7 @@ data MatchToken
|
|||||||
deriving (Eq, Show)
|
deriving (Eq, Show)
|
||||||
|
|
||||||
-- | Matches a string (for example a version name or CVS tag) against a pattern.
|
-- | 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
|
-- The pattern is just a list of characters with some special characters and
|
||||||
-- sequences.
|
-- sequences.
|
||||||
@ -79,6 +79,8 @@ data MatchToken
|
|||||||
-- * \\. - Matches zero or more digits or dots.
|
-- * \\. - Matches zero or more digits or dots.
|
||||||
-- * \\\\ - Matches a back slash.
|
-- * \\\\ - Matches a back slash.
|
||||||
-- * * - Matches everything.
|
-- * * - 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
|
-- For example the following expression matches tags like @v1.2.3@, but returns
|
||||||
-- only @1.2.3@.
|
-- only @1.2.3@.
|
||||||
@ -112,6 +114,11 @@ match fullPattern input =
|
|||||||
Just ('\\', remaining') -> SymbolMatchToken '\\'
|
Just ('\\', remaining') -> SymbolMatchToken '\\'
|
||||||
: parsePattern remaining'
|
: parsePattern remaining'
|
||||||
Just (_, remaining') -> 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' =
|
| Just (firstChar, remaining) <- Text.uncons input' =
|
||||||
let token =
|
let token =
|
||||||
case firstChar of
|
case firstChar of
|
||||||
|
16
src/Main.hs
16
src/Main.hs
@ -237,6 +237,22 @@ autoUpdatable =
|
|||||||
, name = "simde"
|
, name = "simde"
|
||||||
, downloaders = mempty
|
, 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 ()
|
up2Date :: Maybe Text -> SlackBuilderT ()
|
||||||
|
Loading…
Reference in New Issue
Block a user