mirror of
https://github.com/wcbing/wcbing-apt-repo.git
synced 2025-12-29 02:28:30 +08:00
Compare commits
4 Commits
eaa8612e46
...
02819b059c
| Author | SHA1 | Date | |
|---|---|---|---|
| 02819b059c | |||
| f48875195e | |||
| 7859b53c05 | |||
| c70a16716b |
@ -115,6 +115,8 @@
|
|||||||
| [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 | ✅ | ✅ |
|
||||||
|
|
||||||
## 自建仓库
|
## 自建仓库
|
||||||
|
|
||||||
|
|||||||
@ -154,5 +154,18 @@
|
|||||||
"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"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -76,10 +76,6 @@ 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}")
|
||||||
@ -91,14 +87,19 @@ 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 中
|
||||||
"""
|
"""
|
||||||
packages_file_content = re.sub(
|
# Remove trailing empty lines first
|
||||||
rb"^Package: ", b"{{start}}Package: ", packages_file_content, flags=re.MULTILINE
|
packages_file_content = packages_file_content.rstrip(b"\n\r\t ")
|
||||||
)
|
|
||||||
package_list = packages_file_content.split(b"{{start}}")[1:]
|
|
||||||
|
|
||||||
find_name = re.compile(rb"Package: (.+)")
|
# split on two or more consecutive blank lines
|
||||||
find_arch = re.compile(rb"Architecture: (.+)")
|
package_list = [
|
||||||
find_version = re.compile(rb"Version: (.+)")
|
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:
|
for package in package_list:
|
||||||
name = "unknown"
|
name = "unknown"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user