gnunnet: halt build if any command fails

There are many places in the packages' install recipes whith multiple
commands being executed in the same shell invocation, separated with a
semicolon (;).  The return status will depend only on the last command
being run.  The same thing happens in loops, where only the last file
will determine the result of the command.

Change the ';' to '&&', and exit the loop if any operation fails.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit 2e75ccbb7d)
This commit is contained in:
Eneas U de Queiroz 2022-10-06 10:02:59 -03:00 committed by Josef Schlehofer
parent c1700e3a33
commit dba8a0102e
No known key found for this signature in database
GPG Key ID: B950216FE4329F4C
1 changed files with 16 additions and 16 deletions

View File

@ -97,42 +97,42 @@ define BuildComponent
define Package/gnunet-$(1)/install
( if [ "$(BIN_$(1))" ]; then \
$(INSTALL_DIR) $$(1)/usr/bin ; \
$(INSTALL_DIR) $$(1)/usr/bin && \
for bin in $(BIN_$(1)); do \
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-$$$$$$$$bin $$(1)/usr/bin/ ; \
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-$$$$$$$$bin $$(1)/usr/bin/ || exit 1; \
done \
fi )
( if [ "$(LIB_$(1))" ]; then \
$(INSTALL_DIR) $$(1)/usr/lib ; \
$(INSTALL_DIR) $$(1)/usr/lib && \
for lib in $(LIB_$(1)); do \
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$$$$$lib.so* $$(1)/usr/lib/ ; \
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$$$$$lib.so* $$(1)/usr/lib/ || exit 1; \
done \
fi )
( if [ "$(PLUGIN_$(1))" ]; then \
$(INSTALL_DIR) $$(1)/usr/lib/gnunet ; \
$(INSTALL_DIR) $$(1)/usr/lib/gnunet && \
for plug in $(PLUGIN_$(1)); do \
$(CP) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$$$$$plug*.so $$(1)/usr/lib/gnunet ; \
$(CP) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$$$$$plug*.so $$(1)/usr/lib/gnunet || exit 1; \
done \
fi )
( if [ "$(LIBEXEC_$(1))" ]; then \
$(INSTALL_DIR) $$(1)/usr/lib/gnunet/libexec ; \
$(INSTALL_DIR) $$(1)/usr/lib/gnunet/libexec && \
for lex in $(LIBEXEC_$(1)); do \
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-$$$$$$$$lex $$(1)/usr/lib/gnunet/libexec ; \
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-$$$$$$$$lex $$(1)/usr/lib/gnunet/libexec || exit 1; \
done \
fi )
( if [ "$(CONF_$(1))" ]; then \
$(INSTALL_DIR) $$(1)/usr/share/gnunet/config.d ; \
$(INSTALL_DIR) $$(1)/usr/share/gnunet/config.d && \
for conf in $(CONF_$(1)); do \
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/$$$$$$$$conf.conf $$(1)/usr/share/gnunet/config.d ; \
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/$$$$$$$$conf.conf $$(1)/usr/share/gnunet/config.d || exit 1; \
done \
fi )
( if [ -e ./files/gnunet-$(1).defaults ]; then \
$(INSTALL_DIR) $$(1)/etc/uci-defaults ; \
$(INSTALL_DIR) $$(1)/etc/uci-defaults && \
$(INSTALL_BIN) ./files/gnunet-$(1).defaults $$(1)/etc/uci-defaults/gnunet-$(1) ; \
fi )
endef
@ -146,7 +146,7 @@ define Package/gnunet/install
( for bin in arm ats cadet core config ecc identity nat nat-auto nat-server nse \
peerinfo peerstore revocation scalarproduct scrypt statistics transport uri; do \
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-$$$$bin $(1)/usr/bin/ ; \
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-$$$$bin $(1)/usr/bin/ || exit 1; \
done )
( for lib in arm ats block blockgroup cadet \
@ -154,11 +154,11 @@ define Package/gnunet/install
identity natauto natnew nse nt peerinfo peerstore regexblock regex revocation \
scalarproduct set seti setu statistics transport transportapplication \
transportcommunicator transportcore transportmonitor util; do \
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$lib.so* $(1)/usr/lib/ ; \
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$lib.so* $(1)/usr/lib/ || exit 1; \
done )
( for plug in ats_proportional block_dht block_regex block_revocation dhtu_gnunet dhtu_ip transport_unix; do \
$(CP) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$plug*.so $(1)/usr/lib/gnunet ; \
$(CP) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$plug*.so $(1)/usr/lib/gnunet || exit 1; \
done )
( for lex in communicator-unix daemon-topology helper-nat-client \
@ -168,13 +168,13 @@ define Package/gnunet/install
service-scalarproduct-alice service-scalarproduct-bob service-scalarproduct-ecc-alice \
service-scalarproduct-ecc-bob service-set service-seti service-setu service-statistics \
service-tng service-transport timeout; do \
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-$$$$lex $(1)/usr/lib/gnunet/libexec ; \
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-$$$$lex $(1)/usr/lib/gnunet/libexec || exit 1; \
done )
( for conf in arm ats cadet communicator-unix core datacache dht dhtu identity \
nat nat-auto nse peerinfo peerstore regex revocation \
scalarproduct set seti setu statistics tlds topology transport util; do \
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/$$$$conf.conf $(1)/usr/share/gnunet/config.d ; \
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/$$$$conf.conf $(1)/usr/share/gnunet/config.d || exit 1; \
done )
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/hellos/* $(1)/usr/share/gnunet/hellos