浏览器预览支持 deb(5) 全部压缩格式(zstd 回退/bz2/lzma)+ 我的软件包下载按钮#7
Merged
Conversation
Vendored pure-JS decompressors (same-origin, lazily imported):
- fzstd 0.1.1 as zstd fallback when DecompressionStream('zstd') is
unavailable (only Chrome 133+ has it natively)
- bz2 1.0.1 for legacy data.tar.bz2 members
- LZMA-JS 2.3.2 decompression-only build for legacy data.tar.lzma
debparse.js now recognizes .tar.bz2 and .tar.lzma members alongside
gz/xz/zst/uncompressed. Tests build fixtures for every format (bz2/lzma
via ar repack since dpkg-deb cannot build them) and decompress zstd/
bzip2/lzma with the same vendored libraries the page ships.
Co-authored-by: eggfly <lihaohua90@gmail.com>
Resolve the download URL from the APT index Filename field (absolute URL or pool path relative to the repository root) and render a styled download link next to the unpublish button; rows now sort by version within the same package name. Co-authored-by: eggfly <lihaohua90@gmail.com>
eggfly
marked this pull request as ready for review
July 15, 2026 12:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
用户的 nc2000 包用 zstd 压缩(dpkg 新版默认支持),但页面此前只依赖浏览器原生
DecompressionStream("zstd")(仅 Chrome 133+ 支持),其他浏览器直接报"解析失败:此浏览器不支持 zstd 解压"。改动
1. 本地解析支持 deb(5) 允许的全部压缩格式
按 deb(5) 手册,control.tar/data.tar 成员合法压缩为:无压缩、gzip、xz、zstd、bzip2(.bz2)、lzma(.lzma)。现在全部支持:
DecompressionStream("gzip")(不变)DecompressionStream("zstd"),失败回退 fzstd 0.1.1(纯 JS,~24KB)三个新库都 vendored 在
site/vendor/同域托管、按需懒加载(与原有 xz 同一策略:不依赖第三方 CDN,加载失败只影响对应格式)。jsDelivr 的+esm构建在浏览器里只把 bz2 挂到window.bz2、LZMA-JS 用this.LZMA,因此这两个库用了轻量 ESM 包装(原始源码原样内嵌,包装逻辑有注释说明)。2. "我的软件包"增加下载 .deb 按钮
Filename字段解析下载地址(本仓库发布到 GitHub Releases 是绝对 URL;也兼容相对 pool 路径)包名_版本_架构.deb,同名包多版本按版本排序展示测试
extractMember识别.tar.bz2/.tar.lzma.tar路径node --test test/*.test.js全部通过;另做了 nc2000 样例的 zstd 回退路径冒烟测试CI 依赖从
zstd换成bzip2(zstd 解压现在走纯 JS 库,lzma 压缩夹具用xz --format=lzma)。