mirror of
https://github.com/wcbing/wcbing-apt-repo.git
synced 2025-12-29 02:28:30 +08:00
Compare commits
2 Commits
3d6a1905cc
...
7b98001cde
| Author | SHA1 | Date | |
|---|---|---|---|
| 7b98001cde | |||
| 99a1d83459 |
@ -51,7 +51,7 @@
|
|||||||
| 软件名 | 包名 | amd64 | arm64 |
|
| 软件名 | 包名 | amd64 | arm64 |
|
||||||
| ----- | ---- | ----- | ----- |
|
| ----- | ---- | ----- | ----- |
|
||||||
| [Clash Verge Rev](https://github.com/clash-verge-rev/clash-verge-rev) | clash-verge | ✅ | ✅ |
|
| [Clash Verge Rev](https://github.com/clash-verge-rev/clash-verge-rev) | clash-verge | ✅ | ✅ |
|
||||||
| [FlClash](https://github.com/chen08209/FlClash) | flclash | ✅ | |
|
| [FlClash](https://github.com/chen08209/FlClash) | flclash | ✅ | ✅ |
|
||||||
| [mihomo](https://github.com/MetaCubeX/mihomo) | mihomo | ✅ | ✅ |
|
| [mihomo](https://github.com/MetaCubeX/mihomo) | mihomo | ✅ | ✅ |
|
||||||
| [hugo](https://github.com/gohugoio/hugo) | hugo | ✅ | ✅ |
|
| [hugo](https://github.com/gohugoio/hugo) | hugo | ✅ | ✅ |
|
||||||
| [RustDesk](https://github.com/rustdesk/rustdesk) | rustdesk | ✅ | ✅ |
|
| [RustDesk](https://github.com/rustdesk/rustdesk) | rustdesk | ✅ | ✅ |
|
||||||
|
|||||||
@ -16,7 +16,8 @@
|
|||||||
"flclash": {
|
"flclash": {
|
||||||
"repo": "chen08209/FlClash",
|
"repo": "chen08209/FlClash",
|
||||||
"file_list": {
|
"file_list": {
|
||||||
"amd64": "FlClash-{version}-linux-amd64.deb"
|
"amd64": "FlClash-{version}-linux-amd64.deb",
|
||||||
|
"arm64": "FlClash-{version}-linux-arm64.deb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"hugo": {
|
"hugo": {
|
||||||
|
|||||||
@ -41,11 +41,11 @@ if __name__ == "__main__":
|
|||||||
)
|
)
|
||||||
# get latest releases tag 获取最新版本标签
|
# get latest releases tag 获取最新版本标签
|
||||||
location = requests.head(release_url + "/latest").headers.get("Location", "")
|
location = requests.head(release_url + "/latest").headers.get("Location", "")
|
||||||
match = re.search(r".*releases/tag/([^/]+)", location)
|
match = re.search(r".*releases/tag/(.*)", location)
|
||||||
if not match:
|
if not match:
|
||||||
continue
|
continue
|
||||||
releases_tag = match.group(1)
|
releases_tag = match.group(1)
|
||||||
version = match.group() if (match := re.search("[0-9].*", releases_tag)) else ""
|
version = match.group() if (match := re.search("[0-9][^_]*", releases_tag)) else ""
|
||||||
|
|
||||||
|
|
||||||
for arch, file_name in repo["file_list"].items():
|
for arch, file_name in repo["file_list"].items():
|
||||||
|
|||||||
@ -111,10 +111,8 @@ def process_repo(r: dict):
|
|||||||
获取仓库中不同架构子仓库的内容,最后调用 get_latest 去重并保存。
|
获取仓库中不同架构子仓库的内容,最后调用 get_latest 去重并保存。
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
deb_packages = b""
|
|
||||||
for arch, path in r["path"].items():
|
for arch, path in r["path"].items():
|
||||||
deb_packages += get_remote_packages(r["repo"], path)
|
get_latest(get_remote_packages(r["repo"], path))
|
||||||
get_latest(deb_packages)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(f"Error processing repo {r.get('name', 'unknown')}: {e}")
|
logging.error(f"Error processing repo {r.get('name', 'unknown')}: {e}")
|
||||||
|
|
||||||
@ -152,17 +150,10 @@ if __name__ == "__main__":
|
|||||||
executor.map(process_repo, repo_list.values())
|
executor.map(process_repo, repo_list.values())
|
||||||
|
|
||||||
# 分别输出到不同文件
|
# 分别输出到不同文件
|
||||||
os.makedirs("deb/amd64/", exist_ok=True)
|
for arch in ["amd64", "arm64"]:
|
||||||
os.makedirs("deb/arm64/", exist_ok=True)
|
os.makedirs(f"deb/dists/wcbing/main/binary-{arch}/", exist_ok=True)
|
||||||
|
with open(f"deb/dists/wcbing/main/binary-{arch}/Packages", "+wb") as f:
|
||||||
with open("deb/amd64/Packages", "+wb") as f:
|
for i in package_info[arch].values():
|
||||||
for i in package_info["amd64"].values():
|
f.write(i)
|
||||||
f.write(i)
|
for i in package_info["all"].values():
|
||||||
for i in package_info["all"].values():
|
f.write(i)
|
||||||
f.write(i)
|
|
||||||
|
|
||||||
with open("deb/arm64/Packages", "+wb") as f:
|
|
||||||
for i in package_info["arm64"].values():
|
|
||||||
f.write(i)
|
|
||||||
for i in package_info["all"].values():
|
|
||||||
f.write(i)
|
|
||||||
|
|||||||
26
run.sh
26
run.sh
@ -1,29 +1,31 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
gen_release() {
|
|
||||||
apt-ftparchive release $1 >$1/Release
|
|
||||||
gpg --yes --detach-sign -a -o $1/Release.gpg $1/Release
|
|
||||||
gpg --yes --clearsign -o $1/InRelease $1/Release
|
|
||||||
}
|
|
||||||
|
|
||||||
# check for updates
|
# check for updates
|
||||||
./get-github-releases.py
|
./get-github-releases.py
|
||||||
find get -type f -name "*.sh" -exec sh {} \;
|
find get -type f -name "*.sh" -exec sh {} \;
|
||||||
|
|
||||||
|
# generate the html
|
||||||
|
./gen-list-html.py
|
||||||
|
|
||||||
cd deb
|
cd deb
|
||||||
# generate the local Packages
|
# generate the local Packages
|
||||||
apt-ftparchive packages . > tmpPackages
|
apt-ftparchive packages . > tmpPackages
|
||||||
sed -i "s|\./\(https\?\):/|\1://|g" tmpPackages
|
sed -i "s|\./\(https\?\):/|\1://|g" tmpPackages
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
sed -i "s|\./|\.\./|g" deb/tmpPackages
|
|
||||||
cat $(find packages -name "*.package") >> deb/tmpPackages
|
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
|
./merge-apt-repo.py --local deb/tmpPackages
|
||||||
|
|
||||||
# generate the Release file
|
# generate the Release file
|
||||||
gen_release deb/amd64
|
cd deb/dists/wcbing
|
||||||
gen_release deb/arm64
|
echo 'Origin: wcbing APT Repo
|
||||||
|
Label: wcbing
|
||||||
# generate the html
|
Suite: wcbing
|
||||||
./gen-list-html.py
|
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
|
||||||
|
gpg --yes --clearsign -o InRelease Release
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user