wcbing-apt-repo/init-deb.py
wcbing 2643348df9 refactor: github releases, arch name, multithreading
rewrite github downloader and configuration to store version tag in sqlite.
change 'version_tag' to 'releases_tag', 'stripped_version' to 'version'.
add 'all' arch, change 'x86_64' to 'amd64'.
add multithreading for downloader.
rename init_deb.py to init-deb.py
2025-04-04 15:48:37 +08:00

20 lines
363 B
Python
Executable File

#!/usr/bin/env python3
import sqlite3
# create table
conn = sqlite3.connect("data/deb.db")
for arch in ["amd64", "arm64", "all"]:
conn.execute(
f"""
CREATE TABLE IF NOT EXISTS '{arch}' (
name TEXT UNIQUE,
version TEXT,
url TEXT
);
"""
)
conn.commit()
conn.close()