Debian打包:将文件部署到用户主目录 [英] Debian packaging: deploying files to the user home directory

查看:291
本文介绍了Debian打包:将文件部署到用户主目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Debhelper创建Debian软件包。要部署文件和目录,我使用 debian / install debian / dirs 文件。

I use Debhelper to create Debian packages. To deploy files and directories, I use the debian/install and debian/dirs files.

现在,我希望我的程序包将默认的用户配置文件部署到$ HOME / .mypackagerc(就像.bashrc和朋友一样)。

Now I would like my package to deploy the default user configuration file to $HOME/.mypackagerc (just like .bashrc and friends).

Debhelper提供了一种方法,还是我应该这样做:

Does Debhelper provide a way to do this, or should I just:


  • 在postinst脚本中完成

  • 或者甚至在我的程序中执行此操作,

推荐答案

在您自己的程序中进行操作。

You should do it in your own program.

您无法让debhelper做到这一点。一个发布脚本可能可以在所有当前用户帐户中安装,但是您无法控制用户执行安装后发生的情况。因此,新用户将不会获得〜/ .mypackagerc 文件,除非您也将其放入 / etc / skel 在我看来,这太过分了。

You can't get debhelper to do this. A postinst script may be able to install in all current user accounts, but you lose control of what happens after the user has performed the installation. So new users won't get the ~/.mypackagerc files, unless you put it in /etc/skel also which is overdoing it, in my opinion.

我之所以这样说是因为软件包是由root安装的。根目录不必摆弄其他用户的文件。我不知道Debian Policy是否对此有任何要求,但是如果您自己编写程序来编写这些文件,则可以避免编写很多难看的代码。

I also say this because the package is installed by root. Root shouldn't have to mess around with other user's files. I don't know whether Debian Policy has anything on this, but you'll save yourself writing a lot of ugly code if you program made these files itself.

HTH

这篇关于Debian打包:将文件部署到用户主目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆