Debian packaging: deploying files to the user home directory

◇◆丶佛笑我妖孽 提交于 2020-08-04 06:01:06

问题


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

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

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

  • Do it in postinst script
  • Or even do this in my program, at first execution

回答1:


You should do it in your own program.

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.

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



来源:https://stackoverflow.com/questions/3140886/debian-packaging-deploying-files-to-the-user-home-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!