如何强制 Anaconda 在 coreutils 之后安装我的软件包?

发布于 2024-11-11 16:03:09 字数 674 浏览 4 评论 0原文

我有一个定制的 RPM,它构建了一组子包。每个子包在规范文件中都有一个 %post 脚本,用于将一些符号链接复制到另一个文件夹:

%post server
echo "Copying symlinks..." >> /tmp/mystuff.log
pwd >> /tmp/mystuff.log
cp -av /etc/mystuff/symlinks/server/current /etc/mystuff/ >> /tmp/splashtheme.log 2>&1

当我在正在运行的系统上安装其中一个子包 RPM 时,它工作正常。当我通过 Anaconda(作为 Kickstart 软件包列表的一部分)安装它时,RPM 的安装后脚本似乎没有运行。

编辑: 事实证明,它们实际上确实运行,但我收到一条错误消息:

/var/tmp/rpm-tmp.48901: line 3: cp: command not found

显然,Anaconda 正在尝试在安装 coreutils 之前安装我的 RPM,即使我将 coreutils 指定为依赖项要求:

所以,我修改后的问题是标题:如何强制我的包在 coreutils 之后安装?

I have a customized RPM that builds a set of subpackages. Each subpackage has a %post script in the spec file that is used to copy some symlinks to another folder:

%post server
echo "Copying symlinks..." >> /tmp/mystuff.log
pwd >> /tmp/mystuff.log
cp -av /etc/mystuff/symlinks/server/current /etc/mystuff/ >> /tmp/splashtheme.log 2>&1

When I install one of the subpackage RPMs on a running system, it works fine. When I install it via Anaconda (as part of a Kickstart package list), the RPM's post-install scripts do not seem to run.

Edit:
As it turns out, they actually do run, but I'm getting an error that says:

/var/tmp/rpm-tmp.48901: line 3: cp: command not found

Apparently, Anaconda is attempting to install my RPM before it installs coreutils, even though I specify coreutils as a dependency in Requires:.

So, my revised question is the title: How can I force my package to be installed after coreutils?

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

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

发布评论

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

评论(2

弄潮 2024-11-18 16:03:09

@Justin,你很幸运,因为如果在同一事务中,anaconda 仍然可以以不同的顺序安装它们。您需要的是:

Requires: coreutils
Requires(post): coreutils

这样 anaconda/rpm 将确保在运行 %post 之前安装 core utils。

@Justin, you're being lucky that that works as anaconda could still install them in a different order if its in the same transaction. What you need is:

Requires: coreutils
Requires(post): coreutils

That way anaconda/rpm will ensure that core utils is installed prior to your %post being run.

迷你仙 2024-11-18 16:03:09

我的规范文件中有错误。我在序言中而不是在 %package 部分中指定了 Requires: 行。这修复了它:

%package server
Summary: Server component
Group: Extras
Requires: coreutils

I had an error in my specfile. I had specified the Requires: line in the preamble instead of in the %package section. This fixed it:

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