如何覆盖规范文件中的 CONFIG_SITE(最佳实践)

发布于 2024-11-10 08:16:53 字数 467 浏览 0 评论 0原文

如果尝试从specfile构建rpm的用户在运行rpmbuild时在环境中设置了CONFIG_SITE,并且specfile使用“./configure --prefix=/usr && make”构建,则CONFIG_SITE中的用户设置可以完全破坏构建。 (作为一个具体的例子,假设 /usr/share/config.site 有一行“prefix=/bar”。那么,spec 文件的文件清单将完全错误,并且 rpmbuild 将失败。)

处理的最佳实践是什么这个问题?似乎常见的做法是忽略它。我决定在规范文件中设置 CONFIG_SITE=true :

CONFIG_SITE=true ./configure --prefix=/usr ...

在调用 rpmbuild 时假设原始环境是否更常见,并且没有像在 /usr/share/config.site 中重置前缀那样的愚蠢行为?或者维护者是否负责确保规范文件将按预期构建 rpm?

If a user attempting to build an rpm from a specfile has CONFIG_SITE set in the environment when running rpmbuild, and the specfile builds with "./configure --prefix=/usr && make", then the user's settings in the CONFIG_SITE can completely mangle the build. (As a concrete example, suppose /usr/share/config.site has the line "prefix=/bar". Then the spec file's file manifest will be completely wrong and the rpmbuild will fail.)

What is the best practice for dealing with this issue? It seems like common practice is to ignore it. I've decided to set CONFIG_SITE=true in the specfile:

CONFIG_SITE=true ./configure --prefix=/usr ...

Is it more common to assume a pristine environment when invoking rpmbuild, and that there is no silliness like resetting prefix in /usr/share/config.site? Or is the maintainer responsible for ensuring that the spec file will build the rpm as expected?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

零度° 2024-11-17 08:16:53

我认为如果用户设置了一个愚蠢的 config.site 文件,那是他们自己的错。除了这个方法之外,肯定还有无数其他方法来破坏系统。我不会担心这个。我从未见过担心这一点的 rpm 或 deb 构建脚本。所以这可能是你的“最佳实践”。

您偶尔会看到,包带有自己的 config.site 文件,但通常由打包者提供该文件,以覆盖原始包中可能损坏的配置检查所产生的内容。

I think if users set up a stupid config.site file, it's their own fault. There are certainly countless other ways besides this one to cripple a system; I wouldn't worry about it. I have never seen an rpm or deb build script that worries about this. So that's perhaps your "best practice".

What you can see occasionally is that a package brings along its own config.site file, but that is then usually supplied by the packager to override what a perhaps broken configure check in the original package would produce.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文