deb.am: propagate build errors in native-deb targets

Replace semicolons with && so build failures are not masked by the
subsequent lockfile cleanup.  Use trap to ensure the lockfile is
removed on both success and failure.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Christos Longros <chris.longros@gmail.com>
Closes #18206
Closes #18424
This commit is contained in:
Christos Longros
2026-04-15 23:50:20 +02:00
committed by Tony Hutter
parent da44040bbb
commit a6b3ff9bab
+10 -10
View File
@@ -94,17 +94,17 @@ debian:
cp -r contrib/debian debian; chmod +x debian/rules;
native-deb-utils: native-deb-local debian
while [ -f debian/deb-build.lock ]; do sleep 1; done; \
echo "native-deb-utils" > debian/deb-build.lock; \
cp contrib/debian/control debian/control; \
$(DPKGBUILD) -b -rfakeroot -us -uc; \
$(RM) -f debian/deb-build.lock
while [ -f debian/deb-build.lock ]; do sleep 1; done && \
echo "native-deb-utils" > debian/deb-build.lock && \
trap '$(RM) -f debian/deb-build.lock' EXIT && \
cp contrib/debian/control debian/control && \
$(DPKGBUILD) -b -rfakeroot -us -uc
native-deb-kmod: native-deb-local debian
while [ -f debian/deb-build.lock ]; do sleep 1; done; \
echo "native-deb-kmod" > debian/deb-build.lock; \
sh scripts/make_gitrev.sh; \
fakeroot debian/rules override_dh_binary-modules; \
$(RM) -f debian/deb-build.lock
while [ -f debian/deb-build.lock ]; do sleep 1; done && \
echo "native-deb-kmod" > debian/deb-build.lock && \
trap '$(RM) -f debian/deb-build.lock' EXIT && \
sh scripts/make_gitrev.sh && \
fakeroot debian/rules override_dh_binary-modules
native-deb: native-deb-utils native-deb-kmod