使用 distutils 安装到 chroot 环境
我维护一个 chroot 的 Linux 映像,并且有一个软件包想要安装到该 chroot 的映像中。
这两个软件包最终都会安装到两个位置;我不知道发生了什么以及如何解决它。
我的 setup.py:
import os
from distutils.core import setup
setup(name='ServerLibrary',
version='1.1',
description='Server Framework',
author='Michael Brown',
scripts = [ 'foo.py' ],
packages = [ 'ServerLibrary' ],
)
os.chroot('/srv/nfs/chrooted-nfs-client/')
setup(name='ClientLibrary',
version='1.1',
description='Client Framework',
author='Michael Brown',
packages = [ 'ClientLibrary' ],
)
完成我想做的事情的最佳方法是什么?
I maintain a chrooted Linux image and I have a package that I'd like to install into that chrooted image.
Both packages end up getting installed into both locations; I can't figure out what is going on and how to fix it.
My setup.py:
import os
from distutils.core import setup
setup(name='ServerLibrary',
version='1.1',
description='Server Framework',
author='Michael Brown',
scripts = [ 'foo.py' ],
packages = [ 'ServerLibrary' ],
)
os.chroot('/srv/nfs/chrooted-nfs-client/')
setup(name='ClientLibrary',
version='1.1',
description='Client Framework',
author='Michael Brown',
packages = [ 'ClientLibrary' ],
)
What's the best way to accomplish what I'm trying to do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现我需要为文件集指定不同的构建目录。 distutils 假设每次都需要安装“build”中的所有内容。
希望我能省去其他人弄清楚如何做到这一点的麻烦。这是我修复的脚本的第二部分:
I figured out that I needed to specify a different build directory for set of files. distutils was assuming that everything inside 'build' needed to get installed each time.
Hopefully I'll save someone else the trouble of figuring out how to do this. Here's my fixed 2nd part of the script: