
debuild 有一個選項--lintian-opts
,允許將選項傳遞給 lintian。如何從 pdebuild 將選項傳遞給 lintian?
答案1
debuild
直接調用lintian
,這就是為什麼它可以選擇向其傳遞參數。pdebuild
沒有。
如果您想要lintian
向pdebuild
運行添加調用,通常需要添加一個pbuilder
掛鉤,並在其中指定選項。請參閱/usr/share/doc/pbuilder/examples/B90lintian
範例鉤子,以及如何從 pbuilder-dist 運行 lintian?了解如何使用它的詳細資訊。
答案2
這是我的擴充版本,B90lintian
支援將選項傳遞給 lintian:
#!/bin/bash
set -e
BUILDDIR="${BUILDDIR:-/tmp/buildd}"
if [ "$LINT" = 1 ] || [ -n "$LINTOPTS" ]; then
apt-get install -y "${APTGETOPT[@]}" lintian
# Because pbuilder has not home directory, calling su - pbuilder will print
# su: warning: cannot change directory to /nonexistent: No such file or directory
# To avoid that warning and to provide the proper current working directory for any
# relative file names used in LINTOPTS, set pbuilder's home directory to source
# directory, which is the (only) subdirectory of the build directory
usermod --home "$BUILDDIR"/*/ pbuilder
echo "I: start of lintian output"
# use this version if you want lintian to fail the build
#su -c "lintian -I --show-overrides $LINTARGS $BUILDDIR/*.changes" - pbuilder
# use this version if you don't want lintian to fail the build
su -c "lintian -I --show-overrides $LINTOPTS $BUILDDIR/*.changes; :" - pbuilder
echo "I: end of lintian output"
fi
環境變數LINT
和LINTOPTS
可用於呼叫 lintian 並向其傳遞一些選項。