简体   繁体   English

将文件放入主目录

[英]Put files to home directory

I trying to "debianization" my small programm.我试图“debianization”我的小程序。 My programm has "templates" directory.我的程序有“模板”目录。 This folder contains the files the user is working with.此文件夹包含用户正在使用的文件。 The user will also store their files in this directory.用户还将他们的文件存储在此目录中。 But all these operations are done by my program, and I want to hide this folder in the "HOME" directory.但是这些操作都是我的程序完成的,我想把这个文件夹隐藏在“HOME”目录下。 But I do not understand how this can be done with the debianization of the package?但我不明白如何用 debianization 包来做到这一点? I can create a bash script that will create the necessary folders for me, but how can I transfer an already prepared folder with files to a package?我可以创建一个 bash 脚本来为我创建必要的文件夹,但是如何将已经准备好的文件夹与文件传输到包中?

A deb package can only install things in /usr and configuration files in /etc . deb包只能在/usr安装东西,在/etc安装配置文件。 You generally should not modify users' home directories during installation;在安装过程中,您通常不应修改用户的主目录; packages might create customizations for individual users if and when they interact with the installed package eg by running an installed utility for the first time.如果个人用户与已安装的软件包交互,例如第一次运行已安装的实用程序,软件包可能会为他们创建自定义。

Obvious workarounds such as looping over all individual users' home directories from the postinst or configure script violate Debian policy, create unpleasant surprises, and obviously don't work for users whose accounts are created after the package was installed.明显的变通方法,例如从postinstconfigure脚本遍历所有个人用户的主目录,违反了 Debian 政策,会产生令人不快的意外,并且显然不适用于在安装软件包后创建帐户的用户。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM