@@ -61,7 +61,7 @@ sed -e 's/.*-o *\([^ ]*\) .*/rm -f \1/g' <"$pkgdir/bits/BUILD" >"$pkgdir/bits/C
# rebuild the .ko's, sign them, pull off the signatures and then finally clean
# up again.
(
- cd "$pkgdir/bits" || exit 1
+ cd "$pkgdir/bits"
# Add checksum check.
echo "\$check_only sha256sum -c SHA256SUMS || exit 1" >>"$pkgdir/bits/BUILD"
@@ -110,4 +110,4 @@ sed -e 's/.*-o *\([^ ]*\) .*/rm -f \1/g' <"$pkgdir/bits/BUILD" >"$pkgdir/bits/C
find "$pkgdir" -name \*.sig -prune -o -name SHA256SUMS -prune -o -type f -print | xargs rm -f
find "$pkgdir" -depth -type d -print | xargs rmdir --ignore-fail-on-non-empty
fi
-) || exit "$?"
+)
The current code is effectively this: set -e; (false; true) || exit "$?" Due to historical reasons any code inside a pipeline is executed with `set +e` mode effective, meaning false command doesn't return, the rest of commands are executed, and the error code from () is set to the last (usually successful) command. This is the reason, why my previous buggy behaviour despite generating errors inside the dkms-build--nvidia-N didn't abort the build, but happily produced linux-nvidia-objects.deb which contained empty SHA256SUMS file and broken BUILD CLEAN scripts that did nothing. Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com> --- debian/scripts/dkms-build--nvidia-N | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)