mirror of
https://github.com/wcbing/wcbing-apt-repo.git
synced 2025-12-29 02:28:30 +08:00
Compare commits
5 Commits
d2f19aaede
...
c420ab12b9
| Author | SHA1 | Date | |
|---|---|---|---|
| c420ab12b9 | |||
| 015dfbd099 | |||
| 60588bd38e | |||
| de9fae4414 | |||
| 91f098d89f |
17
Dockerfile
Normal file
17
Dockerfile
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
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"]
|
||||||
@ -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 | ✅ | ✅ |
|
||||||
@ -83,7 +83,8 @@
|
|||||||
| [Sublime Text<br />Sublime Merge](https://www.sublimetext.com/docs/linux_repositories.html) | sublime-text<br />sublime-merge | ✅ | ✅ |
|
| [Sublime Text<br />Sublime Merge](https://www.sublimetext.com/docs/linux_repositories.html) | sublime-text<br />sublime-merge | ✅ | ✅ |
|
||||||
| [Steam](https://repo.steampowered.com/steam/) | steam-launcher<br />steam-libs-amd64 | ✅ | |
|
| [Steam](https://repo.steampowered.com/steam/) | steam-launcher<br />steam-libs-amd64 | ✅ | |
|
||||||
| [Tailscale](https://pkgs.tailscale.com/stable/) | tailscale<br />tailscale-nginx-auth | ✅ | ✅ |
|
| [Tailscale](https://pkgs.tailscale.com/stable/) | tailscale<br />tailscale-nginx-auth | ✅ | ✅ |
|
||||||
| [black-desk 打包](https://github.com/black-desk/debs) | app.typst.typst<br />dev.neovide.neovide<br />dev.zed.zed<br />dev.zed.zed-pre<br />~~io.github.black-desk.debian-tweak<br />io.neovim.neovim<br />io.neovim.neovim-nightly<br />one.metacubex.clash-meta~~<br />org.pimalaya.himalaya | ✅ | |
|
| [neovide: wcbing 打包](https://github.com/wcbing-build/neovide-debs) | neovide | ✅ | |
|
||||||
|
| [himalaya: wcbing 打包](https://github.com/wcbing-build/himalaya-debs) | himalaya | ✅ | ✅ |
|
||||||
| [Typora](https://typora.io/#linux) | typora | ✅ | ✅ |
|
| [Typora](https://typora.io/#linux) | typora | ✅ | ✅ |
|
||||||
| [Zotero](https://zotero.retorque.re/file/apt-package-archive/index.html) | zotero<br />zotero-beta<br />zotero6 | ✅ | |
|
| [Zotero](https://zotero.retorque.re/file/apt-package-archive/index.html) | zotero<br />zotero-beta<br />zotero6 | ✅ | |
|
||||||
| [Github CLI](https://cli.github.com/) | gh | ✅ | ✅ |
|
| [Github CLI](https://cli.github.com/) | gh | ✅ | ✅ |
|
||||||
|
|||||||
@ -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": {
|
||||||
|
|||||||
@ -62,12 +62,6 @@
|
|||||||
"mix": "apt/stable/Packages.gz"
|
"mix": "apt/stable/Packages.gz"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"black-desk": {
|
|
||||||
"repo": "https://github.com/black-desk/debs/releases/latest/download/",
|
|
||||||
"path": {
|
|
||||||
"amd64": "Packages"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"typora": {
|
"typora": {
|
||||||
"repo": "https://typoraio.cn/linux/",
|
"repo": "https://typoraio.cn/linux/",
|
||||||
"path": {
|
"path": {
|
||||||
@ -129,5 +123,17 @@
|
|||||||
"amd64": "dists/gitea/main/binary-amd64/Packages",
|
"amd64": "dists/gitea/main/binary-amd64/Packages",
|
||||||
"arm64": "dists/gitea/main/binary-arm64/Packages"
|
"arm64": "dists/gitea/main/binary-arm64/Packages"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"neovide": {
|
||||||
|
"repo": "https://github.com/wcbing-build/neovide-debs/releases/latest/download/",
|
||||||
|
"path": {
|
||||||
|
"mix": "Packages"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"himalaya": {
|
||||||
|
"repo": "https://github.com/wcbing-build/himalaya-debs/releases/latest/download/",
|
||||||
|
"path": {
|
||||||
|
"mix": "Packages"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -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():
|
||||||
|
|||||||
@ -12,6 +12,9 @@ import requests
|
|||||||
import sys
|
import sys
|
||||||
from concurrent.futures import ThreadPoolExecutor
|
from concurrent.futures import ThreadPoolExecutor
|
||||||
from threading import Lock
|
from threading import Lock
|
||||||
|
import apt_pkg
|
||||||
|
|
||||||
|
apt_pkg.init() # 初始化 apt_pkg
|
||||||
|
|
||||||
package_version = {arch: {} for arch in ["all", "amd64", "i386", "arm64"]}
|
package_version = {arch: {} for arch in ["all", "amd64", "i386", "arm64"]}
|
||||||
package_info = {arch: {} for arch in ["all", "amd64", "i386", "arm64"]}
|
package_info = {arch: {} for arch in ["all", "amd64", "i386", "arm64"]}
|
||||||
@ -92,13 +95,8 @@ def get_latest(deb_packages: bytes):
|
|||||||
arch = find_arch.search(v).group(1).decode()
|
arch = find_arch.search(v).group(1).decode()
|
||||||
tmp_version = find_version.search(v).group(1).decode()
|
tmp_version = find_version.search(v).group(1).decode()
|
||||||
with lock[arch]:
|
with lock[arch]:
|
||||||
if (
|
# 使用 apt_pkg 进行版本比较
|
||||||
name not in package_version[arch]
|
if name not in package_version[arch] or apt_pkg.version_compare(tmp_version, package_version[arch][name]) > 0:
|
||||||
or os.system(
|
|
||||||
f"dpkg --compare-versions {tmp_version} gt {package_version[arch][name]}"
|
|
||||||
)
|
|
||||||
== 0
|
|
||||||
):
|
|
||||||
package_version[arch][name] = tmp_version
|
package_version[arch][name] = tmp_version
|
||||||
package_info[arch][name] = v
|
package_info[arch][name] = v
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@ -111,10 +109,8 @@ def process_repo(r: dict):
|
|||||||
获取仓库中不同架构子仓库的内容,最后调用 get_latest 去重并保存。
|
获取仓库中不同架构子仓库的内容,最后调用 get_latest 去重并保存。
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
deb_packages = b""
|
for path in r["path"].values():
|
||||||
for arch, path in r["path"].items():
|
get_latest(get_remote_packages(r["repo"], path))
|
||||||
deb_packages += 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 +148,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)
|
|
||||||
for i in package_info["all"].values():
|
|
||||||
f.write(i)
|
|
||||||
|
|
||||||
with open("deb/arm64/Packages", "+wb") as f:
|
|
||||||
for i in package_info["arm64"].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)
|
||||||
|
|||||||
35
run.sh
35
run.sh
@ -1,29 +1,34 @@
|
|||||||
#!/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
|
||||||
|
|
||||||
|
# generate the Packages file
|
||||||
|
## generate the local Packages file
|
||||||
cd deb
|
cd deb
|
||||||
# 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
|
|
||||||
|
## merge the Packages file from local package
|
||||||
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