Compare commits

..

3 Commits

Author SHA1 Message Date
d2f19aaede add neovide, himalaya repo; remove black-desk repo 2025-05-09 12:12:21 +08:00
7b98001cde add arm64 version of flclash 2025-05-01 10:18:34 +08:00
99a1d83459 refactor: repo structure 2025-04-14 16:23:18 +08:00
3 changed files with 15 additions and 33 deletions

View File

@ -1,17 +0,0 @@
FROM debian:12-slim
RUN apt-get update && \
apt-get install -y --no-install-recommends \
apt-utils \
python3-apt \
python3-requests \
curl \
jq \
gpg \
gpg-agent && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /mnt
CMD ["/bin/bash"]

View File

@ -12,9 +12,6 @@ import requests
import sys
from concurrent.futures import ThreadPoolExecutor
from threading import Lock
import apt_pkg
apt_pkg.init() # 初始化 apt_pkg
package_version = {arch: {} for arch in ["all", "amd64", "i386", "arm64"]}
package_info = {arch: {} for arch in ["all", "amd64", "i386", "arm64"]}
@ -95,8 +92,13 @@ def get_latest(deb_packages: bytes):
arch = find_arch.search(v).group(1).decode()
tmp_version = find_version.search(v).group(1).decode()
with lock[arch]:
# 使用 apt_pkg 进行版本比较
if name not in package_version[arch] or apt_pkg.version_compare(tmp_version, package_version[arch][name]) > 0:
if (
name not in package_version[arch]
or os.system(
f"dpkg --compare-versions {tmp_version} gt {package_version[arch][name]}"
)
== 0
):
package_version[arch][name] = tmp_version
package_info[arch][name] = v
except Exception as e:
@ -109,7 +111,7 @@ def process_repo(r: dict):
获取仓库中不同架构子仓库的内容最后调用 get_latest 去重并保存
"""
try:
for path in r["path"].values():
for arch, path in r["path"].items():
get_latest(get_remote_packages(r["repo"], path))
except Exception as e:
logging.error(f"Error processing repo {r.get('name', 'unknown')}: {e}")

17
run.sh
View File

@ -7,28 +7,25 @@ find get -type f -name "*.sh" -exec sh {} \;
# generate the html
./gen-list-html.py
# generate the Packages file
## generate the local Packages file
cd deb
# generate the local Packages
apt-ftparchive packages . > tmpPackages
sed -i "s|\./\(https\?\):/|\1://|g" tmpPackages
cd ..
## merge the Packages file from local package
cat $(find packages -name "*.package") >> deb/tmpPackages
## merge the Packages files from third-party repositories
# merge the Packages files from third-party repositories
./merge-apt-repo.py --local deb/tmpPackages
# generate the Release file
cd deb/dists/wcbing && \
cd deb/dists/wcbing
echo 'Origin: wcbing APT Repo
Label: wcbing
Suite: wcbing
Codename: wcbing
Architectures: amd64 arm64
Components: main
Description: wcbing APT Repo || wcbing 的 APT 仓库' > Release && \
apt-ftparchive release . >> Release && \
gpg --yes --detach-sign -a -o Release.gpg Release && \
Description: wcbing APT Repo || wcbing 的 APT 仓库' > Release
apt-ftparchive release . >> Release
gpg --yes --detach-sign -a -o Release.gpg Release
gpg --yes --clearsign -o InRelease Release