packaging: don't fail the .deb build when optional lintian is absent
build-debian-package.sh warns at startup that lintian is optional, but then called `lintian -i ...` unconditionally at the end. Under `set -e` that aborted with exit 127 on hosts without lintian — after the .deb had already been built. Guard the call with `command -v lintian` so the build exits 0. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -115,6 +115,11 @@ dpkg-gencontrol -P$BUILD_DIR -v$DEBVERSION
|
|||||||
fakeroot dpkg-deb --build $BUILD_DIR
|
fakeroot dpkg-deb --build $BUILD_DIR
|
||||||
cp $BUILD_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH.deb $SRC_PATH
|
cp $BUILD_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH.deb $SRC_PATH
|
||||||
shasum -a 256 $SRC_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH.deb
|
shasum -a 256 $SRC_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH.deb
|
||||||
# Analyze with Lintian, reporting bugs and policy violations
|
# Analyze with Lintian, reporting bugs and policy violations (optional tool).
|
||||||
lintian -i $SRC_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH.deb
|
# 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
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user