pdebuild で lintian にオプションを渡す

pdebuild で lintian にオプションを渡す

--lintian-optsdebuildには、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

環境変数を使用してLINTLINTOPTSlintian を呼び出し、いくつかのオプションを渡すこともできます。

関連情報