JGZYES 0be951c864 color: structured [PMM]:[LEVEL] output (error=red/success=green/info=gray/warn=yellow)
- Add src/out.c + src/out.h: pmm_error/pmm_success/pmm_info/pmm_warn helpers.
  Each prefixes '[PMM]:[LEVEL]' and, only when the stream is a tty, wraps it
  in an ANSI colour (red/green/gray/yellow). On redirect/pipe the text is plain.
- Replace all error/success/info/warn print statements across main.c, install.c,
  pdm.c, pmm.c, json.c with these helpers (http.c download progress bar left
  untouched so its \r overwrite stays intact).
- Windows: enable ENABLE_VIRTUAL_TERMINAL_PROCESSING on stdout/stderr so ANSI
  colours render (added alongside the existing SetConsoleOutputCP).
- Rewrite 3 install.c system() error-echo strings to colored \033[31m echoes.
- Build: add src/out.c to Makefile and build.bat.

Verified on WSL gcc: compiles clean. tty (script) shows ESC-coloured output for
INFO/ERROR/SUCCESS; non-tty shows plain '[PMM]:[LEVEL]' text with no escapes.
2026-09-04 19:23:27 +08:00
2026-09-02 21:18:36 +08:00
2026-09-02 21:18:36 +08:00
2026-09-02 21:18:36 +08:00
2026-09-02 21:18:36 +08:00
2026-09-02 21:18:36 +08:00
2026-09-02 21:18:36 +08:00

ParlzPackageManager (PMM)

一个用 C 语言从零编写的跨平台包管理器,支持 Windows / Linux / macOS

像 apt 一样多用镜像源,也能直接从 GitHub / GitLab / Gitea / Forgejo 的 Release 安装;自带 .pdm 打包格式、依赖解析、并发分片下载、SHA-256 / SHA-1 校验。

官网:https://pmm.parlz.com · 镜像站:https://sz.pmm.parlz.com/mirror(深圳)/ https://pmm.parlz.com/mirror(香港)

特性

  • apt 式多镜像源mirror.ini / mirror.conf,按优先级自动回退,默认带 sz(深圳)与 main(香港)。
  • git Release 安装pmm install --git repo,支持 GitHub / GitLab / Gitea / Forgejo;repo@tag-b branch 安装指定版本。
  • .pdm 打包pmm pack <dir> 生成含 control.tar.gz / data.tar.gz / sha256sums 的归档(deb 思路)。
  • 依赖解析pdm-controlDepends:,registry 的 "depends": [...],安装时递归解析并按版本约束安装。
  • 并发分片 + 断点续传:大文件 4 路 Range 并行、逐片续传、拼接校验;失败回退单流。进度条含已用/剩余/速度。
  • 哈希校验:内置 SHA-256 / SHA-1FIPS 180-4),下载后强校验;pmm verify <file> 随时验证。
  • 本地包安装-dpkg x.debLinux)、-msi x.msiWindows),支持 .rpm/.zip/.tar.gz/.exe/.dmg,直接装文件或 URL。
  • 搜索 / 信息 / 缓存pmm searchpmm infopmm cache clean--no-cache

安装

# Linux / macOS 一键安装
curl -sSL https://pmm.parlz.com/install.sh | bash

# Linux .deb
sudo apt install ./pmm_0.2.9_amd64.deb
# Linux .rpm
sudo rpm -Uvh pmm-0.2.9.x86_64.rpm

Windows:下载 pmm-0.2.9-windows-amd64.zip,解压后把 pmm.exe 所在目录加入 PATH

使用

pmm search nodejs                 # 在镜像里搜包
pmm install nodejs                # 安装(自动解析依赖)
pmm install nodejs==24.20.0       # 指定版本
pmm install --git JGZYES/ParlzPackageManger@v0.2.9   # git release 指定 tag
pmm info nodejs                   # registry / 本地信息
pmm verify pmm.pdm                # 校验哈希
pmm list                          # 已装列表
pmm remove nodejs                 # 卸载
pmm pack ./myapp myapp.pdm        # 打包 .pdm

构建

Linux / macOS

make

Windows(需 MinGW gcc):

build.bat

源码结构:

src/
├── main.c      # CLI 分发
├── pmm.c       # 配置 / 目录 / PATH / 注册表
├── http.c      # HTTP 下载(并行分片 + 进度)
├── repo.c      # git host 适配 + 资产选择
├── install.c   # 安装分发 + 依赖解析
├── pdm.c       # .pdm 打包 / 安装
├── ini.c / json.c  # 配置解析
└── sha256.c / sha1.c  # 哈希

相关

S
描述
无详细信息
自述文档 GPL-3.0
382 MiB
语言
C 83%
PHP 7%
CSS 5.5%
Shell 2.6%
JavaScript 1.7%
其它 0.1%