Compare commits

..

No commits in common. "02819b059c483db3d861b8958106868cf9b2922b" and "eaa8612e4677d04148dff0bcc2d5e3c3aa5398ba" have entirely different histories.

3 changed files with 11 additions and 27 deletions

View File

@ -115,8 +115,6 @@
| [AnyDesk](https://deb.anydesk.com/howto.html) | anydesk | ✅ | ✅ | | [AnyDesk](https://deb.anydesk.com/howto.html) | anydesk | ✅ | ✅ |
| [Spotify](https://www.spotify.com/sg-zh/download/linux/) | spotify-client | ✅ | | | [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 | ✅ | | | [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,18 +154,5 @@
"path": { "path": {
"amd64": "dists/jammy/main/binary-amd64/Packages.gz" "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,6 +76,10 @@ def get_remote_packages(repo_url: str, file_path: str) -> bytes:
else: # Packages else: # Packages
content = response.content 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()) return content.replace(b"Filename: ", f"Filename: {repo_url}".encode())
except Exception as e: except Exception as e:
logging.error(f"Error fetching packages: {e}") logging.error(f"Error fetching packages: {e}")
@ -87,19 +91,14 @@ def split_latest(packages_file_content: bytes):
split the information of each packet, deduplication and store the latest in infoList split the information of each packet, deduplication and store the latest in infoList
将每个包的信息分割开去重并将最新的存放到 infoList 将每个包的信息分割开去重并将最新的存放到 infoList
""" """
# Remove trailing empty lines first packages_file_content = re.sub(
packages_file_content = packages_file_content.rstrip(b"\n\r\t ") rb"^Package: ", b"{{start}}Package: ", packages_file_content, flags=re.MULTILINE
)
package_list = packages_file_content.split(b"{{start}}")[1:]
# split on two or more consecutive blank lines find_name = re.compile(rb"Package: (.+)")
package_list = [ find_arch = re.compile(rb"Architecture: (.+)")
part + b"\n\n" find_version = re.compile(rb"Version: (.+)")
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: for package in package_list:
name = "unknown" name = "unknown"