Debian
在 pdebuild 中將選項傳遞給 lintian
debuild 有一個選項
--lintian-opts
允許將選項傳遞給 lintian。如何從 pdebuild 將選項傳遞給 lintian?
debuild
直接呼叫lintian
,這就是為什麼它可以選擇將參數傳遞給它。pdebuild
沒有。如果你想在
lintian
你的執行中添加一個呼叫pdebuild
,你通常會添加一個pbuilder
鉤子,並在那裡指定選項。參見/usr/share/doc/pbuilder/examples/B90lintian
範例鉤子,以及如何從 pbuilder-dist 執行 lintian?有關如何使用它的詳細資訊。
這是我的擴展版本,
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 並向其傳遞一些選項。