首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >当"debuild -rfakeroot -d -us -uc -S“成功时,是什么使”debuild-d“与”命令未找到“一起失败?

当"debuild -rfakeroot -d -us -uc -S“成功时,是什么使”debuild-d“与”命令未找到“一起失败?
EN

Unix & Linux用户
提问于 2018-10-29 00:31:41
回答 1查看 883关注 0票数 0

考虑以下脚本:

代码语言:javascript
复制
#!/usr/bin/env bash

set -ex

wget -N http://archive.ubuntu.com/ubuntu/pool/universe/o/ocaml-re/ocaml-re_1.7.3-2.dsc
wget -N http://archive.ubuntu.com/ubuntu/pool/universe/o/ocaml-re/ocaml-re_1.7.3.orig.tar.gz
wget -N http://archive.ubuntu.com/ubuntu/pool/universe/o/ocaml-re/ocaml-re_1.7.3-2.debian.tar.xz
dpkg-source -x ocaml-re_1.7.3-2.dsc
cd ocaml-re-1.7.3
dpkg-buildpackage -rfakeroot -d -us -uc -S || exit $?
debuild -S || exit $?

当我运行它时,我看到了

代码语言:javascript
复制
+ wget -N http://archive.ubuntu.com/ubuntu/pool/universe/o/ocaml-re/ocaml-re_1.7.3-2.dsc
--2018-10-28 20:29:03--  http://archive.ubuntu.com/ubuntu/pool/universe/o/ocaml-re/ocaml-re_1.7.3-2.dsc
Resolving archive.ubuntu.com (archive.ubuntu.com)... 91.189.88.162, 91.189.88.149, 91.189.91.23, ...
Connecting to archive.ubuntu.com (archive.ubuntu.com)|91.189.88.162|:80... connected.
HTTP request sent, awaiting response... 304 Not Modified
File ‘ocaml-re_1.7.3-2.dsc’ not modified on server. Omitting download.

+ wget -N http://archive.ubuntu.com/ubuntu/pool/universe/o/ocaml-re/ocaml-re_1.7.3.orig.tar.gz
--2018-10-28 20:29:03--  http://archive.ubuntu.com/ubuntu/pool/universe/o/ocaml-re/ocaml-re_1.7.3.orig.tar.gz
Resolving archive.ubuntu.com (archive.ubuntu.com)... 91.189.88.152, 91.189.88.162, 91.189.88.149, ...
Connecting to archive.ubuntu.com (archive.ubuntu.com)|91.189.88.152|:80... connected.
HTTP request sent, awaiting response... 304 Not Modified
File ‘ocaml-re_1.7.3.orig.tar.gz’ not modified on server. Omitting download.

+ wget -N http://archive.ubuntu.com/ubuntu/pool/universe/o/ocaml-re/ocaml-re_1.7.3-2.debian.tar.xz
--2018-10-28 20:29:03--  http://archive.ubuntu.com/ubuntu/pool/universe/o/ocaml-re/ocaml-re_1.7.3-2.debian.tar.xz
Resolving archive.ubuntu.com (archive.ubuntu.com)... 91.189.88.152, 91.189.88.162, 91.189.88.149, ...
Connecting to archive.ubuntu.com (archive.ubuntu.com)|91.189.88.152|:80... connected.
HTTP request sent, awaiting response... 304 Not Modified
File ‘ocaml-re_1.7.3-2.debian.tar.xz’ not modified on server. Omitting download.

+ dpkg-source -x ocaml-re_1.7.3-2.dsc
dpkg-source: warning: extracting unsigned source package (ocaml-re_1.7.3-2.dsc)
dpkg-source: info: extracting ocaml-re in ocaml-re-1.7.3
dpkg-source: info: unpacking ocaml-re_1.7.3.orig.tar.gz
dpkg-source: info: unpacking ocaml-re_1.7.3-2.debian.tar.xz
+ cd ocaml-re-1.7.3
+ dpkg-buildpackage -rfakeroot -d -us -uc -S
dpkg-buildpackage: source package ocaml-re
dpkg-buildpackage: source version 1.7.3-2
dpkg-buildpackage: source distribution unstable
dpkg-buildpackage: source changed by Mehdi Dogguy 
 dpkg-source --before-build ocaml-re-1.7.3
 fakeroot debian/rules clean
dh clean --with ocaml
   dh_testdir
   dh_auto_clean
        make -j1 clean
make[1]: Entering directory '/home/jgross/Documents/repos/coq-debian-build-scripts/ocaml-stuff/debian-sources/foo/ocaml-re-1.7.3'
make[1]: Leaving directory '/home/jgross/Documents/repos/coq-debian-build-scripts/ocaml-stuff/debian-sources/foo/ocaml-re-1.7.3'
   dh_ocamlclean
   dh_clean
 dpkg-source -b ocaml-re-1.7.3
dpkg-source: info: using source format '3.0 (quilt)'
dpkg-source: info: building ocaml-re using existing ./ocaml-re_1.7.3.orig.tar.gz
dpkg-source: info: building ocaml-re in ocaml-re_1.7.3-2.debian.tar.xz
dpkg-source: info: building ocaml-re in ocaml-re_1.7.3-2.dsc
 dpkg-genchanges -S >../ocaml-re_1.7.3-2_source.changes
dpkg-genchanges: not including original source code in upload
 dpkg-source --after-build ocaml-re-1.7.3
dpkg-buildpackage: binary and diff upload (original source NOT included)
+ debuild -S
 dpkg-buildpackage -rfakeroot -d -us -uc -S
dpkg-buildpackage: source package ocaml-re
dpkg-buildpackage: source version 1.7.3-2
dpkg-buildpackage: source distribution unstable
dpkg-buildpackage: source changed by Mehdi Dogguy 
 dpkg-source --before-build ocaml-re-1.7.3
 fakeroot debian/rules clean
dh clean --with ocaml
   dh_testdir
   dh_auto_clean
        make -j1 clean
make[1]: Entering directory '/home/jgross/Documents/repos/coq-debian-build-scripts/ocaml-stuff/debian-sources/foo/ocaml-re-1.7.3'
make[1]: jbuilder: Command not found
Makefile:12: recipe for target 'clean' failed
make[1]: *** [clean] Error 127
make[1]: Leaving directory '/home/jgross/Documents/repos/coq-debian-build-scripts/ocaml-stuff/debian-sources/foo/ocaml-re-1.7.3'
dh_auto_clean: make -j1 clean returned exit code 2
debian/rules:13: recipe for target 'clean' failed
make: *** [clean] Error 2

我感到困惑的是,尽管我已经安装了jbuilder (通过opam),但是debuild -S找不到它,尽管它似乎只是运行了成功的dpkg-buildpackage -rfakeroot -d -us -uc -S。这里发生了什么事?

EN

回答 1

Unix & Linux用户

发布于 2018-10-29 00:45:04

在阅读了手册之后,我发现了环境变量一节,上面写着:

由于环境变量通常会无意中影响包的构建,因此通过删除除TERMHOMELOGNAMEGNUPGHOMEPGPPATHGPG_AGENT_INFOFAKEROOTKEYDEB_*、(CCPPCXXLDF)FLAGS变量以及它们的_APPEND对应变量和本地变量LANGLC_*以外的所有环境变量,从而对环境产生影响。如果未设置TERM,则将其设置为dumb,而PATH设置为"/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11"。请注意,可以使用--prepend-path选项将目录添加到净化路径的开头。当您希望使用ccachedistcc之类的工具进行构建时,这是非常有用的。

因此,问题是opam二进制文件在PATH中,因此在这里找不到。

票数 0
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/478321

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档