Files
2025-07-23 20:41:13 +08:00

39 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
测试项1 - 安装包哈希值
## 脚本简介
这个 Bash 脚本的主要功能是递归查找当前目录下的所有 RPM 包文件,然后比较每个 RPM 包的本地 MD5 签名与 Koji 构建系统中记录的 MD5 签名是否一致
## 使用方法
# ./check_pgpsig.sh
---
## 输入文件
- `pkg`:每行一个 RPM 包名,。
-使用 find 命令递归查找当前目录下的所有 RPM 文件
---
## 输出文件
-MD5 值匹配的和不匹配的,并分别将结果输出到 equal.txt 和 noquual.txt 文件中
---
## 脚本流程说明
1. 使用 find 命令递归查找当前目录下的所有 RPM 文件
2. 使用 rpm -qp 命令查询 RPM 包的头信息
3. --qf 选项指定输出格式,包含包名 (%{NAME}) 和 GPG 签名信息 (%{RSAHEADER:pgpsig})
4. 如果签名信息中包含 "none",表示未签名,将结果同时输出到标准输出和 nogpg.list 文件。
5. 否则,表示已签名,将结果追加到 gpg.list 文件。
---
## 注意事项
- 需要 root 权限运行。
- 系统需启用 YUM 并配置好可用仓库。
- 安装失败或卸载失败的错误日志会保存在 `Error` 字段中,方便后续排查。
---