diff --git a/util/build-debian-package.sh b/util/build-debian-package.sh index 9505b7ec0..5b48a1938 100755 --- a/util/build-debian-package.sh +++ b/util/build-debian-package.sh @@ -115,6 +115,11 @@ dpkg-gencontrol -P$BUILD_DIR -v$DEBVERSION fakeroot dpkg-deb --build $BUILD_DIR cp $BUILD_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH.deb $SRC_PATH shasum -a 256 $SRC_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH.deb -# Analyze with Lintian, reporting bugs and policy violations -lintian -i $SRC_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH.deb +# Analyze with Lintian, reporting bugs and policy violations (optional tool). +# Guarded so the build does not fail under `set -e` when lintian is not installed. +if command -v lintian >/dev/null 2>&1; then + lintian -i $SRC_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH.deb +else + echo "lintian not installed; skipping package analysis. The .deb was built successfully." +fi exit 0