Übergeben von Optionen an Lintian in pdebuild

Übergeben von Optionen an Lintian in pdebuild

debuild verfügt über eine Option --lintian-opts, mit der Optionen an Lintian übergeben werden können. Wie kann ich Optionen von pdebuild an Lintian übergeben?

Antwort1

debuildruft lintiandirekt auf, weshalb es eine Option gibt, Argumente an es zu übergeben. pdebuildtut dies nicht.

lintianWenn Sie Ihrem Lauf einen Aufruf hinzufügen möchten pdebuild, fügen Sie normalerweise einen pbuilderHook hinzu und geben dort Optionen an. /usr/share/doc/pbuilder/examples/B90lintianEin Beispiel für einen Hook finden Sie unter.Wie führe ich Lintian von pbuilder-dist aus?für Einzelheiten zur Verwendung.

Antwort2

Hier ist meine erweiterte Version, B90lintiandie die Übergabe von Optionen an Lintian unterstützt:

#!/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

Die Umgebungsvariablen können verwendet werden LINT, LINTOPTSum Lintian aufzurufen und ihm einige Optionen zu übergeben.

verwandte Informationen