feat: alpine packages feed reader (beta)
This commit is contained in:
parent
800c4c2ee3
commit
1f182df473
2 changed files with 36 additions and 6 deletions
31
config.py
31
config.py
|
|
@ -14,6 +14,26 @@ from issue_generator import FeedReader, GithubReader, GithubTagReader, PIPYReade
|
|||
TIMEOUT
|
||||
import _secrets
|
||||
|
||||
class AlpinePackageReader(FeedReader):
|
||||
'''Custom feed reader for Alpine packages'''
|
||||
def __init__(self, package: str, targets: IssuePoster):
|
||||
super().__init__(package, "https://gitlab.alpinelinux.org/alpine/aports/-/commits/master.atom", targets)
|
||||
self.regex = r'community/([^:]+): upgrade to (.+)'
|
||||
self.package = package
|
||||
|
||||
def is_valid_item(self, entry) -> bool:
|
||||
match = re.search(self.regex, entry.title)
|
||||
return match and match.groups(1) == self.package
|
||||
|
||||
def entry_get_version(self, entry: dict[str, Any]) -> tuple[str, str]:
|
||||
match = re.search(self.regex, entry.title)
|
||||
if match and match.groups(1) == self.package:
|
||||
return (match.groups(2),) * 2
|
||||
raise RuntimeError(f"Checking version for package {self.package} in invalid entry titled: {entry.title}")
|
||||
|
||||
def entry_get_link(self, entry: dict[str, Any]) -> str:
|
||||
return entry.id
|
||||
|
||||
|
||||
class UDSClientReader(FeedReader):
|
||||
'''Custom feed reader for UDSClient, whose version number appears in a .js file.'''
|
||||
|
|
@ -111,6 +131,17 @@ FEED_READERS = [
|
|||
NCAppReader(app = "vigil-local", project = "valeriansaliou/vigil-local"),
|
||||
# yourls GHReleases YOURLS/YOURLS archpkgs/yourls
|
||||
NCAppReader(app = "yourls", project = "YOURLS/YOURLS"),
|
||||
|
||||
################################ Critical software in servers ################################
|
||||
# zfs
|
||||
GithubReader(name = "zfs-dkms", project = "openzfs/zfs",
|
||||
targets = CGJForgejoPoster("kauron/solaris-packages")),
|
||||
# yay GHReleases Jguer/yay aur?
|
||||
GithubReader(name = "yay", project = "Jguer/yay",
|
||||
targets = CGJForgejoPoster("kauron/solaris-packages")),
|
||||
# qbittorrent-alpine
|
||||
AlpinePackageReader(package = "qbittorrent",
|
||||
targets = CGJForgejoPoster("kauron/solaris-packages")),
|
||||
]
|
||||
|
||||
## PENDING:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue