pkgadd 原型文件不会破坏链接

发布于 2024-08-17 22:22:14 字数 41 浏览 9 评论 0原文

如何创建一个在安装软件包时不会破坏软链接的 Solaris 软件包?

How can I create a solaris package that will not to break soft links when the package gets installed ?

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

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

发布评论

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

评论(3

网白 2024-08-24 22:22:14

您可以使用原型文件中的类字段来有条件地安装东西。例如:

d none /foo 0775 $USER $GROUP
d createbar /bar 0775 $USER $GROUP

目录 /foo 通常会被创建,因为“none”是默认类。另一方面,只有当安装程序设置为安装“createbar”类中的内容时,才会创建 /bar。

要安装的初始类集在 pkginfo 文件中设置。您可以在 requestcheckinstall 脚本中更改类列表。这个想法是让这些脚本之一执行一些检查来决定是否安装可选组件,然后适当地更改类。例如:

# Create /bar unless it already exists as a symlink
if [ ! -L /bar ]
then
    echo "CLASSES=${CLASSES} createbar"
fi

如果这个答案不能满足您的需求,也许您可​​以更好地描述您想要做什么。

You can use the class field in the prototype file to conditionally install things. For example:

d none /foo 0775 $USER $GROUP
d createbar /bar 0775 $USER $GROUP

The directory /foo will normally always be created because "none" is the default class. On the other hand, /bar will only be created if the installer is set to install things in the "createbar" class.

The initial set of classes to install is set in the pkginfo file. You can alter the class list in the request or checkinstall scripts. The idea is for one of these scripts to perform some check to decide whether to install the optional components, then alter CLASSES appropriately. For example:

# Create /bar unless it already exists as a symlink
if [ ! -L /bar ]
then
    echo "CLASSES=${CLASSES} createbar"
fi

If this answer doesn't meet your needs, maybe you could give a better description of what you're trying to do.

挽手叙旧 2024-08-24 22:22:14

这些符号链接是您的包原型文件的一部分吗?
如果是,它们是如何定义的?

Are these symbolic links parts of your package prototype file ?
If so, how are they defined ?

惜醉颜 2024-08-24 22:22:14

断开链接是什么意思?我可以想到链接可能会发生的一些事情:

  1. 用文件覆盖符号链接 用目录
  2. 覆盖符号链接
  3. 将文件放入符号链接指向的目录中(例如,安装到 /opt/foo/ bar,而 /opt/foo 是一个符号链接)

如果您澄清您的问题将会有所帮助。

但无论哪种情况,集体诉讼如果您想以特殊方式处理包中的某些文件,您可能需要查看脚本

在原型文件中,您需要为文件分配一个类名,在不同的包中,您需要提供一个处理此类的脚本。您可以查看 CSWcswclassutils,该包提供了许多集体诉讼示例。您将创建一个提供类操作脚本的类似包,并将包中的脚本与特殊文件一起使用。

What do you mean by breaking links? I can think of a couple of things that might happen to the links:

  1. Overwrite a symlink with a file
  2. Overwrite a symlink with a directory
  3. Put a file into a directory to which a symlink is pointing (say, you install into /opt/foo/bar, and /opt/foo is a symlink)

It would help if you clarified your question.

In either case however, the class action scripts are something you might want to look at, if you want to handle certain files from your package in a special way.

In the prototype file, you need to assign a class name to a file, and in a different package, you need to provide a script which will handle this class. You can take a look at CSWcswclassutils, a package which provides a number of class action examples. You would create a similar package providing a class action script, and use the scripts in your package with special files.

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