Passando opções para o lintian no pdebuild

Passando opções para o lintian no pdebuild

debuild possui uma opção --lintian-optsque permite passar opções para o lintian. Como posso passar opções para o lintian do pdebuild?

Responder1

debuildchama lintiandiretamente, e é por isso que tem a opção de passar argumentos para ele. pdebuildnão.

Se você quiser adicionar uma lintianinvocação à sua pdebuildexecução, normalmente adicionaria um pbuildergancho e especificaria opções nele. Veja /usr/share/doc/pbuilder/examples/B90lintianum exemplo de gancho eComo executo o lintian a partir do pbuilder-dist?para obter detalhes sobre como usá-lo.

Responder2

Aqui está minha versão estendida B90lintianque suporta a passagem de opções para o 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

As variáveis ​​de ambiente LINTe LINTOPTSpodem ser usadas para invocar o lintian e passar algumas opções para ele.

informação relacionada