support auto updating more packages

This commit is contained in:
seth
2022-12-05 02:25:07 -05:00
committed by windowsboy111
parent adbd9be73c
commit 8cd366eab5
13 changed files with 322 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
import os
import requests
import re
NAME = "adwaita++-icons"
REPO = "Bonandry/adwaita-plus"
REGEX_VER = r"Version:\s*([\.\d]+)\n"
SPEC = f"{NAME}.spec"
LINK = f"https://api.github.com/repos/{REPO}/releases/latest"
token = os.getenv("GITHUB_TOKEN")
ver = requests.get(LINK, headers={"Authorization": f"Bearer {token}"}).json()[
"tag_name"
][1:]
with open(SPEC, "r") as f:
matches = re.findall(REGEX_VER, f.read())
if not len(matches):
exit(f"{NAME}: Failed to match regex!")
cur = matches[0]
if ver == cur:
exit(f"{NAME}: Up to date!")
print(f"{NAME}: {cur} -> {ver}")
os.system(f"rpmdev-bumpspec -n {ver} {SPEC}")
+23
View File
@@ -0,0 +1,23 @@
import requests
import re
import os
NAME = "openasar-canary"
REPO = "GooseMod/OpenAsar"
REGEX_SHA = r"%define commit (.+)"
SPEC = f"{NAME}.spec"
LINK = f"https://api.github.com/repos/{REPO}/commits/HEAD"
token = os.getenv("GITHUB_TOKEN")
sha = requests.get(LINK, headers={"Authorization": f"Bearer {token}"}).json()["sha"]
f = open(SPEC, "r")
matches = re.findall(REGEX_SHA, txt := f.read())
if not len(matches):
exit(f"{NAME}: Failed to match regex!")
cur = matches[0]
if sha == cur:
exit(f"{NAME}: Up to date!")
print(f"{NAME}: {cur} -> {sha}")
@@ -1,3 +1,5 @@
%define commit ad9b161744b27acc5e333ee70df11afca09301ef
Name: openasar-canary
Version: nightly.%{autogitdate}
Release: 1%{?dist}
@@ -0,0 +1,27 @@
import os
import requests
import re
NAME = "budgie-extras"
REPO = "UbuntuBudgie/budgie-extras"
REGEX_VER = r"Version:\s*([\.\d]+)\n"
SPEC = f"{NAME}.spec"
LINK = f"https://api.github.com/repos/{REPO}/releases/latest"
token = os.getenv("GITHUB_TOKEN")
ver = requests.get(LINK, headers={"Authorization": f"Bearer {token}"}).json()[
"tag_name"
][1:]
with open(SPEC, "r") as f:
matches = re.findall(REGEX_VER, f.read())
if not len(matches):
exit(f"{NAME}: Failed to match regex!")
cur = matches[0]
if ver == cur:
exit(f"{NAME}: Up to date!")
print(f"{NAME}: {cur} -> {ver}")
os.system(f"rpmdev-bumpspec -n {ver} {SPEC}")
+27
View File
@@ -0,0 +1,27 @@
import os
import requests
import re
NAME = "moby-buildx"
REPO = "docker/buildx"
REGEX_VER = r"Version:\s*([\.\d]+)\n"
SPEC = f"{NAME}.spec"
LINK = f"https://api.github.com/repos/{REPO}/releases/latest"
token = os.getenv("GITHUB_TOKEN")
ver = requests.get(LINK, headers={"Authorization": f"Bearer {token}"}).json()[
"tag_name"
][1:]
with open(SPEC, "r") as f:
matches = re.findall(REGEX_VER, f.read())
if not len(matches):
exit(f"{NAME}: Failed to match regex!")
cur = matches[0]
if ver == cur:
exit(f"{NAME}: Up to date!")
print(f"{NAME}: {cur} -> {ver}")
os.system(f"rpmdev-bumpspec -n {ver} {SPEC}")
@@ -0,0 +1,27 @@
import os
import requests
import re
NAME = "moby-compose"
REPO = "docker/compose"
REGEX_VER = r"Version:\s*([\.\d]+)\n"
SPEC = f"{NAME}.spec"
LINK = f"https://api.github.com/repos/{REPO}/releases/latest"
token = os.getenv("GITHUB_TOKEN")
ver = requests.get(LINK, headers={"Authorization": f"Bearer {token}"}).json()[
"tag_name"
][1:]
with open(SPEC, "r") as f:
matches = re.findall(REGEX_VER, f.read())
if not len(matches):
exit(f"{NAME}: Failed to match regex!")
cur = matches[0]
if ver == cur:
exit(f"{NAME}: Up to date!")
print(f"{NAME}: {cur} -> {ver}")
os.system(f"rpmdev-bumpspec -n {ver} {SPEC}")
+27
View File
@@ -0,0 +1,27 @@
import os
import requests
import re
NAME = "bat-extras"
REPO = "eth-p/bat-extras"
REGEX_VER = r"Version:\s*([\.\d]+)\n"
SPEC = f"{NAME}.spec"
LINK = f"https://api.github.com/repos/{REPO}/releases/latest"
token = os.getenv("GITHUB_TOKEN")
ver = requests.get(LINK, headers={"Authorization": f"Bearer {token}"}).json()[
"tag_name"
][1:]
with open(SPEC, "r") as f:
matches = re.findall(REGEX_VER, f.read())
if not len(matches):
exit(f"{NAME}: Failed to match regex!")
cur = matches[0]
if ver == cur:
exit(f"{NAME}: Up to date!")
print(f"{NAME}: {cur} -> {ver}")
os.system(f"rpmdev-bumpspec -n {ver} {SPEC}")
+27
View File
@@ -0,0 +1,27 @@
import os
import requests
import re
NAME = "pop-launcher"
REPO = "pop-os/launcher"
REGEX_VER = r"Version:\s*([\.\d]+)\n"
SPEC = f"{NAME}.spec"
LINK = f"https://api.github.com/repos/{REPO}/releases/latest"
token = os.getenv("GITHUB_TOKEN")
ver = requests.get(LINK, headers={"Authorization": f"Bearer {token}"}).json()[
"tag_name"
]
with open(SPEC, "r") as f:
matches = re.findall(REGEX_VER, f.read())
if not len(matches):
exit(f"{NAME}: Failed to match regex!")
cur = matches[0]
if ver == cur:
exit(f"{NAME}: Up to date!")
print(f"{NAME}: {cur} -> {ver}")
os.system(f"rpmdev-bumpspec -n {ver} {SPEC}")
+27
View File
@@ -0,0 +1,27 @@
import os
import requests
import re
NAME = "rust-sccache"
REPO = "mozilla/sccache"
REGEX_VER = r"Version:\s*([\.\d]+)\n"
SPEC = f"{NAME}.spec"
LINK = f"https://api.github.com/repos/{REPO}/releases/latest"
token = os.getenv("GITHUB_TOKEN")
ver = requests.get(LINK, headers={"Authorization": f"Bearer {token}"}).json()[
"tag_name"
][1:]
with open(SPEC, "r") as f:
matches = re.findall(REGEX_VER, f.read())
if not len(matches):
exit(f"{NAME}: Failed to match regex!")
cur = matches[0]
if ver == cur:
exit(f"{NAME}: Up to date!")
print(f"{NAME}: {cur} -> {ver}")
os.system(f"rpmdev-bumpspec -n {ver} {SPEC}")
+27
View File
@@ -0,0 +1,27 @@
import os
import requests
import re
NAME = "youki"
REPO = "containers/youki"
REGEX_VER = r"Version:\s*([\.\d]+)\n"
SPEC = f"{NAME}.spec"
LINK = f"https://api.github.com/repos/{REPO}/releases/latest"
token = os.getenv("GITHUB_TOKEN")
ver = requests.get(LINK, headers={"Authorization": f"Bearer {token}"}).json()[
"tag_name"
][1:]
with open(SPEC, "r") as f:
matches = re.findall(REGEX_VER, f.read())
if not len(matches):
exit(f"{NAME}: Failed to match regex!")
cur = matches[0]
if ver == cur:
exit(f"{NAME}: Up to date!")
print(f"{NAME}: {cur} -> {ver}")
os.system(f"rpmdev-bumpspec -n {ver} {SPEC}")
+27
View File
@@ -0,0 +1,27 @@
import os
import requests
import re
NAME = "rust-zellij"
REPO = "zellij-org/zellij"
REGEX_VER = r"Version:\s*([\.\d]+)\n"
SPEC = f"{NAME}.spec"
LINK = f"https://api.github.com/repos/{REPO}/releases/latest"
token = os.getenv("GITHUB_TOKEN")
ver = requests.get(LINK, headers={"Authorization": f"Bearer {token}"}).json()[
"tag_name"
][1:]
with open(SPEC, "r") as f:
matches = re.findall(REGEX_VER, f.read())
if not len(matches):
exit(f"{NAME}: Failed to match regex!")
cur = matches[0]
if ver == cur:
exit(f"{NAME}: Up to date!")
print(f"{NAME}: {cur} -> {ver}")
os.system(f"rpmdev-bumpspec -n {ver} {SPEC}")
+27
View File
@@ -0,0 +1,27 @@
import os
import requests
import re
NAME = "appimagelauncher"
REPO = "TheAssassin/AppImageLauncher"
REGEX_VER = r"Version:\s*([\.\d]+)\n"
SPEC = f"{NAME}.spec"
LINK = f"https://api.github.com/repos/{REPO}/releases/latest"
token = os.getenv("GITHUB_TOKEN")
ver = requests.get(LINK, headers={"Authorization": f"Bearer {token}"}).json()[
"tag_name"
][1:]
with open(SPEC, "r") as f:
matches = re.findall(REGEX_VER, f.read())
if not len(matches):
exit(f"{NAME}: Failed to match regex!")
cur = matches[0]
if ver == cur:
exit(f"{NAME}: Up to date!")
print(f"{NAME}: {cur} -> {ver}")
os.system(f"rpmdev-bumpspec -n {ver} {SPEC}")
+27
View File
@@ -0,0 +1,27 @@
import os
import requests
import re
NAME = "gcm-core"
REPO = "GitCredentialManager/git-credential-manager"
REGEX_VER = r"Version:\s*([\.\d]+)\n"
SPEC = f"{NAME}.spec"
LINK = f"https://api.github.com/repos/{REPO}/releases/latest"
token = os.getenv("GITHUB_TOKEN")
ver = requests.get(LINK, headers={"Authorization": f"Bearer {token}"}).json()[
"tag_name"
][1:]
with open(SPEC, "r") as f:
matches = re.findall(REGEX_VER, f.read())
if not len(matches):
exit(f"{NAME}: Failed to match regex!")
cur = matches[0]
if ver == cur:
exit(f"{NAME}: Up to date!")
print(f"{NAME}: {cur} -> {ver}")
os.system(f"rpmdev-bumpspec -n {ver} {SPEC}")