Patchwork [1/2] libv4l: properly error out when one of the make step fails

login
register
mail settings
Submitter Thomas Petazzoni
Date Oct. 14, 2012, 6:18 p.m.
Message ID <1350238701-30441-1-git-send-email-thomas.petazzoni@free-electrons.com>
Download mbox | patch
Permalink /patch/191372/
State Accepted
Commit 5c28f5956f7da25071303411c8fef308065f2887
Headers show

Comments

Thomas Petazzoni - Oct. 14, 2012, 6:18 p.m.
In libv4l.mk, if there are multiple elements in $(LIBV4L_DIRS_y), they
are built in order, one after the other. However, our loop construct
doesn't take into account the fact that we should error out if one of
the steps failed.

A good illustration is having BR2_PACKAGE_LIBV4L_DECODE_TM6000 and
BR2_PACKAGE_LIBV4L_V4L2_CTL enabled. The build of decode-tm6000 will
fail, but the build will happily continue without stopping in libv4l.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/libv4l/libv4l.mk |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Peter Korsgaard - Oct. 14, 2012, 6:53 p.m.
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 Thomas> In libv4l.mk, if there are multiple elements in $(LIBV4L_DIRS_y), they
 Thomas> are built in order, one after the other. However, our loop construct
 Thomas> doesn't take into account the fact that we should error out if one of
 Thomas> the steps failed.

 Thomas> A good illustration is having BR2_PACKAGE_LIBV4L_DECODE_TM6000 and
 Thomas> BR2_PACKAGE_LIBV4L_V4L2_CTL enabled. The build of decode-tm6000 will
 Thomas> fail, but the build will happily continue without stopping in libv4l.

Committed both, thanks.

Patch

diff --git a/package/libv4l/libv4l.mk b/package/libv4l/libv4l.mk
index 6c782b0..15e48ed 100644
--- a/package/libv4l/libv4l.mk
+++ b/package/libv4l/libv4l.mk
@@ -24,19 +24,19 @@  endif
 define LIBV4L_BUILD_CMDS
 	for i in $(LIBV4L_DIRS_y); do \
 		$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)/$$i \
-			$(LIBV4L_MAKE_OPTS); done
+			$(LIBV4L_MAKE_OPTS) || exit 1 ; done
 endef
 
 define LIBV4L_INSTALL_STAGING_CMDS
 	for i in $(LIBV4L_DIRS_y); do \
 		$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)/$$i \
-			DESTDIR=$(STAGING_DIR) $(LIBV4L_MAKE_OPTS) install; done
+			DESTDIR=$(STAGING_DIR) $(LIBV4L_MAKE_OPTS) install || exit 1; done
 endef
 
 define LIBV4L_INSTALL_TARGET_CMDS
 	for i in $(LIBV4L_DIRS_y); do \
 		$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)/$$i \
-			DESTDIR=$(TARGET_DIR) $(LIBV4L_MAKE_OPTS) install; done
+			DESTDIR=$(TARGET_DIR) $(LIBV4L_MAKE_OPTS) install || exit 1; done
 endef
 
 $(eval $(generic-package))