rpm/enable-postin-scripts-error.diff

28 lines
938 B
Diff

--- ./lib/psm.c.orig 2016-04-21 13:22:27.901033751 +0000
+++ ./lib/psm.c 2016-04-21 13:23:45.324742853 +0000
@@ -285,7 +285,9 @@ static rpmRC runScript(rpmts ts, rpmte t
int warn_only = (stag != RPMTAG_PREIN &&
stag != RPMTAG_PREUN &&
stag != RPMTAG_PRETRANS &&
- stag != RPMTAG_VERIFYSCRIPT);
+ stag != RPMTAG_VERIFYSCRIPT &&
+ !(stag == RPMTAG_POSTIN &&
+ rpmExpandNumeric("%{_fail_on_postinstall_errors}")));
sfd = rpmtsNotify(ts, te, RPMCALLBACK_SCRIPT_START, stag, 0);
if (sfd == NULL)
--- ./macros.in.orig 2016-04-21 13:21:58.933142657 +0000
+++ ./macros.in 2016-04-21 13:22:27.902033748 +0000
@@ -1327,6 +1327,11 @@ end}
%{-S:%{expand:%__scm_setup_%{-S*} %{!-v:-q}}}\
%{!-N:%autopatch %{-v} %{-p:-p%{-p*}}}
+# Should errors in %post scriptlet be propagated as errors?
+#
+# Note: set to 1 for legacy compatibility.
+%_fail_on_postinstall_errors 0
+
# \endverbatim
#*/