Compare commits

..

4 Commits

Author SHA1 Message Date
02819b059c add remotedesktopmanager repo 2025-11-03 20:33:46 +08:00
f48875195e fix: 修正 Packages 字段提取 2025-11-03 20:33:41 +08:00
7859b53c05 add wezterm repo 2025-11-03 20:33:33 +08:00
c70a16716b fix: 修改 Packages 分割方式 2025-11-03 20:33:24 +08:00
3 changed files with 27 additions and 11 deletions

View File

@ -115,6 +115,8 @@
| [AnyDesk](https://deb.anydesk.com/howto.html) | anydesk | ✅ | ✅ |
| [Spotify](https://www.spotify.com/sg-zh/download/linux/) | spotify-client | ✅ | |
| [Free Download Manager](https://www.freedownloadmanager.org/zh/download-fdm-for-linux.htm) | freedownloadmanager | ✅ | |
| [WezTerm](https://wezterm.org/install/linux.html#using-the-apt-repo) | wezterm<br />wezterm-nightly | ✅ | ✅ |
| [Remote Desktop Manager](https://docs.devolutions.net/rdm/installation/client/?tab=linux) | remotedesktopmanager | ✅ | ✅ |
## 自建仓库

View File

@ -154,5 +154,18 @@
"path": {
"amd64": "dists/jammy/main/binary-amd64/Packages.gz"
}
},
"wezterm": {
"repo": "https://apt.fury.io/wez/",
"path": {
"mix": "Packages"
}
},
"remotedesktopmanager": {
"repo": "https://dl.cloudsmith.io/public/devolutions/rdm/deb/debian/",
"path": {
"amd64": "dists/trixie/main/binary-amd64/Packages.gz",
"arm64": "dists/trixie/main/binary-arm64/Packages.gz"
}
}
}

View File

@ -76,10 +76,6 @@ def get_remote_packages(repo_url: str, file_path: str) -> bytes:
else: # Packages
content = response.content
# complete the two newlines if the ending is less than two newlines
# 结尾不足两个换行符的话,补全两个换行符
if not content.endswith(b"\n\n"):
content += b"\n"
return content.replace(b"Filename: ", f"Filename: {repo_url}".encode())
except Exception as e:
logging.error(f"Error fetching packages: {e}")
@ -91,14 +87,19 @@ def split_latest(packages_file_content: bytes):
split the information of each packet, deduplication and store the latest in infoList
将每个包的信息分割开去重并将最新的存放到 infoList
"""
packages_file_content = re.sub(
rb"^Package: ", b"{{start}}Package: ", packages_file_content, flags=re.MULTILINE
)
package_list = packages_file_content.split(b"{{start}}")[1:]
# Remove trailing empty lines first
packages_file_content = packages_file_content.rstrip(b"\n\r\t ")
find_name = re.compile(rb"Package: (.+)")
find_arch = re.compile(rb"Architecture: (.+)")
find_version = re.compile(rb"Version: (.+)")
# split on two or more consecutive blank lines
package_list = [
part + b"\n\n"
for part in re.split(rb"(?:\r?\n){2,}", packages_file_content)
if part.strip()
]
find_name = re.compile(rb"Package:[ ]*(.+)")
find_arch = re.compile(rb"Architecture:[ ]*(.+)")
find_version = re.compile(rb"Version:[ ]*(.+)")
for package in package_list:
name = "unknown"