style: update

This commit is contained in:
wcbing 2025-11-05 11:08:32 +08:00
parent ced4424f7f
commit a775745284
3 changed files with 7 additions and 7 deletions

View File

@ -48,8 +48,7 @@
### Github Releses ### Github Releses
> 因服务器资源有限,本仓库可能无法收录部分大文件。 > 也可投稿至星火商店的 [Github Releases 更新配置仓库](https://gitee.com/spark-building-service/github),其和本部分内容是同源的。
> 有收录需求也可投稿至星火商店的 [Github Releases 更新配置仓库](https://gitee.com/spark-building-service/github),其和本部分内容是同源的。
| 软件名 | 包名 | amd64 | arm64 | | 软件名 | 包名 | amd64 | arm64 |
| ----- | ---- | ----- | ----- | | ----- | ---- | ----- | ----- |

View File

@ -10,7 +10,7 @@ from threading import Lock
DEB_BASE_DIR = "deb" DEB_BASE_DIR = "deb"
PACKAGES_DIR = "packages" PACKAGES_DIR = "packages"
DB_DIR = "data" DB_DIR = "data"
USER_AGENT = "Debian APT-HTTP/1.3 (2.6.1)" # from Debian 12 USER_AGENT = "Debian APT-HTTP/1.3 (3.0.3)" # from Debian 13
version_lock = Lock() version_lock = Lock()
@ -58,7 +58,7 @@ def check_download(name: str, version: str, url: str, arch: str) -> None:
file_path = os.path.join(DEB_BASE_DIR, arch, f"{name}_{version}_{arch}.deb") file_path = os.path.join(DEB_BASE_DIR, arch, f"{name}_{version}_{arch}.deb")
local_version = None local_version = None
db_path = os.path.join("data", f"{DEB_BASE_DIR}.db") db_path = os.path.join(DB_DIR, f"{DEB_BASE_DIR}.db")
# get local version # get local version
with version_lock, sqlite3.connect(db_path) as conn: with version_lock, sqlite3.connect(db_path) as conn:
res = conn.execute( res = conn.execute(
@ -74,6 +74,7 @@ def check_download(name: str, version: str, url: str, arch: str) -> None:
os.makedirs(os.path.join(DEB_BASE_DIR, arch), exist_ok=True) os.makedirs(os.path.join(DEB_BASE_DIR, arch), exist_ok=True)
if not download(url, file_path): if not download(url, file_path):
return return
logging.info(f"Downloaded {name}:{arch} ({version})")
os.makedirs(os.path.join(PACKAGES_DIR, arch), exist_ok=True) os.makedirs(os.path.join(PACKAGES_DIR, arch), exist_ok=True)
if not scan(name, arch, url, file_path): if not scan(name, arch, url, file_path):
return return

View File

@ -7,7 +7,7 @@ import re
from concurrent.futures import ThreadPoolExecutor, wait from concurrent.futures import ThreadPoolExecutor, wait
from check_downloader import check_download from check_downloader import check_download
github_info_list = {} git_repo_list = {}
CONFIG = {"data_dir": "data", "proxy": "", "thread": 5} CONFIG = {"data_dir": "data", "proxy": "", "thread": 5}
@ -31,11 +31,11 @@ if __name__ == "__main__":
# read all repo info 读取所有仓库配置 # read all repo info 读取所有仓库配置
with open(os.path.join(CONFIG["data_dir"], "github.json"), "r") as f: with open(os.path.join(CONFIG["data_dir"], "github.json"), "r") as f:
github_info_list = json.load(f) git_repo_list = json.load(f)
tasks = [] tasks = []
with ThreadPoolExecutor(max_workers=CONFIG["thread"]) as executor: with ThreadPoolExecutor(max_workers=CONFIG["thread"]) as executor:
for name, repo in github_info_list.items(): for name, repo in git_repo_list.items():
if "site" in repo: if "site" in repo:
repo_url = os.path.join(repo["site"], repo['repo']) repo_url = os.path.join(repo["site"], repo['repo'])
else: else: