简体   繁体   English

指向.deb包中的真实主目录

[英]Point to the true home directory in .deb package

I have my woking setup.py file; 我的woking setup.py文件; which contain the following line : 其中包含以下行:

home = os.environ["HOME"]   # home =  /home/dr in my machine; 
distutils.core.setup(
... 
data_files=  [  ('%s/.config/autostart'%home,['data/RockDome-autostart.desktop']),      
               ("%s/.gnome2/nautilus-scripts"%home , ['data/Add to RockDome'])  ,
             ]

Now I proceed to create .deb packge by dpkg-buildpackage -i -I -rfakeroot ; 现在,我开始通过dpkg-buildpackage -i -I -rfakeroot创建.deb dpkg-buildpackage -i -I -rfakeroot all are true except that the resulted .deb package has the following hirreracy: 除所得的.deb软件包具有以下惯用性外,其他所有内容均正确:

.deb
    / ... other paths 
    /home
         /dr
            /.gnome2
                   /nautilus-scripts
                                    /Add to RockDome
            /.config
                    /autostart
                              /RockDome-autostart.desktop

As you see; 正如你看到的; the .deb will install some files to the path: .deb会将一些文件安装到路径:

/home/dr/.gnome2/nautilus-scripts/Add to RockDome /home/dr/.gnome2/nautilus-scripts/添加到RockDome

/home/dr/.config/autostart/RockDome-autostart.desktop /home/dr/.config/autostart/RockDome-autostart.desktop

this paths isn't correct except in my machine; 除我的机器外,此路径不正确; in other machinesit will create that dirs outside the home dir of the user!! 在其他机器上,它将在用户的主目录之外创建目录!

Debian packages should not install files to users' home directories. Debian软件包不应将文件安装到用户的主目录。 These files should be installed to the appropriate system-wide locations if possible; 如果可能,应将这些文件安装到适当的系统范围内的位置; if this isn't an option, a postinstall helper script could put them in place for each user. 如果这不是一个选择,则安装后帮助程序脚本可以将其放置在每个用户的位置。 (Keep in mind that there may be more than one user on a system!) (请记住,系统上可能有多个用户!)

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

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