Передача параметров lintian в pdebuild

Передача параметров lintian в pdebuild

debuild имеет опцию --lintian-opts, которая позволяет передавать опции в lintian. Как передать опции в lintian из pdebuild?

решение1

debuildвызывает lintianнапрямую, поэтому у него есть возможность передавать ему аргументы. pdebuildне делает.

Если вы хотите добавить lintianвызов в свой pdebuildзапуск, вы обычно добавляете pbuilderхук и указываете там параметры. Смотрите /usr/share/doc/pbuilder/examples/B90lintianпример хука иКак запустить lintian из pbuilder-dist?для получения подробной информации о том, как его использовать.

решение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 и передачи ему некоторых параметров.

Связанный контент