tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Abort package installation if alternatives fail to install



Hi,
the INSTALL script in general does not run with "set -e" option.
and hence the autogenerated snippets appended therein, do not
necessarily terminate (implicitly) on failures.
That is, failures are ignored by default.

I think the failure of installation of ALTERNATIVES should be treated
as error, and the package installation should fail.

So I propose an explicit "exit 1" in such situation in the
autogenerated snippet.

The patch is here   https://github.com/NetBSD/pkgsrc/pull/96
Michal Maruška

diff --git a/mk/alternatives.mk b/mk/alternatives.mk
index 9e4d8da0931..fde3a091a0c 100644
--- a/mk/alternatives.mk
+++ b/mk/alternatives.mk
@@ -54,7 +54,7 @@ ${WRKDIR}/.altinstall: ${ALTERNATIVES_SRC}
     ${SED} ${FILES_SUBST_SED} <${ALTERNATIVES_SRC}; \
     ${ECHO} 'EOF'; \
     ${ECHO} 'if ${TEST} -x ${PKG_ALTERNATIVES}; then'; \
-    ${ECHO} '${PKG_ALTERNATIVES} -gs register ./+ALTERNATIVES'; \
+    ${ECHO} '${PKG_ALTERNATIVES} -gs register ./+ALTERNATIVES || exit 1'; \
     ${ECHO} 'fi'; \
     ${ECHO} 'fi'; \
     } >${WRKDIR}/.altinstall


Home | Main Index | Thread Index | Old Index