我一直在python包中看到这一点…一个python包会安装其他文件.在打包的tar中,您将获得如下内容:
-rw-r----- 1 schwehr eng 7 Sep 3 18:10 VERSION
对于:
然后,当您以root用户身份将python setup.py以root身份安装到使用root权限的托管环境(例如,针对MacOSX的fink)时,该文件将由root拥有并保留权限.然后,以用户无法访问此文件的身份运行的代码.
该项目和其他具有相同问题的项目(通常是其安装的鸡蛋部分)使用python setup.py sdist上传.
这些项目应该如何构建具有适当权限的tar,以便所有文件都可以在世界范围内读取?例如
wget https://pypi.python.org/packages/source/S/Scrapy/Scrapy-0.18.2.tar.gz#md5=14f105e2fdb047c666b944990e691389
tar tfvv Scrapy-0.18.2.tar.gz | head
drwx------ buildbot/buildbot 0 2013-09-03 10:30 Scrapy-0.18.2/
-rw------- buildbot/buildbot 385 2013-09-03 10:27 Scrapy-0.18.2/MANIFEST.in
-rw------- buildbot/buildbot 140 2013-09-03 10:30 Scrapy-0.18.2/setup.cfg
drwx------ buildbot/buildbot 0 2013-09-03 10:30 Scrapy-0.18.2/bin/
-rw------- buildbot/buildbot 114 2013-09-03 10:27 Scrapy-0.18.2/bin/runtests.bat
-rwx------ buildbot/buildbot 1271 2013-09-03 10:27 Scrapy-0.18.2/bin/runtests.sh
-rwx------ buildbot/buildbot 68 2013-09-03 10:27 Scrapy-0.18.2/bin/scrapy
drwx------ buildbot/buildbot 0 2013-09-03 10:30 Scrapy-0.18.2/scrapy/
-rw------- buildbot/buildbot 2785 2013-09-03 10:27 Scrapy-0.18.2/scrapy/telnet.py
drwx------ buildbot/buildbot 0 2013-09-03 10:30 Scrapy-0.18.2/scrapy/commands/