rpm/enable-postin-scripts-error.diff

28 lines
962 B
Diff

--- ./lib/transaction.c.orig 2017-12-01 16:02:14.150972487 +0000
+++ ./lib/transaction.c 2017-12-01 16:02:56.139850122 +0000
@@ -1460,7 +1460,9 @@ rpmRC runScript(rpmts ts, rpmte te, Head
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}")));
rpmdb rdb = rpmtsGetRdb(ts);
/* Fake up a transaction element for triggers from rpmdb */
--- ./macros.in.orig 2017-12-01 16:02:14.170972428 +0000
+++ ./macros.in 2017-12-01 16:02:56.140850119 +0000
@@ -1468,6 +1468,11 @@ end}
%{expand:%__scm_setup_%{__scm} %{!-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
#*/