19 个版本 (5 个重大更新)
0.158.9 | 2024 年 8 月 12 日 |
---|---|
0.158.8 | 2024 年 8 月 5 日 |
0.158.3 | 2024 年 7 月 31 日 |
0.157.4 | 2024 年 6 月 30 日 |
0.150.0 | 2023 年 10 月 2 日 |
#66 在 构建实用工具
4,077 每月下载量
在 2 crates 中使用
135KB
3.5K SLoC
lintian-brush
本软件包包含一组脚本来自动修复 Debian 软件包中的一些常见问题。
运行 lintian-brush
只需运行:
lintian-brush
在你的 (版本控制的) Debian 软件包的顶级目录下。
.. _supported-tags
支持的标签
当前一套 lintian 标签,对于这些标签存在可以修复部分问题的修复器
- adopted-extended-field
- ancient-python-version-field
- ancient-standards-version
- autotools-pkg-config-macro-not-cross-compilation-safe
- build-depends-on-build-essential
- build-depends-on-obsolete-package
- built-using-field-on-arch-all-package
- carriage-return-line-feed
- comma-separated-files-in-dep5-copyright
- copyright-does-not-refer-to-common-license-file
- copyright-file-contains-full-apache-2-license
- copyright-file-contains-full-gfdl-license
- copyright-file-contains-full-gpl-license
- copyright-has-crs
- copyright-not-using-common-license-for-apache2
- copyright-not-using-common-license-for-gfdl
- copyright-not-using-common-license-for-gpl
- copyright-not-using-common-license-for-lgpl
- copyright-refers-to-symlink-license
- copyright-refers-to-versionless-license-file
- custom-compression-in-debian-source-options
- cute-field
- debhelper-but-no-misc-depends
- debhelper-tools-from-autotools-dev-are-deprecated
- debian-changelog-file-contains-obsolete-user-emacs-settings
- debian-changelog-has-wrong-day-of-week
- debian-changelog-line-too-long
- debian-control-has-empty-field
- debian-control-has-obsolete-dbg-package
- debian-control-has-unusual-field-spacing
- debian-pycompat-is-obsolete
- debian-pyversions-is-obsolete
- debian-rules-calls-pwd
- debian-rules-contains-unnecessary-get-orig-source-target
- debian-rules-missing-recommended-target
- debian-rules-not-executable
- debian-rules-parses-dpkg-parsechangelog
- debian-rules-sets-dpkg-architecture-variable
- debian-rules-uses-as-needed-linker-flag
- debian-rules-uses-special-shell-variable
- debian-rules-uses-unnecessary-dh-argument
- debian-tests-control-and-control-autodep8
- debian-tests-control-autodep8-is-obsolete
- debian-upstream-obsolete-path
- debian-watch-contains-dh_make-template
- debian-watch-does-not-check-openpgp-signature
- debian-watch-file-is-missing
- debian-watch-file-pubkey-file-is-missing
- debian-watch-file-uses-deprecated-githubredir
- debian-watch-uses-insecure-uri
- debug-symbol-migration-possibly-complete
- declares-possibly-conflicting-debhelper-compat-versions
- dep5-file-paragraph-references-header-paragraph
- desktop-entry-contains-encoding-key
- desktop-entry-file-has-crs
- dh-clean-k-is-deprecated
- dh-quilt-addon-but-quilt-source-format
- dm-upload-allowed-is-obsolete
- empty-debian-tests-control
- 库包优先级过高
- 可执行桌面文件
- 扩展描述包含空段落
- 扩展描述为空
- Debian QA组短语错误
- dep5版权中字段名拼写错误
- 字体包不是多架构的
- 全局文件通配符不是dep5版权中的第一段
- 主页字段使用不安全的URI
- 主页在二进制包中
- 初始上传未关闭任何错误
- 版权格式URI不安全
- 可安装字段镜像源
- dep5版权中短名无效
- 无效的标准版本
- libmodule-build-perl需要包含在构建依赖中
- 许可证文件列在Debian版权中
- 维护者也在上传者中
- 维护者脚本为空
- 维护者脚本中没有set-e
- 损坏的dm-upload允许
- 损坏的覆盖
- 覆盖不匹配
- 缺少dh-addon的构建依赖
- 缺少dh_命令的构建依赖
- 缺少golang包的构建使用字段
- 缺少Debian源格式
- 缺少pyproject-backend的先决条件
- 缺少vcs浏览器字段
- closes拼写错误
- 新包使用基于日期的版本号
- 没有版权文件
- 没有主页字段
- 没有版本化的debhelper先决条件
- 过时的Debian监视文件标准
- dep5版权中的过时字段
- 过时的运行时测试限制
- 过时的打包中的URL
- 过时的vim插件管理器
- 旧的dpmt-vcs
- 版权文件中的旧Fsf地址
- 旧的papt-vcs
- 旧源覆盖位置
- 较旧的Debian监视文件标准
- 较旧的源格式
- 过时的版权格式URI
- 过时的标准版本
- 包包含linda覆盖
- 包使用已弃用的debhelper兼容版本
- 包使用旧的debhelper兼容版本
- 补丁文件存在但未在系列中提及
- pkg-js-tools测试丢失
- closes中可能缺少冒号
- priority-extra被priority-optional替换
- 本地包中的公共上游密钥
- 公共上游密钥不是最小的
- 在多个位置中存在公共上游密钥
- pypi主页
- python团队合并
- quilt系列但没有构建依赖
- quilt系列没有尾随换行符
- 推荐字段
- 重命名标签
- 必需字段
- rubygem主页
- 在需要root的规则上静默
- dep5版权中的标准短名中包含空格
- systemd服务别名没有扩展名
- systemd服务文件引用了过时的bindto
- systemd服务文件引用了过时的目标
- systemd服务文件引用了var-run
- systemd服务文件关闭问题
- 许可证文本中的制表符
- team/pkg-perl/testsuite缺少测试套件头
- team/pkg-perl/vcs没有git
- team/pkg-perl/vcs没有团队URL
- 尾随空格
- 过渡包不是oldlibs可选的
- debhelper覆盖目标中的拼写错误
- 不必要的团队上传
- 不必要的测试套件autopkgtest字段
- 在cdbs上的未使用构建依赖
- dep5版权中的未使用许可证段落
- 未使用覆盖
- 未版本化的版权格式URI
- 孤儿中的上传者
- 上游元数据文件丢失
- 本地源中的上游元数据
- 上游元数据缺少错误跟踪
- 上游元数据缺少存储库
- 上游元数据不是yaml映射
- 上游元数据yaml无效
- 无用的autoreconf构建依赖
- 使用debhelper兼容文件
- 使用已弃用的adttmp
- vcs字段损坏
- vcs字段不匹配
- vcs字段不是规范化的
- vcs字段使用不安全的URI
- vcs字段使用不推荐的URI格式
- vcs在Debian基础设施中过时
- 根据包名错误的章节
.. _writing-fixers
编写新修复程序
对于更详细的说明,请参阅编写修复程序的指南。
理想情况下,修复程序针对一组特定的lintian标签。这不是强制性的,但可以使轻松找到所有可以应用特定修复程序的包成为可能。
每个修复程序都是一个简单的脚本,位于fixers
目录下。脚本应在该目录中的index.desc
文件中进行注册。
修复程序在包的根目录下运行,它可以进行它认为必要的更改。如果修复程序不能提供任何改进,它可以简单地保持工作树不变 - lintian-brush不会为它创建任何提交或更新更改日志。如果退出时返回非零退出码,它所做的任何更改都将被丢弃,并且修复程序将报告为失败。
以下额外环境变量被设置
DEB_SOURCE
:正在编辑的源包名称。CURRENT_VERSION
:正在编辑的包版本。COMPAT_RELEASE
:需要兼容的Debian版本。当指定了--modern时通常为sid
,否则为当前稳定版本的名称。NET_ACCESS
:修复程序是否被允许建立网络连接(例如发送HTTP请求)。由--disable-net-access和测试套件使用。设置为allow
或disallow
。OPINIONATED
:设置为yes
或no
。如果设置为no
,修复程序不期望在无法明显确定单一正确修复的情况下进行更改。
对于用Python编写的修复程序,可以使用lintian_brush.fixer
模块方便地访问这些变量。
修复程序应在标准输出中写入对所做的更改的简短描述;这将用于提交信息。
其输出可以包含可选的元数据:
-
Fixed-Lintian-Tags:
后跟一个逗号分隔的lintian标签列表,该列表声称已修复。这将使lintian-brush包含有关已修复lintian标签的文档链接。将来,它也可能支持构建软件包以验证lintian标签是否已实际解决。 -
Certainty:
后跟certain
、confident
、likely
或possible
,表示修复程序有多确定修复是正确的。
默认的最小确定性级别为“certain”;以“certain”的确定性做出的任何不正确更改至少被认为是正常严重性的错误。
测试修复程序的最简单方法是创建一个位于tests/FIXER-NAME/TEST-NAME
下的骨架in和out源代码树。目录in
应包含运行修复程序时要运行的树,而目录out
包含运行后的目录。如果修复程序只需要一个或两个控制文件,则可以创建仅包含这些文件的目录。要为单个修复程序运行测试,可以使用“make check-fixer-$NAME”。
GitHub Action
如果您在GitHub上托管Git存储库,可以使用lintian-brush GitHub操作自动运行lintian-brush。
依赖项
~14–29MB
~465K SLoC