我正在尝试使用 Spotify 的 dh-virtualenv debian 包助手构建一个 deb 包。
我得到的错误消息:
运行时dpkg-buildpackage -us -uc
:
(venv) $ dpkg-buildpackage -us -uc
dpkg-buildpackage: source package ese-xlr8r
dpkg-buildpackage: source version 1.4.7
dpkg-buildpackage: source distribution UNRELEASED
dpkg-buildpackage: source changed by Special Characters <casDTV_SpecChars@echostar.com>
dpkg-buildpackage: host architecture amd64
dpkg-source --before-build active
fakeroot debian/rules clean
: No such file or directory
'. Stop. No rule to make target `
dpkg-buildpackage: error: fakeroot debian/rules clean gave error exit status 2
我不知道为什么它找不到规则文件。我可以在没有 fakeroot 的情况下手动运行文件并且它可以工作(或者至少它通过了初始错误):
: command not found
: no such job
dh_testdir
dh_auto_clean
pyversions: missing X(S)-Python-Version in control file, fall back to debian/pyversions
pyversions: missing debian/pyversions file, fall back to supported versions
/home/echostar/projects/XLR8R/active/venv/local/lib/python2.7/site-packages/setuptools/dist.py:364: UserWarning: Normalizing '1.4.10
' to '1.4.10'
normalized_version,
running clean
'build/lib.linux-x86_64-2.7' does not exist -- can't clean it
'build/bdist.linux-x86_64' does not exist -- can't clean it
'build/scripts-2.7' does not exist -- can't clean it
dh_clean
因为您没有看到“没有这样的文件或目录”错误。我可以用fakeroot重现错误:
(venv) $ fakeroot debian/rules
: No such file or directory
'. Stop. No rule to make target `
这是我的规则文件:
(venv) $ cat debian/rules
#!/usr/bin/make -f
%:
dh $@ --with python-virtualenv
我错过了什么吗?
注意:'venv' 是我的 virtualenv 的名称并且是活动的。
更新 2016年 8 月 23 日 我将我的代码复制到我们数据中心的另一个虚拟机中,使用稍旧的 Ubuntu 并重新安装所有内容并运行 buildpackage 命令。这次它做得更远了,但最后仍然有类似的错误。我不会发布整个 buildpackage 日志,但最后是要点:
New python executable in debian/ese-xlr8r/usr/share/python/ese-xlr8r/bin/python
Installing setuptools, pip...done.
Downloading/unpacking behave==1.2.5 (from -r ./requirements.txt (line 1))
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement behave==1.2.5 (from -r ./requirements.txt (line 1))
Cleaning up...
No distributions at all found for behave==1.2.5 (from -r ./requirements.txt (line 1))
Storing debug log for failure in /home/echostar/.pip/pip.log
Traceback (most recent call last):
File "/usr/bin/dh_virtualenv", line 106, in <module>
sys.exit(main() or 0)
File "/usr/bin/dh_virtualenv", line 86, in main
deploy.install_dependencies()
File "/usr/lib/python2.7/dist-packages/dh_virtualenv/deployment.py", line 172, in install_dependencies
subprocess.check_call(self.pip('-r', requirements_path))
File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/echostar/dan/xlr8r/debian/ese-xlr8r/usr/share/python/ese-xlr8r/bin/python', '/home/echostar/dan/xlr8r/debian/ese-xlr8r/usr/share/python/ese-xlr8r/bin/pip', 'install', '--log=/tmp/tmpNybuqh', '-r', './requirements.txt']' returned non-zero exit status 1
make: *** [binary] Error 1
dpkg-buildpackage: error: debian/rules binary gave error exit status 2
我不知道为什么它使用 python 前缀调用 pip,例如: python pip install -r ./requirements.txt
Pip 不是这样调用的 python 文件。dh-virtualenv 中可能存在的错误?